重新启动后WiX刻录/强制重启继续安装

Gau*_*rav 5 installation windows-xp wix burn wix3.7

我有一个使用ManagedBootstrapperApplicationHost 的WiX Burn自定义安装程序.安装其中一个必备的Microsoft Windows Installer 4.5之后,我使用以下方法强制重启PC(Windows XP):

<ExitCode Behavior="forceReboot"/>
Run Code Online (Sandbox Code Playgroud)

Bundle链看起来像这样:

<Chain>
   <PackageGroupRef Id="WindowsInstaller45"/>
   <PackageGroupRef Id="Netfx2Full"/>
   <PackageGroupRef Id="Netfx4Full"/>
   <PackageGroupRef Id="CustomPkg"/>
   <PackageGroupRef Id="SQLExpress"/>
</Chain>
Run Code Online (Sandbox Code Playgroud)

重新启动后,我希望我的安装在此之后继续,但它实际上检测到安装并显示卸载选项.

如何在安装期间重新启动时检测未完成的安装?

Rob*_*ing 9

在重新启动后再次启动Bundle时,BOOTSTRAPPER_COMMAND传递给BootstrapperApplicationCreate函数的struct 包含一个resumeType将设置为的字段BOOTSTRAPPER_RESUME_TYPE_REBOOT.在托管代码中,BootstrapperApplication该类包含一个Command包含该resume字段的属性.

例如,在托管代码中,要告知BootstrapperApplication重启后启动,您可以检查:

 if (BootstrapperApplication.Command.resume == ResumeType.Reboot)
 {
    // started after restart, go straight to Detect->Plan->Apply to finish the
    // previous operation. BootstrapperApplication.Command.action will tell us
    // the action to complete.
 }
 else
 {
    // started normally, show typical UI scenarios.
 }
Run Code Online (Sandbox Code Playgroud)