wix - 先决条件未在条件失败时运行

标签 wix wix3.7

我有一个 Burn bundle (WIX 3.7),如果运行 bundle 的系统上不存在 .NET 4.5 框架,它应该安装它。

这是我包含先决条件的片段:

<Fragment>
<WixVariable Id="WixMbaPrereqPackageId" Value="Netfx45FullPrereq" />
<WixVariable Id="WixMbaPrereqLicenseUrl" Value="NetFx45Eula.rtf" />

<util:RegistrySearch 
  Root="HKLM" 
  Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full" 
  Value="Version" 
  Variable="Netfx45Version" />

<PackageGroup
    Id="Netfx45FullPrereq">
  <ExePackage
      Id="Netfx45FullPrereq"
      Cache="no"
      Compressed="no"
      PerMachine="yes"
      Permanent="yes"
      Vital="yes"
      SourceFile="..\..\ThirdParty\Windows Installer\dotnetfx45_full_x86_x64.exe"
      Name="dotnetfx45_full_x86_x64.exe"
      InstallCommand="/passive /norestart"
      InstallCondition="NOT Netfx45Version OR (Netfx45Version &lt; v4.5.50709)"
      DetectCondition="Netfx45Version AND (Netfx45Version &gt;= v4.5.50709)" />
</PackageGroup>
</Fragment>

我在一台机器上可以用,但是在另一台机器上就不行了。

这是 .NET 安装程序运行的机器 (Window Server 2008 R2) 的日志:

[0B68:0D24][2014-01-17T16:27:24]i001: Burn v3.7.1224.0, Windows v6.1 (Build 7601: Service Pack 1), path: C:\Users\Administrator\Desktop\ProductName Installer\ProductName Setup.exe, cmdline: '-burn.unelevated BurnPipe.{27DB9848-09B3-4E3A-8CF3-D27BE5508398} {57F2A2B4-8B66-41E6-9488-A18E40965A62} 3848'
[0B68:0D24][2014-01-17T16:27:24]i000: Setting string variable 'WixBundleLog' to value 'C:\Users\ADMINI~1\AppData\Local\Temp\ProductName_20140117162724.log'
[0B68:0D24][2014-01-17T16:27:24]i000: Setting string variable 'WixBundleOriginalSource' to value 'C:\Users\Administrator\Desktop\ProductName Installer\ProductName Setup.exe'
[0B68:0D24][2014-01-17T16:27:24]i000: Loading prerequisite bootstrapper application because managed host could not be loaded, error: 0x80070490.
[0B68:0D24][2014-01-17T16:27:24]i100: Detect begin, 3 packages
[0B68:0D24][2014-01-17T16:27:24]i000: Registry key not found. Key = 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full'
[0B68:0D24][2014-01-17T16:27:24]i102: Detected related bundle: {014bc187-ac3e-49eb-a86b-bc1aff00df4e}, type: Upgrade, scope: PerMachine, version: 0.6.0.0, operation: None
[0B68:0D24][2014-01-17T16:27:24]i102: Detected related bundle: {2171cc02-2faf-4e06-bd43-fa473ed5fa20}, type: Upgrade, scope: PerMachine, version: 0.6.0.0, operation: None
[0B68:0D24][2014-01-17T16:27:24]i102: Detected related bundle: {4240a35a-bf8b-4465-97c1-3e2653e34c25}, type: Upgrade, scope: PerMachine, version: 0.6.0.0, operation: None
[0B68:0D24][2014-01-17T16:27:24]i102: Detected related bundle: {5e33e695-3dc7-4871-a059-9965bc8c76d6}, type: Upgrade, scope: PerMachine, version: 0.6.0.0, operation: None
[0B68:0D24][2014-01-17T16:27:24]i102: Detected related bundle: {6f2e85ba-1010-4870-94a7-9e220b8d80cc}, type: Upgrade, scope: PerMachine, version: 0.6.0.0, operation: None
[0B68:0D24][2014-01-17T16:27:24]i102: Detected related bundle: {aa47b386-8505-4de6-90e5-78a7d0ce37e0}, type: Upgrade, scope: PerMachine, version: 0.6.0.0, operation: None
[0B68:0D24][2014-01-17T16:27:24]i102: Detected related bundle: {c6564625-564f-4b3c-b91f-7bcde363a62f}, type: Upgrade, scope: PerMachine, version: 0.6.0.0, operation: None
[0B68:0D24][2014-01-17T16:27:24]i102: Detected related bundle: {cd20283a-14f4-4b5d-bca9-f16d992948c4}, type: Upgrade, scope: PerMachine, version: 0.6.0.0, operation: None
[0B68:0D24][2014-01-17T16:27:24]i102: Detected related bundle: {f0c01f09-d2bb-4a26-9aac-c2be4d9b02da}, type: Upgrade, scope: PerMachine, version: 0.6.0.0, operation: None
[0B68:0D24][2014-01-17T16:27:24]i102: Detected related bundle: {f642578c-7e94-4a7e-b884-870a844c9177}, type: Upgrade, scope: PerMachine, version: 0.6.0.0, operation: None
[0B68:0D24][2014-01-17T16:27:24]i052: Condition 'NETFRAMEWORK45' evaluates to false.
[0B68:0D24][2014-01-17T16:27:24]i101: Detected package: Netfx45FullPrereq, state: Absent, cached: None
[0B68:0D24][2014-01-17T16:27:24]i101: Detected package: ProductNameSetup, state: Absent, cached: None
[0B68:0D24][2014-01-17T16:27:24]i104: Detected package: ProductNameSetup, feature: DatabaseFeature, state: Absent
[0B68:0D24][2014-01-17T16:27:24]i104: Detected package: ProductNameSetup, feature: InfrastructureFeature, state: Absent
[0B68:0D24][2014-01-17T16:27:24]i199: Detect complete, result: 0x0

这是未显示 .NET 安装程序的计算机 (Windows 7) 的日志:

[0B78:0B00][2014-01-17T20:02:44]i001: Burn v3.7.1224.0, Windows v6.1 (Build 7601: Service Pack 1), path: C:\Users\Master of Puppets\Desktop\Release\ProductName Setup.exe, cmdline: '-burn.unelevated BurnPipe.{923B76FF-EE93-4FF9-9115-31A62D349563} {7BA5CB98-B614-4EF6-B014-7EEA687287A9} 2124'
[0B78:0B00][2014-01-17T20:02:44]i000: Setting string variable 'WixBundleLog' to value 'C:\Users\MASTER~1\AppData\Local\Temp\ProductName_20140117200244.log'
[0B78:0B00][2014-01-17T20:02:44]i000: Setting string variable 'WixBundleOriginalSource' to value 'C:\Users\Master of Puppets\Desktop\Release\ProductName Setup.exe'
[0B78:0B00][2014-01-17T20:02:44]i000: Setting string variable 'WixBundleName' to value 'ProductName'
[0B78:0B00][2014-01-17T20:02:44]i000: Loading managed bootstrapper application.
[0B78:0B00][2014-01-17T20:02:44]i000: Creating BA thread to run asynchronously.
[0B78:0B00][2014-01-17T20:02:45]i100: Detect begin, 3 packages
[0B78:0B00][2014-01-17T20:02:45]i000: Registry value not found. Key = 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full', Value = 'Release'
[0B78:0B00][2014-01-17T20:02:45]i052: Condition 'NETFRAMEWORK45' evaluates to false.
[0B78:0B00][2014-01-17T20:02:45]i101: Detected package: Netfx45FullPrereq, state: Absent, cached: None
[0B78:0B00][2014-01-17T20:02:45]i101: Detected package: ProductNameSetup, state: Absent, cached: None
[0B78:0B00][2014-01-17T20:02:45]i104: Detected package: ProductNameSetup, feature: DatabaseFeature, state: Absent
[0B78:0B00][2014-01-17T20:02:45]i104: Detected package: ProductNameSetup, feature: InfrastructureFeature, state: Absent
[0B78:0B00][2014-01-17T20:02:45]i199: Detect complete, result: 0x0
[0B78:0B00][2014-01-17T20:02:49]i500: Shutting down, exit code: 0x0
[0B78:0B00][2014-01-17T20:02:49]i410: Variable: WixBundleAction = 4
[0B78:0B00][2014-01-17T20:02:49]i410: Variable: WixBundleElevated = 1
[0B78:0B00][2014-01-17T20:02:49]i410: Variable: WixBundleLog = C:\Users\MASTER~1\AppData\Local\Temp\ProductName_20140117200244.log
[0B78:0B00][2014-01-17T20:02:49]i410: Variable: WixBundleManufacturer = CompanyName
[0B78:0B00][2014-01-17T20:02:49]i410: Variable: WixBundleName = ProductName
[0B78:0B00][2014-01-17T20:02:49]i410: Variable: WixBundleOriginalSource = C:\Users\Master of Puppets\Desktop\Release\ProductName Setup.exe
[0B78:0B00][2014-01-17T20:02:49]i410: Variable: WixBundleProviderKey = {d62f0df8-e5e6-4fc6-9924-202de1286a25}
[0B78:0B00][2014-01-17T20:02:49]i410: Variable: WixBundleTag = 
[0B78:0B00][2014-01-17T20:02:49]i410: Variable: WixBundleVersion = 0.6.0.0
[0B78:0B00][2014-01-17T20:02:49]i007: Exit code: 0x0, restarting: No

在这两种情况下,检测条件都返回 false,我认为这会触发 .NET 安装程序运行。显然情况并非如此,我不确定为什么我会得到两种不同的行为。有没有人有任何想法为什么它会在一台机器上而不是另一台机器上工作?

最佳答案

它不起作用的原因是我没有在我的 BootstrapperCore.config 文件的受支持运行时元素中设置 sku 属性。这是我的启动元素现在的样子:

<startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>

关于wix - 先决条件未在条件失败时运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21196507/

相关文章:

string - 字符串的最大长度是多少?

wix - 将命令行参数从 WiX 包传递给 MSI

linux - 如何在非 Windows 操作系统的 WiX 安装程序中获取操作系统名称?

windows - 在 Wix 中获取命令行参数

在 Burn 中测试安装失败

c# - 从 CA 到 Wix 的 Wix 自定义操作设置值

WiX - 卸载 msi 时如何卸载 bundle

service - 防止服务在 WiX 重大升级时丢失设置

wix - MSI 安装日志显示 : Note: 1: 2205 2: 3: Error

c# - 自定义操作 session.message 不显示消息框