mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-09-11 15:01:02 +03:00
fix(msi): keep only native ProductCode uninstall entry (#15891)
* fix(msi): keep only native ProductCode uninstall entry Move installer state outside the Uninstall registry path, clean up legacy duplicate entries, and use the MSI ProductCode for updates and uninstalling. Signed-off-by: fufesou <linlong1266@gmail.com> * fix(msi): harden update and uninstall handling - handle legacy EXE updates without an MSI ProductCode - propagate MsiExec uninstall failures - validate and XML-quote custom ARP values Signed-off-by: fufesou <linlong1266@gmail.com> * fix(msi): validate registry state before update and uninstall Signed-off-by: fufesou <linlong1266@gmail.com> * fix(msi): pass WindowsInstaller state to elevated sequence Signed-off-by: fufesou <linlong1266@gmail.com> * fix(msi): block unsupported MSI-to-EXE upgrades - resolve native MSI state and ProductCode safely - suppress reboot while preserving MSI uninstall results - publish the resolved ARP install location - skip invalid unrelated MSI uninstall entries Signed-off-by: fufesou <linlong1266@gmail.com> * fix(msi): fail uninstall when ProductCode is missing Prevent known MSI installations from falling back to EXE cleanup when the ProductCode cannot be resolved. Signed-off-by: fufesou <linlong1266@gmail.com> * fix(msi): do not abort update on ARP version write failure Signed-off-by: fufesou <linlong1266@gmail.com> --------- Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
@@ -5,6 +5,23 @@
|
||||
<Fragment>
|
||||
<!-- Regs for shortcuts are defined in "Fragments/ShortcutProperties.wxs" -->
|
||||
<!-- Component that persists the property values to the registry so they are available during an upgrade/modify -->
|
||||
<Property Id="CURRENT_SHARE_RDP" Secure="yes">
|
||||
<RegistrySearch Id="CurrentShareRdpSearch" Root="HKLM" Key="Software\$(var.Product)\InstallState\$(var.Product)" Name="share_rdp" Type="raw" />
|
||||
</Property>
|
||||
<Property Id="LEGACY_SHARE_RDP" Secure="yes">
|
||||
<RegistrySearch Id="LegacyShareRdpSearch" Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\$(var.Product)" Name="share_rdp" Type="raw" Bitness="always64" />
|
||||
</Property>
|
||||
<Property Id="LEGACY_SHARE_RDP32" Secure="yes">
|
||||
<RegistrySearch Id="LegacyShareRdp32Search" Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\$(var.Product)" Name="share_rdp" Type="raw" Bitness="always32" />
|
||||
</Property>
|
||||
<Property Id="APP_WINDOWS_INSTALLER32" Secure="yes">
|
||||
<RegistrySearch Id="AppWindowsInstaller32Search" Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\$(var.Product)" Name="WindowsInstaller" Type="raw" Bitness="always32" />
|
||||
</Property>
|
||||
<Property Id="SHARE_RDP" Secure="yes" />
|
||||
<SetProperty Action="SetShareRdpFromCurrentState" Id="SHARE_RDP" Value="[CURRENT_SHARE_RDP]" After="AppSearch" Sequence="first" Condition="CURRENT_SHARE_RDP" />
|
||||
<SetProperty Action="SetShareRdpFromLegacyState" Id="SHARE_RDP" Value="[LEGACY_SHARE_RDP]" After="SetShareRdpFromCurrentState" Sequence="first" Condition="NOT CURRENT_SHARE_RDP AND LEGACY_SHARE_RDP" />
|
||||
<SetProperty Action="SetShareRdpFromLegacyState32" Id="SHARE_RDP" Value="[LEGACY_SHARE_RDP32]" After="SetShareRdpFromLegacyState" Sequence="first" Condition="NOT CURRENT_SHARE_RDP AND NOT LEGACY_SHARE_RDP AND LEGACY_SHARE_RDP32" />
|
||||
|
||||
<DirectoryRef Id="INSTALLFOLDER_INNER">
|
||||
<Component Id="Product.Registry.InstallFolder" Guid="3196EDA7-9AEF-4705-A0C8-E3F3ECCCB153">
|
||||
<RegistryKey Root="HKCR" Key="$(var.RegKeyRoot)">
|
||||
@@ -40,17 +57,29 @@
|
||||
</RegistryKey>
|
||||
</Component>
|
||||
|
||||
<!--For compatibility with registry values from previous versions-->
|
||||
<Component Id="Product.Registry.UninstallApp" Guid="FC1A3D2E-5642-FBD8-CFA6-5ECAC6DE69A8">
|
||||
<RegistryKey Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\$(var.Product)" >
|
||||
<Component Id="Product.Registry.InstallState" Guid="E310003A-C292-4851-AE20-7A9B186060CE">
|
||||
<RegistryKey Root="HKLM" Key="Software\$(var.Product)\InstallState\$(var.Product)" ForceDeleteOnUninstall="yes">
|
||||
<RegistryValue Type="string" Name="BuildDate" Value="$(var.BuildDate)" />
|
||||
<RegistryValue Type="string" Name="share_rdp" Value="" />
|
||||
|
||||
<!--$ArpStart$-->
|
||||
<!--$ArpEnd$-->
|
||||
<RegistryValue Type="string" Name="share_rdp" Value="[SHARE_RDP]" />
|
||||
<RegistryValue Type="string" Name="InstallLocation" Value="[INSTALLFOLDER_INNER]" />
|
||||
<RegistryValue Type="integer" Name="WindowsInstaller" Value="1" />
|
||||
<RegistryValue Type="string" Name="MsiProductCode" Value="[ProductCode]" KeyPath="yes" />
|
||||
<!--$InstallStateStart$-->
|
||||
<!--$InstallStateEnd$-->
|
||||
</RegistryKey>
|
||||
</Component>
|
||||
|
||||
</DirectoryRef>
|
||||
|
||||
<StandardDirectory Id="CommonAppDataFolder">
|
||||
<Component Id="Product.Registry.RemoveLegacyUninstall64" Guid="7524B741-94C2-4C50-A151-DDB37860DC20" Bitness="always64" KeyPath="yes" Condition="APP_WINDOWS_INSTALLER="#1"">
|
||||
<RemoveRegistryKey Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\$(var.Product)" Action="removeOnInstall" />
|
||||
</Component>
|
||||
|
||||
<Component Id="Product.Registry.RemoveLegacyUninstall32" Guid="CB50B9AA-B83A-4AC2-BB27-81358F0E74E6" Bitness="always32" KeyPath="yes" Condition="APP_WINDOWS_INSTALLER32="#1"">
|
||||
<RemoveRegistryKey Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\$(var.Product)" Action="removeOnInstall" />
|
||||
</Component>
|
||||
</StandardDirectory>
|
||||
|
||||
</Fragment>
|
||||
</Wix>
|
||||
|
||||
@@ -27,10 +27,12 @@
|
||||
<!--$ArpStart$-->
|
||||
<!--$ArpEnd$-->
|
||||
|
||||
<SetProperty Action="SetArpInstallLocation" Id="ARPINSTALLLOCATION" Value="[INSTALLFOLDER_INNER]" After="CostFinalize" Sequence="execute" />
|
||||
|
||||
<!--$CustomClientPropsStart$-->
|
||||
<!--$CustomClientPropsEnd$-->
|
||||
|
||||
<Property Id="APP_WINDOWS_INSTALLER">
|
||||
<Property Id="APP_WINDOWS_INSTALLER" Secure="yes">
|
||||
<RegistrySearch Id="AppWindowsInstallerFolderSearch" Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\$(var.Product)" Name="WindowsInstaller" Type="raw" />
|
||||
</Property>
|
||||
</Fragment>
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
<Media Id="1" Cabinet="cab1.cab" EmbedCab="yes" CompressionLevel="high" />
|
||||
<Icon Id="AppIcon" SourceFile="Resources\icon.ico" />
|
||||
<CustomAction Id="BlockSelfInstalledApp" Error="!(loc.AnotherAppDialogDescription)" />
|
||||
|
||||
<!-- User Interface -->
|
||||
<WixVariable Id="WixUILicenseRtf" Value="License.rtf" />
|
||||
@@ -22,10 +23,11 @@
|
||||
<UIRef Id="WixUI_ErrorProgressText" />
|
||||
|
||||
<InstallUISequence>
|
||||
<Show Dialog="UI_AnotherAppDialog" Before="WelcomeDlg" Condition="Not installed AND APP_WINDOWS_INSTALLER="#0""/>
|
||||
<Show Dialog="UI_AnotherAppDialog" Before="WelcomeDlg" Condition="NOT Installed AND (APP_WINDOWS_INSTALLER="#0" OR APP_WINDOWS_INSTALLER32="#0")"/>
|
||||
</InstallUISequence>
|
||||
|
||||
<InstallExecuteSequence>
|
||||
<Custom Action="BlockSelfInstalledApp" After="AppSearch" Condition="NOT Installed AND (APP_WINDOWS_INSTALLER="#0" OR APP_WINDOWS_INSTALLER32="#0")" />
|
||||
<InstallExecute After="RemoveExistingProducts" />
|
||||
|
||||
<!--Only do InstallValidate if is not Uninstall-->
|
||||
@@ -45,7 +47,9 @@
|
||||
<ComponentRef Id="Product.Registry.CommandPlay" />
|
||||
<ComponentRef Id="Product.Registry.URLProtocol" />
|
||||
<ComponentRef Id="Product.Registry.Command" />
|
||||
<ComponentRef Id="Product.Registry.UninstallApp" />
|
||||
<ComponentRef Id="Product.Registry.InstallState" />
|
||||
<ComponentRef Id="Product.Registry.RemoveLegacyUninstall64" />
|
||||
<ComponentRef Id="Product.Registry.RemoveLegacyUninstall32" />
|
||||
<ComponentRef Id="App.StartMenu" />
|
||||
<ComponentRef Id="Product.Registry.PersistedStartMenuShortcutProperties1" />
|
||||
<ComponentRef Id="Product.Registry.PersistedStartMenuShortcutProperties0" />
|
||||
|
||||
Reference in New Issue
Block a user