.net - 在 WiX 中重启后继续安装

标签 .net wix restart resume wix3.7

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

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

这是我正在做的...

<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 都是 “需要重新启动才能完成安装。此消息表示成功。”

您的版本将所有退出代码视为相同,您已观察到这一点。参见 the documentation在那个安装程序上。幸运的是,退出代码已记录在案。

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

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

关于.net - 在 WiX 中重启后继续安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17218785/

相关文章:

c# - WIX 和 C# 中的 "SystemFolder"

php - 如何从 PHP 脚本暂停/重启 Linux Ubuntu?

c# - 验证摘要应显示在警告消息框中?

.net - 为什么在MVVM Light中没有PropertyChanged的简写

c# - C#中Datagridview的数字格式

c# - 在 session "An unhandled exception of type ' System.StackOverflowException 上发生在 mscorlib.dll 中”

wpf - 在 WPF 中更改 View 时,ViewModel 中的文本框值未更新

wix - 是否可以同时只运行一个 WiX msi 实例?

javascript - 如何在 node.js 中重启程序

windows - 在 Windows 上重新启动 Hudson