提问
如何让wix安装包,能自动卸载上一版本
回答
- 修改产品id
Product Id="{165062EB-0BD5-4EB9-A5AE-6DDE3915C316}" - 修改产品版本
Version="$(var.Version)" - 增加updatecode配置 ,保持不变
Upgrade Id="{28B72714-3A68-4783-BEBF-5F3CBB74FD69}">
示例
<?xml version="1.0" encoding="UTF-8"?>
<?include Configuration.wxi?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Product Id="{165062EB-0BD5-4EB9-A5AE-6DDE3915C316}" Name="!(loc.ProductDisplayName)" Language="!(loc.LanguageId)" Version="$(var.Version)" Manufacturer="!(loc.Manufacturer)" UpgradeCode="{165062EB-0BD5-4EB9-A5AE-6DDE3915C314}">
<Package InstallerVersion="200" Compressed="yes" InstallPrivileges="elevated" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeErrorMessage)" />
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
<Upgrade Id="{28B72714-3A68-4783-BEBF-5F3CBB74FD69}">
<UpgradeVersion OnlyDetect="no" Property="PREVIOUSFOUND" Minimum="1.0.0" IncludeMinimum="yes" Maximum="$(var.Version)" IncludeMaximum="no" />
<UpgradeVersion OnlyDetect="yes" Property="NEWERFOUND" Minimum="$(var.Version)" IncludeMinimum="no" />
</Upgrade>
...
参考
https://blog.csdn.net/zhoujielun123456/article/details/50350062
标签:Version,版本,卸载,安装包,id,wix From: https://www.cnblogs.com/wuhailong/p/17175489.html