在 WiX 中重新启动后继续安装 [英] Resume installing after restart in WiX

查看:44
本文介绍了在 WiX 中重新启动后继续安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 WixStandardBootstrapperApplication 创建引导应用程序.除了处理重新启动之外,它可以完成我需要它做的所有事情.

I'm trying to create a bootstrap application using WixStandardBootstrapperApplication. It does everything I need it to do really well except handling a restart.

我需要安装一组 EXE 文件.只有第一个是 .NET 4.5 并且需要重新启动.我会延迟重启,但我不能,因为其他程序之一依赖于它.我试过使用退出代码来强制重启,但是当计算机启动备份时,引导程序每次都卡在该退出代码上,我无法安装其他任何东西.当且仅当程序尚未重新启动(或任何其他合乎逻辑的方式)时,有没有办法应用退出代码?

I need to install a group of EXE files. Only the first one is .NET 4.5 and that requires a restart. I would delay the restart, but I can't because one of the other programs is dependent on it. I've tried using an exit code to forcereboot, but when the computer starts back up the bootstrapper gets stuck at that exit code every time, and I can't install anything else. Is there a way to apply the exit code if and only if the program has not restarted yet (or any other logical way)?

这就是我正在做的...

Here's what I'm doing...

<ExePackage
  Id               = "NetFx45Redist"
  Cache            = "no"
  Compressed       = "yes"
  PerMachine       = "yes"
  Permanent        = "yes"
  Vital            = "yes"
  InstallCommand   = "/quiet /norestart"

  SourceFile       = "C:\Users\visibleEP\Documents\Visual Studio 2012\Projects\Bootstrapper1\VEP Deploy\Setup Files\dotNetFx45_Full_setup.exe"
  DetectCondition  = "(Netfx4FullVersion=&quot;4.5.50709&quot;) AND (NOT VersionNT64 OR (Netfx4x64FullVersion=&quot;4.5.50709&quot;))"
  InstallCondition = "(VersionNT >= v6.0 OR VersionNT64 >= v6.0) AND (NOT (Netfx4FullVersion=&quot;4.5.50709&quot; OR Netfx4x64FullVersion=&quot;4.5.50709&quot;))">

  <ExitCode Behavior = "forceReboot"/>
</ExePackage>

<ExePackage
  SourceFile = "...\...\Setup Files\Encoder_en.exe"
  InstallCommand = "/q"/>

<ExePackage
  SourceFile = "...\...\Setup Files\vcredist_x86.exe"
  InstallCommand = "/q /ACTION=Install"
  RepairCommand = "/q ACTION=Repair /hideconsole" />

<ExePackage
  SourceFile = "...\...\Setup Files\vcredist_x64.exe"
  InstallCommand = "/q /ACTION=Install"
  RepairCommand = "/q ACTION=Repair /hideconsole" />

推荐答案

替换

<ExitCode Behavior="forceReboot"/>

<ExitCode Behavior="forceReboot" Value="1641" />
<ExitCode Behavior="forceReboot" Value="3010" />

1641 和 3010 都是需要重新启动才能完成安装.此消息表示成功."

Both 1641 and 3010 are "A restart is required to complete the installation. This message indicates success."

您的版本将所有退出代码视为与您观察到的相同.请参阅有关该安装程序的文档.幸运的是,退出代码已记录在案.

Your version treats all exit codes as the same, which you observed. See the documentation on that installer. Fortunately, exit codes are documented.

更新:我添加了已知的成功代码和一个包罗万象的可能是 error 如果您确信所有成功代码都已记录.

UPDATE: I added known success codes and a catch-all which could be error if you are confident that all success codes are documented.

<ExitCode Behavior="success" Value="0" />
<ExitCode Behavior="error"/>

这篇关于在 WiX 中重新启动后继续安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆