我设置了 WIX 安装选项,升级以删除以前的 DLL, 但是,当我进入控制面板并转到 添加/删除程序部分,以前的版本仍然存在。
如何从“添加/删除”部分中删除之前的图标?
......
回应下面的评论 抱歉,我仍然无法让它工作,升级时,以前的版本仍然显示在“添加/删除程序”部分中, 这是一些代码
我最初确实将 Id 设置为“*”,但现在我只是在进行下一个构建时更改产品 ID
<Upgrade Id="$(var.UpgradeCode)">
<UpgradeVersion Minimum="$(var.ProductVersion)" OnlyDetect="yes" Property="NEWERVERSIONDETECTED"/>
<UpgradeVersion Minimum="1.0.0"
IncludeMinimum="yes"
OnlyDetect="no"
Maximum="$(var.ProductVersion)"
IncludeMaximum="no"
Property="PREVIOUSVERSIONSINSTALLED" />
</Upgrade>
最佳答案
要升级的版本之间的升级 ID 必须相同。如果您想要执行主要升级,如果您删除以前的安装,然后安装新版本,则必须更改的属性是产品 ID
“*”会导致 WIX 生成新的 GUI
你想要这样的东西:
<!--Product -->
<Product Id="*" Name="$(var.Product.Name)" Language="$(var.Product.Lang)" Version="$(var.Product.Version)" Manufacturer="$(var.Product.Manufacturer)" UpgradeCode="{Replace me with a constant Upgrade Guid}">
<Package InstallerVersion="$(var.Package.InstallerVersion)" Compressed="yes" Platform="$(var.Platform)" />
<!--Condition Messages-->
<Condition Message="A newer version of $(var.Product.Name) is already installed. Exiting installation.">
<![CDATA[Installed OR NOT NEWER_VERSION_FOUND]]>
</Condition>
<!-- Upgrade Table -->
<Upgrade Id="{Replace me with a constant Upgrade Guid}">
<UpgradeVersion
Property="OLD_VERSION_FOUND"
Minimum="0.0.0.0"
Maximum="$(var.Product.Version)"
IncludeMinimum="yes"
IncludeMaximum="no"
OnlyDetect="no"
IgnoreRemoveFailure="yes"
MigrateFeatures="yes"
Language="1033" />
<UpgradeVersion
Property="NEWER_VERSION_FOUND"
Minimum="$(var.Product.Version)"
IncludeMinimum="no"
OnlyDetect="yes"
Language="1033" />
</Upgrade>
<!--Removes the old version and then installs the new version-->
<InstallExecuteSequence>
<RemoveExistingProducts After="InstallInitialize"></RemoveExistingProducts>
<InstallExecute After="RemoveExistingProducts"></InstallExecute>
</InstallExecuteSequence>
您还应该注意,您无法在每个用户和每台计算机安装的版本之间进行切换。
关于WIX 程序仍然存在于控制面板的“添加/删除”部分中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7870827/