使用 Wix 3.8,使用bundle 当卸载程序打包在 exe 安装程序中时,如何卸载 ExePackage?



我在StackOverflow上查看了几个答案,但我无法找到解决当前面临的问题的确切

内容我正在使用Wix 3.8和Visual Studio 2008,并且创建了一个XML部署项目,Bundle.wxs文件如下所示。

这是我的 Bundle.wxs 文件

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" 
xmlns:bal="http://schemas.microsoft.com/wix/BalExtension" 
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" >
<Bundle Name="SomeCompanyBundle"
Version="1.0.0.0"
Manufacturer="Some Company"
UpgradeCode="348d9d7c-6a37-44cd-8054-61b97777b5bd" 
IconSourceFile="..Some Companylogo_64.ico">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" >
<bal:WixStandardBootstrapperApplication 
LicenseFile="..Some Companylicense-agreement.rtf"
LogoFile="..Some Companylogo_64.png" />
</BootstrapperApplicationRef>
<Chain>
<!-- TODO: Define the list of chained packages. -->
<ExePackage Id="EXE_UsbDriversInstallerExe"
DisplayName="Driver Installer Executable" 
Compressed="yes"
Cache="yes"
PerMachine="yes"
Permanent="no"
Vital="yes"
SourceFile="..Some CompanyDrivers-Installer.exe"
InstallCommand="/SILENT=YES"
/>

<!-- More MsiPackages are used in real Bundle.wxs, but they aren't included in this question, because they are working on install and uninstall -->
</Chain>
</Bundle>
</Wix>

这将创建一个捆绑安装文件,称为 SomeCompanyBundle.exe

我可以通过命令提示符安装此捆绑包,例如 SomeCompanyBundle.exe/quiet/install,即不显示安装 GUI。

我遇到的问题是卸载,这是由于驱动程序安装程序提供的命令行选项有限.exe(这是一个旧的安装程序.exe来自第三方公司的文件,不存在(

唯一可用的选项是 SILENT=(是/否(或 LANG=(英语、西班牙语....(。

此驱动程序安装程序.exe不允许卸载操作。 它有一个卸载.exe程序捆绑在驱动程序 - 安装程序中.exe并且此卸载.exe仅在成功安装驱动程序 - 安装程序后可用.exe

卸载.exe安装后,始终位于完整路径c:\Program Files(x 86(\Some第三方公司\驱动程序安装\卸载.exe

那么当我需要卸载 SomeCompanyBundle 时.exe当我使用命令提示符运行 SomeCompanyBundle 时.exe我该如何运行此卸载.exe/quiet/uninstall

我尝试过的解决方案是:

1( 卸载命令="SILENT=YES" ---- 由于上述原因,不起作用。

2(自定义操作-----对如何运行卸载感到困惑.exe仅在捆绑卸载操作上。

3(玩了uil:DirectorySearch和util:RegistrySearch。我再次对如何运行卸载感到困惑.exe只是在捆绑卸载操作上。

任何有关示例/解释的帮助将不胜感激。

提前干杯。

这里有一个有趣的方法可以做到这一点。我做了类似的事情,我有一个安装,安装后,会在您运行的系统上的某个位置放置"卸载.exe以卸载产品。

使用 util:FileSearch 查看该产品是否已安装。

<util:FileSearch 
Id="UsbDriversDirSearch"
Path="[ProgramFilesFolder]SomeThirdPartyCompanyDrivers-InstalledUninstall.exe"
Result="exists"
Variable="UsbDriversInstalled" />

您还应该向EXE_UsbDriversInstallerExe<ExePackage>添加DetectCondition="UsbDriversInstalled = 1"这将阻止您尝试双重安装此产品。

创建第二个<ExePackage>

<ExePackage
Id="EXE_UsbDriversUninstallerExe"
DetectCondition="NOT WixBundleInstalled OR UsbDriversInstalled = 1"
UninstallCommand="whatever the uninstall command is"
SourceFile="[ProgramFilesFolder]SomeThirdPartyCompanyDrivers-InstalledUninstall.exe"
PerMachine="yes"
Cache="no"
Compressed="no" />

因此,现在您将始终具有卸载.exe"已安装",您可以在卸载捆绑包时卸载此ExePackage,因为它具有卸载命令。

最新更新