我正在使用 WiX Bootstrapper(使用 WixStandardBootstrapperApplication)创建一个简单的可执行捆绑安装程序,它仅安装一个 MSI,当我运行它时,安装和卸载工作正常。
我想知道捆绑安装程序是否可以检测并卸载已安装的 MSI 软件包?例如,如果我将 MSI 软件包作为独立安装(不通过捆绑包)并随后运行捆绑包安装程序,捆绑包安装程序是否可以检测到 MSI 已安装并立即显示“卸载”对话框?
查看日志,当我运行捆绑安装程序时,似乎已安装的 MSI 软件包被正确检测为“存在”,但问题是 - 在这种情况下,我们可以强制捆绑安装程序直接进入“卸载”对话框吗?
Detected package: install_x64, state: Present, cached: None
这是一个简单的代码示例:
捆绑包.wxs:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Bundle Name="BootstrapperExample" Version="1.0.0.0" Manufacturer="test1" UpgradeCode="2f33c6d1-e609-4e78-951d-3402d2388613">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
<Chain>
<MsiPackage Id="install_x64" SourceFile="C:\test\product1.msi" DisplayInternalUI="yes" Compressed="yes" Visible="yes">
</MsiPackage>
</Chain>
</Bundle>
</Wix>
产品.wxs:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="product1" Language="1033" Version="1.0.0.0" Manufacturer="test1" UpgradeCode="51804053-BF8C-4DD0-A45F-9F829CF1BE8B">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MediaTemplate />
<Feature Id="ProductFeature" Title="product1" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
<UIRef Id="WixUI_Minimal" />
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="product1" />
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="ProductComponent">
<File KeyPath="yes" Source="C:\test\file1.txt"></File>
</Component>
</ComponentGroup>
</Fragment>
</Wix>
不。不支持捆绑包卸载今天未安装的 MSI。
一个 MSI 可以升级另一个 MSI,这可以以一种迂回的方式完成你想要的事情。