Skip to content

Commit 359f06c

Browse files
authored
fix(build): reload previous selection of user/machine MSI context MONGOSH-1103 (#1212)
1 parent ff3f17b commit 359f06c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/build/test/fixtures/msi-template/Product.wxs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@
1919
<SetProperty Id="ARPINSTALLLOCATION" Value="[INSTALLFOLDER]" Sequence="execute" Before="InstallInitialize"/>
2020
<SetDirectory Id="INSTALLFOLDER" Sequence="first" Value="[PREV_INSTALLFOLDER_]"><![CDATA[Not INSTALLFOLDER And PREV_INSTALLFOLDER_]]></SetDirectory>
2121

22+
<!-- Restore per user/machine context on upgrade -->
23+
<Property Id="IS_PER_USER_">
24+
<RegistrySearch Type="raw" Root="HKCU" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[WIX_UPGRADE_DETECTED]" Name="InstallLocation" Id="HKCU.upgrade.InstallLocation1"/>
25+
<RegistrySearch Type="raw" Root="HKCU" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductCode]" Name="InstallLocation" Id="HKCU.curr.InstallLocation1"/>
26+
</Property>
27+
<SetProperty Id="MSIINSTALLPERUSER" Value="1" Sequence="first" After="AppSearch"><![CDATA[IS_PER_USER_]]></SetProperty>
28+
<SetProperty Id="MSIINSTALLPERUSER" Action="UnsetMSIINSTALLPERUSER" Value="[nothing]" Sequence="first" After="AppSearch"><![CDATA[Not IS_PER_USER_ And WIX_UPGRADE_DETECTED]]></SetProperty>
29+
2230
<Feature Id="Mongosh" Title="Mongosh" Level="1">
2331
<ComponentGroupRef Id="Files" />
2432
</Feature>

0 commit comments

Comments
 (0)