Skip to content

Commit fab08d1

Browse files
committed
Add support for downgrades in the Windows setup
1 parent ef87471 commit fab08d1

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Windows/Setup/NbfcSetup/Product.wxs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@
2121
Description="$(var.ProductName) Installer"/>
2222

2323
<!--Upgrade-->
24-
<MajorUpgrade Schedule="afterInstallInitialize"
25-
AllowDowngrades="no"
26-
AllowSameVersionUpgrades="no"
27-
DowngradeErrorMessage="A newer version of $(var.ProductName) is already installed." />
24+
<!--Use Upgrade instead of MajorUpgrade because the latter doesn't support removing previous versions
25+
before installing upgrades (without checking file versions)-->
26+
<Upgrade Id="$(var.UpgradeGuid)"/>
2827

2928
<!--Media-->
3029
<Media Id="1" Cabinet="NBFC.cab" EmbedCab="yes" CompressionLevel="high"/>
@@ -83,6 +82,10 @@
8382

8483
<!--Do actions-->
8584
<InstallExecuteSequence>
85+
<!--Always uninstall existing products before installing updated versions
86+
to avoid problems during up/downgrade-->
87+
<RemoveExistingProducts Before='InstallInitialize' />
88+
8689
<Custom Action="SetInstallFolderForUninstallDriver" Before="UninstallDriver"/>
8790
<Custom Action="UninstallDriver" After="DeleteServices"/>
8891

0 commit comments

Comments
 (0)