RustDesk.wxs 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
  2. xmlns:fire="http://wixtoolset.org/schemas/v4/wxs/firewall">
  3. <Fragment>
  4. <?include ../Includes.wxi?>
  5. <DirectoryRef Id="INSTALLFOLDER_INNER" FileSource="$(var.BuildDir)">
  6. <Component Id="App.exe" Guid="620F0F69-4C17-4320-A619-495E329712A4">
  7. <File Id="App.exe" Name="$(var.Product).exe" KeyPath="yes" Checksum="yes">
  8. <!--<fire:FirewallException Id="AppEx" Name="$(var.Product) Service" Scope="any" IgnoreFailure="yes" />-->
  9. </File>
  10. </Component>
  11. </DirectoryRef>
  12. <CustomAction Id="RemoveInstallFolder.SetParam" Return="check" Property="RemoveInstallFolder" Value="[INSTALLFOLDER_INNER]" />
  13. <CustomAction Id="AddFirewallRules.SetParam" Return="check" Property="AddFirewallRules" Value="1[INSTALLFOLDER_INNER]$(var.Product).exe" />
  14. <CustomAction Id="RemoveFirewallRules.SetParam" Return="check" Property="RemoveFirewallRules" Value="0[INSTALLFOLDER_INNER]$(var.Product).exe" />
  15. <CustomAction Id="CreateStartService.SetParam" Return="check" Property="CreateStartService" Value="$(var.Product);&quot;[INSTALLFOLDER_INNER]$(var.Product).exe&quot; --service" />
  16. <CustomAction Id="TryStopDeleteService.SetParam" Return="check" Property="TryStopDeleteService" Value="$(var.Product)" />
  17. <CustomAction Id="LaunchApp" ExeCommand="" Return="asyncNoWait" FileRef="App.exe" />
  18. <CustomAction Id="LaunchAppTray" ExeCommand=" --tray" Return="asyncNoWait" FileRef="App.exe" />
  19. <Property Id="TerminateProcesses" Value="AppTest.exe" />
  20. <CustomAction Id="TerminateProcesses.SetParam" Return="check" Property="TerminateProcesses" Value="$(var.Product).exe" />
  21. <CustomAction Id="TerminateBrokers.SetParam" Return="check" Property="TerminateProcesses" Value="RuntimeBroker_rustdesk.exe" />
  22. <CustomAction Id="SetPropertyIsServiceRunning.SetParam.AppName" Return="check" Property="AppName" Value="$(var.Product)" />
  23. <CustomAction Id="SetPropertyIsServiceRunning.SetParam.PropertyName" Return="check" Property="PropertyName" Value="STOP_SERVICE" />
  24. <CustomAction Id="SetPropertyServiceStop.SetParam.ConfigFile" Return="check" Property="ConfigFile" Value="[AppDataFolder]$(var.Product)\config\$(var.Product)2.toml" />
  25. <CustomAction Id="SetPropertyServiceStop.SetParam.ConfigKey" Return="check" Property="ConfigKey" Value="stop-service" />
  26. <CustomAction Id="SetPropertyServiceStop.SetParam.PropertyName" Return="check" Property="PropertyName" Value="STOP_SERVICE" />
  27. <CustomAction Id="TryDeleteStartupShortcut.SetParam" Return="check" Property="ShortcutName" Value="$(var.Product) Tray" />
  28. <CustomAction Id="RemoveAmyuniIdd.SetParam" Return="check" Property="RemoveAmyuniIdd" Value="[INSTALLFOLDER_INNER]" />
  29. <InstallExecuteSequence>
  30. <Custom Action="SetPropertyIsServiceRunning" After="InstallInitialize" Condition="Installed" />
  31. <Custom Action="SetPropertyIsServiceRunning.SetParam.AppName" Before="SetPropertyIsServiceRunning" Condition="Installed" />
  32. <Custom Action="SetPropertyIsServiceRunning.SetParam.PropertyName" Before="SetPropertyIsServiceRunning" Condition="Installed" />
  33. <Custom Action="SetPropertyServiceStop" After="InstallInitialize" Condition="NOT Installed" />
  34. <Custom Action="SetPropertyServiceStop.SetParam.ConfigFile" Before="SetPropertyServiceStop" Condition="NOT Installed" />
  35. <Custom Action="SetPropertyServiceStop.SetParam.ConfigKey" Before="SetPropertyServiceStop" Condition="NOT Installed" />
  36. <Custom Action="SetPropertyServiceStop.SetParam.PropertyName" Before="SetPropertyServiceStop" Condition="NOT Installed" />
  37. <!-- Do not call CreateStartService if is uninstalling. -->
  38. <!-- (Installed AND REMOVE AND NOT UPGRADINGPRODUCTCODE) means uninstalling. -->
  39. <Custom Action="CreateStartService" Before="InstallFinalize" Condition="(NOT (Installed AND REMOVE AND NOT UPGRADINGPRODUCTCODE)) AND (NOT STOP_SERVICE=&quot;&apos;Y&apos;&quot;) AND (NOT CC_CONNECTION_TYPE=&quot;outgoing&quot;)" />
  40. <Custom Action="CreateStartService.SetParam" Before="CreateStartService" Condition="(NOT (Installed AND REMOVE AND NOT UPGRADINGPRODUCTCODE)) AND (NOT STOP_SERVICE=&quot;&apos;Y&apos;&quot;) AND (NOT CC_CONNECTION_TYPE=&quot;outgoing&quot;)" />
  41. <Custom Action="CustomActionHello" Before="InstallFinalize" />
  42. <!--Shortcut is in InstallValidate section. So we just let it be created, then try delete if stopping service.-->
  43. <Custom Action="TryDeleteStartupShortcut" After="InstallFinalize" Condition="STOP_SERVICE=&quot;&apos;Y&apos;&quot;" />
  44. <Custom Action="TryDeleteStartupShortcut.SetParam" Before="SetPropertyIsServiceRunning" Condition="STOP_SERVICE=&quot;&apos;Y&apos;&quot;" />
  45. <!-- Launch ClientLauncher if installing or already installed and not uninstalling -->
  46. <Custom Action="LaunchApp" After="InstallFinalize" Condition="NOT (Installed AND REMOVE AND NOT UPGRADINGPRODUCTCODE)"/>
  47. <Custom Action="LaunchAppTray" After="InstallFinalize" Condition="(NOT (Installed AND REMOVE AND NOT UPGRADINGPRODUCTCODE)) AND (NOT STOP_SERVICE=&quot;&apos;Y&apos;&quot;) AND (NOT CC_CONNECTION_TYPE=&quot;outgoing&quot;)"/>
  48. <!--Workaround of "fire:FirewallException". If Outbound="Yes" or Outbound="true", the following error occurs.-->
  49. <!--ExecFirewallExceptions: Error 0x80070057: failed to add app to the authorized apps list-->
  50. <Custom Action="AddFirewallRules" Before="InstallFinalize" Condition="NOT (Installed AND REMOVE AND NOT UPGRADINGPRODUCTCODE)"/>
  51. <Custom Action="AddFirewallRules.SetParam" Before="AddFirewallRules" Condition="NOT (Installed AND REMOVE AND NOT UPGRADINGPRODUCTCODE)"/>
  52. <Custom Action="AddRegSoftwareSASGeneration" Before="InstallFinalize" Condition="NOT (Installed AND REMOVE AND NOT UPGRADINGPRODUCTCODE) AND (NOT CC_CONNECTION_TYPE=&quot;outgoing&quot;)"/>
  53. <Custom Action="RemoveInstallFolder" Before="RemoveFiles"/>
  54. <Custom Action="RemoveInstallFolder.SetParam" Before="RemoveInstallFolder"/>
  55. <Custom Action="TryStopDeleteService" Before="RemoveInstallFolder.SetParam" />
  56. <Custom Action="TryStopDeleteService.SetParam" Before="TryStopDeleteService" />
  57. <Custom Action="RemoveFirewallRules" Before="RemoveFiles"/>
  58. <Custom Action="RemoveFirewallRules.SetParam" Before="RemoveFirewallRules"/>
  59. <Custom Action="TerminateProcesses" Before="RemoveInstallFolder"/>
  60. <Custom Action="TerminateProcesses.SetParam" Before="TerminateProcesses"/>
  61. <Custom Action="TerminateBrokers" Before="RemoveInstallFolder"/>
  62. <Custom Action="TerminateBrokers.SetParam" Before="TerminateBrokers"/>
  63. <Custom Action="RemoveAmyuniIdd" Before="RemoveInstallFolder"/>
  64. <Custom Action="RemoveAmyuniIdd.SetParam" Before="RemoveAmyuniIdd"/>
  65. </InstallExecuteSequence>
  66. <!-- Shortcuts -->
  67. <DirectoryRef Id="App.StartMenu">
  68. <Component Id="App.StartMenu" Guid="30F6D57A-B805-4DA4-A071-05A3B22400CA">
  69. <RegistryValue Root="HKCU" Key="Software\$(var.Product)" Name="App.StartMenu" Type="string" Value="1" KeyPath="yes" />
  70. <RemoveFolder Id="Remove.App.StartMenu" On="uninstall" />
  71. </Component>
  72. </DirectoryRef>
  73. <DirectoryRef Id="App.StartMenu">
  74. <Component Id="App.StartMenu.Shortcut" Guid="43ABCAC7-E47D-42D8-A408-25EC70DBB993" Condition="STARTMENUSHORTCUTS = 1 OR STARTMENUSHORTCUTS = &quot;Y&quot; OR STARTMENUSHORTCUTS = &quot;y&quot;">
  75. <Shortcut Id="App.StartMenu.Shortcut" Name="!(loc.SC_Client)" Description="!(loc.SC_Client_Desc)" Target="[!App.exe]" Icon="AppIcon" WorkingDirectory="INSTALLFOLDER_INNER" />
  76. <!--
  77. Fix ICE 38 by adding a dummy registry key that is the key for this shortcut.
  78. https://learn.microsoft.com/en-us/windows/win32/msi/ice38
  79. -->
  80. <RegistryValue Root="HKCU" Key="Software\$(var.Product)" Name="App.StartMenu.Shortcut" Type="string" Value="1" KeyPath="yes" />
  81. </Component>
  82. <Component Id="App.StartMenu.ShortcutUninstall" Guid="E100D7F8-D607-4513-28DA-2C95E5EA698E" Condition="STARTMENUSHORTCUTS = 1 OR STARTMENUSHORTCUTS = &quot;Y&quot; OR STARTMENUSHORTCUTS = &quot;y&quot;">
  83. <Shortcut Id="App.StartMenu.ShortcutUninstall" Name="!(loc.SC_Uninstall)" Description="!(loc.SC_Uninstall_Desc)" Target="[System6432Folder]msiexec.exe" Arguments="/x [ProductCode]" Icon="AppIcon" />
  84. <RegistryValue Root="HKCU" Key="Software\$(var.Product)" Name="App.StartMenu.ShortcutUninstall" Type="string" Value="1" KeyPath="yes" />
  85. </Component>
  86. </DirectoryRef>
  87. <StandardDirectory Id="DesktopFolder">
  88. <Component Id="App.Desktop.Shortcut" Guid="CA8FB7AA-17F7-4E36-A58A-5A016A303709" Condition="DESKTOPSHORTCUTS = 1 OR DESKTOPSHORTCUTS = &quot;Y&quot; OR DESKTOPSHORTCUTS = &quot;y&quot;">
  89. <Shortcut Id="App.Desktop.Shortcut" Name="!(loc.SC_Client)" Description="!(loc.SC_Client_Desc)" Target="[!App.exe]" Icon="AppIcon" WorkingDirectory="INSTALLFOLDER_INNER" />
  90. <RegistryValue Root="HKCU" Key="Software\$(var.Product)" Name="App.Desktop.Shortcut" Type="string" Value="1" KeyPath="yes" />
  91. </Component>
  92. </StandardDirectory>
  93. <StandardDirectory Id="StartupFolder">
  94. <Component Id="App.StartupFolder.ShortcutTray" Guid="B1D1E2BB-E53E-E159-DB7C-744D5C726A8C" Condition="STARTUPSHORTCUTS = 1 AND (NOT CC_CONNECTION_TYPE=&quot;outgoing&quot;)">
  95. <Shortcut Id="App.StartupFolder.ShortcutTray" Name="!(loc.SC_Client_Tray)" Description="!(loc.SC_Client_Tray_Desc)" Target="[!App.exe]" Arguments="--tray" Icon="AppIcon" WorkingDirectory="INSTALLFOLDER_INNER" />
  96. <RegistryValue Root="HKCU" Key="Software\$(var.Product)" Name="App.StartupFolder.ShortcutTray" Type="string" Value="1" KeyPath="yes" />
  97. </Component>
  98. </StandardDirectory>
  99. <!--<DirectoryRef Id="INSTALLFOLDER_INNER">
  100. <Component Id="App.UninstallShortcut" Guid="FB0F2AC7-2AE5-4C54-B860-5E472620B6B1">
  101. <Shortcut Id="App.UninstallShortcut" Name="!(loc.SC_Uninstall)" Description="!(loc.SC_Uninstall_Desc)" Target="[System6432Folder]msiexec.exe" Arguments="/x [ProductCode]" Icon="AppIcon" />
  102. </Component>
  103. </DirectoryRef>-->
  104. <ComponentGroup Id="Components" Directory="INSTALLFOLDER_INNER">
  105. <ComponentRef Id="App.exe" />
  106. <ComponentRef Id="App.Desktop.Shortcut" />
  107. <!--<ComponentRef Id="App.UninstallShortcut" />-->
  108. <ComponentRef Id="App.StartMenu.Shortcut" />
  109. <ComponentRef Id="App.StartMenu.ShortcutUninstall" />
  110. <ComponentRef Id="App.StartupFolder.ShortcutTray" />
  111. <!--$AutoComonentStart$-->
  112. <!--$AutoComponentEnd$-->
  113. </ComponentGroup>
  114. </Fragment>
  115. </Wix>