WIX(删除所有以前的版本) [英] WIX (remove all previous versions)
问题描述
在添加或删除程序"下,我可以看到五个版本:
Under "Add or remove programs" i can see five versions:
- ApplicationName v3.0.4.0
- ApplicationName v3.0.4.18
- ApplicationName v3.0.5.27
- ApplicationName v3.0.5.28
- ApplicationName v3.0.5.29
在尝试安装ApplicationName v3.0.5.30时,不会删除所有以前的版本. 剩下的版本是:
when trying to install ApplicationName v3.0.5.30 all previous versions are NOT deleted. Versions that stays are:
- ApplicationName v3.0.4.0
- ApplicationName v3.0.4.18
我使用的代码是:
<Product Id="*"
UpgradeCode="$(var.UpgradeCode)"
Version="$(var.Version)"
Language="1033"
Name="$(var.ProductDisplayName) (v$(var.Version))"
Manufacturer="Unknown">
<Package InstallerVersion="380" Compressed="yes"/>
<Media Id="1" Cabinet="IileServer.cab" EmbedCab="yes" />
<Property Id="PREVIOUSVERSIONSINSTALLED" Secure="yes" />
<Upgrade Id="$(var.UpgradeCode)">
<UpgradeVersion
Minimum="0.0.0.0" Maximum="99.0.0.0"
Property="PREVIOUSVERSIONSINSTALLED"
IncludeMinimum="yes" IncludeMaximum="no" />
</Upgrade>
<InstallExecuteSequence>
<RemoveExistingProducts Before="InstallInitialize" />
</InstallExecuteSequence>
我做错了什么?
我还尝试构建版本v3.0.6.0,安装后我得到了相同的结果.
I also tryed to build version v3.0.6.0 and after install i got the same result.
Versions v3.0.5.X was removed
Versions v3.0.4.X was not uninstalled
所有版本的UpgradeCode都相同,我在Orca中看过 图像
UpgradeCode is the same for all versions, i looked with Orca image
图像上的最新UpgradeCode适用于版本3.0.6.0
Last UpgradeCode on image is for version 3.0.6.0
推荐答案
忽略数字 :从MSI SDK文档中提取 ProductVersion property
:
" Note that Windows Installer uses only the first three fields of the product version. If you include a fourth field in your product version, the installer ignores the fourth field...At least one of the three fields of ProductVersion must change for an upgrade using the Upgrade table.
"
为了摆脱繁琐的安装,有几种方法.
按产品代码卸载 :如果您要提供内部应用程序,我只会得到产品代码列表并在整个公司范围内进行卸载:如何找到以下产品的GUID:然后可以将您组装的产品代码列表传递到msiexec.exe /x {productcode}
Uninstall By Product Code: I would just get a list of product codes and uninstall corporate-wide if you are delivering an in-house application: How can I find the product GUID of an installed MSI setup? The list of product codes you assemble can then be passed to msiexec.exe /x {productcode}
as explained in section 3 here. Just a simple batch file. Or you can try WMI, or one of the other approaches.
按升级代码卸载 :您可以使用以下代码检查所有安装版本是否共享相同的升级代码: VBScript版本.链接到答案,然后链接到其他几种卸载方式,例如通过直接链接到实际代码(通过升级代码卸载).
Uninstall By Upgrade Code: You can check if all your setup versions share the same upgrade code by using the code from here: How can I find the Upgrade Code for an installed MSI file? (they probably do). There is even a VBScript version here. Throwing in a link to an answer where I link to several other ways to uninstall, such as by uninstalling all setups that share the same upgrade code. And a direct link to actual code to do so (uninstall by upgrade code).
按产品名称卸载 :您也可以按匹配的产品名称进行卸载.一些示例(VBScript):卸载程序(非常简单,需要进行调整以供实际使用).
Uninstall By Product Name: You can uninstall by product name matching as well. Some samples here (VBScript): Is there an alternative to GUID when using msiexec to uninstall an application?. And here is a .NET DTF uninstall function: Uninstalling program (distinctively simplistic, needs tweaking for real-world use).
某些链接:
- Wix MajorUpgrade将无法检测到产品的最后位置版本
- http://blog.deploymentengineering.com/2010/08/wix-users-exceeding-version-limits.html (此处为奇异的解决方法)
- Powershell:通过UpgradeCode卸载应用程序
- 修复主要升级问题(AllowSameVersionUpgrades WiX概念)
- Wix MajorUpgrade will not detect last position of product version
- http://blog.deploymentengineering.com/2010/08/wix-users-exceeding-version-limits.html (here be exotic workaround)
- Powershell: Uninstall application by UpgradeCode
- Wix MajorUpgrade problems (the AllowSameVersionUpgrades WiX concept)
这篇关于WIX(删除所有以前的版本)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!