对于我的应用程序,我有一个用WiX开发的.msi。对于更新方案,我想执行以下操作:
Update
的按钮Repair
的按钮最佳答案
使用升级属性。
假设
<Product Version="1.0.0.0" />
<Upgrade Id="GUID">
<UpgradeVersion OnlyDetect="no" Property="OLDERFOUND" Maximum="1.0.0.0" IncludeMaximum="no" />
<UpgradeVersion OnlyDetect='yes' Property='NEWERFOUND' Minimum="1.0.0.0" IncludeMinimum='no' />
<UpgradeVersion OnlyDetect='yes' Property='SAMEFOUND' Minimum="1.0.0.0" Maximum='1.0.0.0' />
</Upgrade>
<CustomAction Id='NewerFound' Error='A later version of [ProductName] is already installed' />
<InstallExecuteSequence>
<Custom Action='NewerFound' After='FindRelatedProducts'>NEWERFOUND</Custom>
<RemoveExistingProducts After="InstallInitialize" />
</InstallExecuteSequence>
https://stackoverflow.com/questions/2585579/