我已经在计算机上安装了" ABC 10.1"程序版本,我想在每个较新的abc.ms.s.ms.sinsintation上删除它(例如,何时安装ABC 10.2)。
到目前为止,我已经使用了Bootstrapper安装新版本,它就像魅力一样(以前的版本已卸载并从控制面板中删除,最新的最新版本出现在控制面板中)。
现在,我想使用abc.msi进行安装,并且不使用Bootstrapper,但是当我使用ABC.MSI安装程序时,前一个没有从控制面板中删除,并且我有两个" ABCS" 10.1和10.2在控制面板中的版本。
如何删除Bootstrapper在最新ABC.MSI安装期间安装的ABC上一个版本(并避免在控制面板中重复ABC)?
bundle.wxs
<Bundle
Name="$(var.ProductName)"
Version="$(var.ShowVersion)"
Manufacturer="ABC"
UpgradeCode="33312c8d-64f1-4a04-a98e-4aa692de6aaf"
IconSourceFile="$(var.BaseDir)SetupUIABC.ico"
Condition="((VersionNT = v6.1 AND ServicePackLevel >= 1) OR (VersionNT > v6.1)) AND (WixBundleInstalled = 0)">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense">
<bal:WixStandardBootstrapperApplication
LicenseFile="$(var.BaseDir)SetupUILicense.rtf"
LogoFile="$(var.BaseDir)SetupUIOticonAppIcon.png"
SuppressOptionsUI="yes"
ShowVersion="yes"/>
</BootstrapperApplicationRef>
<Chain>
<!-- Install .Net 4.6.1 -->
<PackageGroupRef Id='NetFx461Redist'/>
<!-- my packages to install -->
<PackageGroupRef Id="InstallerPackages" />
</Chain>
</Bundle>
<Fragment>
<PackageGroup Id ="InstallerPackages" >
<MsiPackage SourceFile="$(var.OutDir)ABC.MSI" />
<MsiPackage SourceFile="$(var.OutDir)DatabaseInstallerABC.msi" />
</PackageGroup>
</Fragment>
productabc.wxs(创建abc.msi的文件)如下:
<?xml version="1.0" encoding="UTF-8"?>
<?include .defines.wxi ?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension" xmlns:fire="http://schemas.microsoft.com/wix/FirewallExtension" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Product Id="$(var.ProductCode)"
Codepage="1252" Language="1033"
Manufacturer="ABC" Name="$(var.ProductName)"
UpgradeCode="{3338CE6B-D733-41AF-830B-DCAFE2E0CD58}"
Version="$(var.ProductVersion)">
<Package Id="*"
Compressed="yes"
InstallerVersion="300"
Languages="1033"
Manufacturer="ABC"
Platform="x86" />
<Media Id="1"
Cabinet="media1.cab"
EmbedCab="yes" />
----some directories and components----
<MajorUpgrade
Schedule="afterInstallInitialize"
DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will now exit."
AllowSameVersionUpgrades="yes"/>
<InstallExecuteSequence>
<LaunchConditions After="AppSearch" />
<Custom Action="SetTargetDir" Before="CostFinalize"></Custom>
<Custom Action="SaveTargetDir" After="InstallValidate"></Custom>
</InstallExecuteSequence>
<WixVariable Id="WixUILicenseRtf" Value="$(var.BaseDir)SetupUILicense.rtf" />
<WixVariable Id="WixUIBannerBmp" Value="$(var.BaseDir)SetupUIbannrbmp.bmp" />
<WixVariable Id="WixUIDialogBmp" Value="$(var.BaseDir)SetupUIABCbackground.bmp" />
</Product>
</Wix>
通用答案:Wix Bootstrapper是为您的" ABC 10.1"发行版中写入条目的内容。为了删除这一点,您的10.2版本将需要一个自定义操作告诉上一个捆绑包以卸载本身("以前的cached-bundle.exe/silent/niter/unstall"或类似的内容)。现在,无论您是告诉旧捆绑包首先卸下自身,还是允许您的MSI首先升级为您自己的要求。