Skip to content

Commit e06f71c

Browse files
authored
Merge pull request #3 from zzy-life/claude/fix-msi-data-inheritance-G1hXa
Refactor installer upgrade logic using MajorUpgrade element
2 parents cbcbd18 + ee2a2ac commit e06f71c

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Product.wxs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,12 @@
2222
<Directory Id="ApplicationProgramsFolder" Name="$(var.Name)" />
2323
</StandardDirectory>
2424
<StandardDirectory Id="DesktopFolder" />
25-
<Property Id="PREVIOUSVERSIONSINSTALLED" Secure="yes" />
26-
<Upgrade Id="$(var.Guid)">
27-
<UpgradeVersion Minimum="0.0.0.0" Maximum="255.0.0.0" Property="PREVIOUSVERSIONSINSTALLED" IncludeMinimum="yes" IncludeMaximum="no" />
28-
</Upgrade>
25+
<MajorUpgrade
26+
DowngradeErrorMessage="不支持降级安装。请先卸载当前版本再安装旧版本。"
27+
Schedule="afterInstallExecute"
28+
AllowSameVersionUpgrades="yes" />
2929
<CustomAction Id="RunMainExe" Directory="INSTALLFOLDER" ExeCommand="[INSTALLFOLDER]$(var.Name).exe" Execute="commit" Return="asyncNoWait" />
3030
<InstallExecuteSequence>
31-
<RemoveExistingProducts Before="InstallInitialize" />
3231
<Custom Action="RunMainExe" Before="InstallFinalize" />
3332
</InstallExecuteSequence>
3433
</Package>

0 commit comments

Comments
 (0)