【发布时间】:2020-01-14 12:50:58
【问题描述】:
我正在使用 Wix Toolset v3.11 并使用 WixStandardBootstrapperApplication 创建了一个引导程序。这非常简单,将我的 .msi 和依赖产品的 .msi 链接在一起。
<Chain>
<MsiPackage SourceFile="$(var.MySetupProject.TargetPath)" Id="MyId" Vital="yes">
<MsiProperty Name="INSTALLFOLDER" Value="[InstallFolder]" />
</MsiPackage>
<MsiPackage Visible="yes" DisplayName="Dependency (64-bit)"
DownloadUrl="https://myDownloadUrl/Dependency-64.msi"
SourceFile="..\Dependency-64.msi"
Compressed="no"
InstallCondition="VersionNT64"/>
<MsiPackage Visible="yes" DisplayName="Dependency (32-bit)"
DownloadUrl="https://myDownloadUrl/Dependency-32.msi"
SourceFile="..\Dependency-32.msi"
Compressed="no"
InstallCondition="NOT VersionNT64"/>
</Chain>
在我的产品的 .msi 中,我创建了一些版本控制条件,如果使用自定义操作匹配,则会显示错误对话框。
<Upgrade Id="PUT-GUID-HERE">
<UpgradeVersion OnlyDetect="yes" Property="SELFFOUND" Minimum="!(bind.FileVersion.MainEXE)" IncludeMinimum="yes" Maximum="!(bind.FileVersion.MainEXE)" IncludeMaximum="yes" />
<UpgradeVersion OnlyDetect="yes" Property="NEWERFOUND" Minimum="!(bind.FileVersion.MainEXE)" IncludeMinimum="no" />
<UpgradeVersion OnlyDetect="yes" Property="PREVFOUND_IA" Minimum="1.0.0.0" IncludeMinimum="yes" Maximum="4.11.7312.0" IncludeMaximum="yes" />
<UpgradeVersion OnlyDetect="no" Property="PREVIOUSFOUND" Minimum="4.11.7313.0" IncludeMinimum="yes" Maximum="!(bind.FileVersion.MainEXE)" IncludeMaximum="no" />
</Upgrade>
<CustomAction Id="UninstallOldAlert" Error="[ProductName] is already installed. Please remove via Add/Remove Programs first." />
<CustomAction Id="AlreadyUpdated" Error="[ProductName] is already installed." />
<CustomAction Id="NoDowngrade" Error="A later version of [ProductName] is already installed." />
<InstallExecuteSequence>
<RemoveExistingProducts After="InstallInitialize">PREVIOUSFOUND</RemoveExistingProducts>
<Custom Action="UninstallOldAlert" After="FindRelatedProducts">PREVFOUND_IA</Custom>
<Custom Action="AlreadyUpdated" After="FindRelatedProducts">SELFFOUND</Custom>
<Custom Action="NoDowngrade" After="FindRelatedProducts">NEWERFOUND</Custom>
</InstallExecuteSequence>
如果我只运行 .msi,它会正确显示错误消息并关闭,但是当我运行引导程序时,它只会跳过并安装依赖项。我想要发生的是将错误传递给引导程序,但我似乎找不到有关如何执行此操作的任何说明?我已经尝试在包中的包上设置 DisplayInternalUI,但这没有效果。
我在运行 .msi 时看到并希望在引导程序中看到的消息是名为“UninstallOldAlert”的 CustomAction
如果需要,很乐意提供更多信息,在此先感谢。
更新:
我也尝试在我的 Product 元素中使用 Condition 元素,但这具有相同的行为,它会将成功传递给引导程序。 :(
【问题讨论】:
标签: wix