msi: detect and set previous installation path via a custom action (#2108)

This commit is contained in:
Andrey Nekrasov
2020-04-21 20:52:28 +03:00
committed by GitHub
parent 0354026292
commit b5dfe6320d
5 changed files with 106 additions and 20 deletions

View File

@@ -39,6 +39,8 @@
<ComponentGroupRef Id="CoreComponents" />
<ComponentGroupRef Id="ResourcesComponents" />
</Feature>
<SetProperty Id="ARPINSTALLLOCATION" Value="[INSTALLFOLDER]" After="CostFinalize" />
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
<UI>
<UIRef Id="WixUI_PTInstallDir"/>
@@ -71,6 +73,9 @@
<RegistrySearch Id="ExistingImageResizerPath" Root="HKCU" Key="Software\Classes\CLSID\{51B4D7E5-7568-4234-B4BB-47FB3C016A69}\InprocServer32" Type="raw"/>
</Property>
<InstallUISequence>
<Custom Action="DetectPrevInstallPath" After="CostFinalize" />
</InstallUISequence>
<InstallExecuteSequence>
<Custom Action="SetRegisterPowerToysSchTaskParam" Before="RegisterPowerToysSchTask" />
<Custom Action="RegisterPowerToysSchTask" After="InstallFiles">
@@ -163,6 +168,13 @@
DllEntry="TelemetryLogRepairFailCA"
/>
<CustomAction Id="DetectPrevInstallPath"
Return="check"
Impersonate="yes"
BinaryKey="PTCustomActions"
DllEntry="DetectPrevInstallPathCA"
/>
<!-- Close 'PowerToys.exe' before uninstall-->
<Property Id="MSIRESTARTMANAGERCONTROL" Value="Disable" />
<!-- Restart explorer.exe if we detect existing PowerRenameExt.dll or ImageResizerExt.dll installation -->
@@ -233,7 +245,7 @@
</Shortcut>
</File>
<RegistryKey Root="HKCR" Key="powertoys" Action="createAndRemoveOnUninstall">
<RegistryKey Root="HKCR" Key="powertoys">
<RegistryValue Type="string" Name="URL Protocol" Value=""/>
<RegistryValue Type="string" Value="URL:PowerToys custom internal URI protocol"/>
<RegistryKey Key="DefaultIcon">