我使用 WIX 和 WPF 项目创建了一个自定义安装程序。我正在尝试在安装程序成功完成后启动应用程序。当我使用 Process.Start(AppPath); 它不会从指定路径开始文件,而是使用临时文件中的路径。在常见情况下使用
<Variable Name="LaunchTarget" Value="[InstallFolder]\pCloud Drive\pCloud.exe"/>
会在“完成”页面中出现一个按钮,但我正在制作我的自定义 UI,所以这不起作用。
以某种方式编辑现在它正在工作。我在用着
if (LaunchApp)
{
ProcessStartInfo exeFile = new ProcessStartInfo(this.AppPath);
Process.Start(exeFile);
}
///don't call Environment.Exit. The BA is a guest in the process, Bootstrapper.Engine.Quit is how you tell Burn that you're done. Burn will call ExitProcess from there.
WixBootstrapper.BootstrapperDispatcher.InvokeShutdown();