Nextcloud.wxs 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!--
  3. *
  4. * Copyright (C) by Michael Schuster <michael@schuster.ms>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  13. * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  14. * for more details.
  15. *
  16. -->
  17. <?include $(sys.CURRENTDIR)OEM.wxi?>
  18. <?include $(sys.CURRENTDIR)Platform.wxi?>
  19. <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
  20. <!--
  21. When to change the Product GUID:
  22. https://www.firegiant.com/wix/tutorial/upgrades-and-modularization/
  23. https://www.firegiant.com/wix/tutorial/upgrades-and-modularization/checking-for-oldies/
  24. We change the Product Id for every release, to let up-/downgrading always work.
  25. But we then should never change the UpgradeCode.
  26. -->
  27. <Product Name="$(var.AppName)" Manufacturer="$(var.AppVendor)"
  28. Id="*"
  29. UpgradeCode="$(var.UpgradeCode)"
  30. Language="1033" Codepage="$(var.codepage)" Version="$(var.VerFull)">
  31. <Package Id="*" Keywords="Installer" Description="$(var.AppName) $(var.VerDesc)" Manufacturer="$(var.AppVendor)"
  32. InstallerVersion="300" Platform="$(var.Platform)" Languages="1033" Compressed="yes" SummaryCodepage="$(var.codepage)" InstallScope="perMachine" />
  33. <!--
  34. Upgrading: Since we always want to allow up-/downgrade, we don't specify a maximum version, thus
  35. leading the WiX linker (light.exe) to trigger the following warning:
  36. warning LGHT1076 : ICE61: This product should remove only older versions of itself. No Maximum version was detected for the current product. (WIX_UPGRADE_DETECTED)
  37. We suppress the warning: light.exe -sw1076
  38. If at some point we want to change this behaviour, read the docs:
  39. https://www.firegiant.com/wix/tutorial/upgrades-and-modularization/replacing-ourselves/
  40. https://www.joyofsetup.com/2010/01/16/major-upgrades-now-easier-than-ever/
  41. -->
  42. <MajorUpgrade Schedule="afterInstallInitialize" AllowDowngrades="yes" />
  43. <Media Id="1" Cabinet="$(var.AppShortName).cab" EmbedCab="yes" />
  44. <!-- If already installed: Use previously chosen path (use 32-bit registry like NSIS does) -->
  45. <Property Id="INSTALLDIR">
  46. <RegistrySearch Id="RegistryInstallDir" Type="raw" Root="HKLM" Key="Software\$(var.AppVendor)\$(var.AppName)" Win64="no" />
  47. </Property>
  48. <!-- Detect legacy NSIS installation -->
  49. <Property Id="NSIS_UNINSTALLEXE">
  50. <RegistrySearch Id="RegistryLegacyUninstallString" Type="file" Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\$(var.AppName)" Name="UninstallString" Win64="no">
  51. <FileSearch Id="LegacyUninstallFileName" Name="Uninstall.exe"/>
  52. </RegistrySearch>
  53. </Property>
  54. <!-- Property to disable update checks -->
  55. <Property Id="SKIPAUTOUPDATE" Value="0" />
  56. <!-- Quit / restart application -->
  57. <util:RestartResource ProcessName="$(var.AppExe)" />
  58. <!-- Helper DLL Custom Actions -->
  59. <SetProperty Id="ExecNsisUninstaller" Value="&quot;$(var.AppShortName)&quot; &quot;[NSIS_UNINSTALLEXE]&quot;" Before="ExecNsisUninstaller" Sequence="execute" />
  60. <SetProperty Id="RemoveNavigationPaneEntries" Value="&quot;$(var.AppName)&quot;" Before="RemoveNavigationPaneEntries" Sequence="execute" />
  61. <InstallExecuteSequence>
  62. <!-- Install: Remove previous NSIS installation, if detected -->
  63. <Custom Action="ExecNsisUninstaller" Before="ProcessComponents">NSIS_UNINSTALLEXE AND NOT Installed</Custom>
  64. <!-- Uninstall: Remove sync folders from Explorer's Navigation Pane, only effective for the current user (home users) -->
  65. <Custom Action="RemoveNavigationPaneEntries" After="RemoveFiles">(NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL")</Custom>
  66. <!-- Uninstall: Cleanup the Registry -->
  67. <Custom Action="RegistryCleanupCustomAction" After="RemoveFiles">(NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL")</Custom>
  68. <!-- Schedule Reboot for the Shell Extensions (in silent installation mode only, or if SCHEDULE_REBOOT argument is set-->
  69. <ScheduleReboot After="InstallFinalize">(SCHEDULE_REBOOT=1) OR NOT (UILevel=2)</ScheduleReboot>
  70. </InstallExecuteSequence>
  71. <!-- "Add or Remove" Programs Entries -->
  72. <Property Id="APPNAME">$(var.AppName)</Property>
  73. <Property Id="ARPPRODUCTICON">$(var.AppIcon)</Property>
  74. <Property Id="ARPHELPLINK">$(var.AppHelpLink)</Property>
  75. <Property Id="ARPURLINFOABOUT">$(var.AppInfoLink)</Property>
  76. <!-- https://www.firegiant.com/wix/tutorial/com-expression-syntax-miscellanea/add-or-remove-programs-entries/ -->
  77. <!--
  78. <Property Id="ARPNOMODIFY">1</Property>
  79. <Property Id="ARPNOREPAIR">1</Property>
  80. -->
  81. <!-- App icon -->
  82. <Icon Id="$(var.AppIcon)" SourceFile="$(var.HarvestAppDir)\$(var.AppIcon)" />
  83. <!-- Custom bitmaps -->
  84. <WixVariable Id="WixUIBannerBmp" Value="$(var.UIBannerBmp)" />
  85. <WixVariable Id="WixUIDialogBmp" Value="$(var.UIDialogBmp)" />
  86. <!-- Custom icons -->
  87. <!-- https://wixtoolset.org/documentation/manual/v3/wixui/wixui_customizations.html -->
  88. <!--
  89. <WixVariable Id="WixUIExclamationIco" Value="ui\Exclam.ico" />
  90. <WixVariable Id="WixUIInfoIco" Value="ui\Info.ico" />
  91. <WixVariable Id="WixUINewIco" Value="ui\New.ico" />
  92. <WixVariable Id="WixUIUpIco" Value="ui\Up.ico" />
  93. -->
  94. <!-- Custom license -->
  95. <!--
  96. <WixVariable Id="WixUILicenseRtf" Value="$(var.AppLicenseRtf)" />
  97. -->
  98. <UI>
  99. <UIRef Id="WixUI_FeatureTree" />
  100. <UIRef Id="WixUI_ErrorProgressText" />
  101. <!-- Skip the license page -->
  102. <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="CustomizeDlg" Order="3">1</Publish>
  103. <!-- Skip the page on the way back too -->
  104. <Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="3">1</Publish>
  105. <!-- https://wixtoolset.org/documentation/manual/v3/howtos/ui_and_localization/run_program_after_install.html -->
  106. <Publish Dialog="ExitDialog"
  107. Control="Finish"
  108. Event="DoAction"
  109. Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
  110. <ProgressText Action="ExecNsisUninstaller">Removing previous installation</ProgressText>
  111. <ProgressText Action="KillProcess">Trying to terminate application process of previous installation</ProgressText>
  112. <ProgressText Action="RemoveNavigationPaneEntries">Removing sync folders from Explorer's Navigation Pane</ProgressText>
  113. </UI>
  114. <!-- "Launch" checkbox -->
  115. <Property Id="WixShellExecTarget" Value="[#MainExecutable]" />
  116. <CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
  117. <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch $(var.AppName)" />
  118. <SetProperty Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1" Before="CostInitialize">NOT (LAUNCH=0)</SetProperty>
  119. <!-- Components -->
  120. <Directory Id="TARGETDIR" Name="SourceDir">
  121. <Directory Id="$(var.PlatformProgramFilesFolder)" Name="PFiles">
  122. <Directory Id="INSTALLDIR" Name="$(var.AppName)">
  123. <!-- Shell Extensions -->
  124. <Directory Id="ShellExtDir" />
  125. </Directory>
  126. </Directory>
  127. <Directory Id="ProgramMenuFolder" Name="Programs">
  128. <!-- Start Menu Shortcut -->
  129. <Component Id="StartMenuIcon" Guid="*" Win64="$(var.PlatformWin64)">
  130. <Shortcut Id="StartMenu" Name="$(var.AppName)" Target="[INSTALLDIR]$(var.AppExe)" WorkingDirectory="INSTALLDIR" Icon="$(var.AppIcon)" IconIndex="0" Advertise="no" />
  131. <RegistryValue Root="HKCU" Key="Software\$(var.AppVendor)\$(var.AppName)" Name="installedStartMenuShortcut" Type="integer" Value="1" KeyPath="yes"/>
  132. </Component>
  133. </Directory>
  134. <Directory Id="DesktopFolder" Name="Desktop">
  135. <!-- Desktop Shortcut -->
  136. <Component Id="DesktopIcon" Guid="*" Win64="$(var.PlatformWin64)">
  137. <Shortcut Id="Desktop" Name="$(var.AppName)" Target="[INSTALLDIR]$(var.AppExe)" WorkingDirectory="INSTALLDIR" Icon="$(var.AppIcon)" IconIndex="0" Advertise="no" />
  138. <RegistryValue Root="HKCU" Key="Software\$(var.AppVendor)\$(var.AppName)" Name="installedDesktopShortcut" Type="integer" Value="1" KeyPath="yes"/>
  139. </Component>
  140. </Directory>
  141. </Directory>
  142. <DirectoryRef Id="TARGETDIR">
  143. <!-- Version numbers used to detect existing installation (use 32-bit registry like NSIS does) -->
  144. <Component Id="RegistryVersionInfo" Guid="*" Win64="no">
  145. <RegistryKey Root="HKLM" Key="Software\$(var.AppVendor)\$(var.AppName)" ForceCreateOnInstall="yes" ForceDeleteOnUninstall="yes">
  146. <RegistryValue Type="string" Value="[INSTALLDIR]" />
  147. <RegistryValue Type="integer" Name="VersionMajor" Value="$(var.VerMajor)" />
  148. <RegistryValue Type="integer" Name="VersionMinor" Value="$(var.VerMinor)" />
  149. <RegistryValue Type="integer" Name="VersionRevision" Value="$(var.VerRevision)" />
  150. <RegistryValue Type="integer" Name="VersionBuild" Value="$(var.VerBuild)" />
  151. <!-- Save MSI ProductCode to allow being uninstalled by custom tools -->
  152. <RegistryValue Type="string" Name="InstallerProductCode" Value="[ProductCode]" />
  153. </RegistryKey>
  154. </Component>
  155. <!-- Platform bitness-dependent settings -->
  156. <Component Id="RegistryDefaultSettings" Guid="*" Win64="$(var.PlatformWin64)">
  157. <RegistryKey Root="HKLM" Key="Software\$(var.AppVendor)\$(var.AppName)">
  158. <!-- Property to disable update checks -->
  159. <RegistryValue Type="integer" Name="skipUpdateCheck" Value="[SKIPAUTOUPDATE]" />
  160. </RegistryKey>
  161. </Component>
  162. <!-- Register URI handler -->
  163. <Component Id="RegistryUriHandler" Guid="*" Win64="$(var.PlatformWin64)">
  164. <RegistryKey Root="HKCU" Key="Software\Classes\$(var.AppCommandOpenUrlScheme)" ForceCreateOnInstall="yes" ForceDeleteOnUninstall="yes">
  165. <RegistryValue Type="string" Value="URL:$(var.AppName) Protocol" />
  166. <RegistryValue Type="string" Name="URL Protocol" Value="" />
  167. </RegistryKey>
  168. <RegistryKey Root="HKCU" Key="Software\Classes\$(var.AppCommandOpenUrlScheme)\DefaultIcon" ForceCreateOnInstall="yes" ForceDeleteOnUninstall="yes">
  169. <RegistryValue Type="string" Value="[INSTALLDIR]$(var.AppExe)" />
  170. </RegistryKey>
  171. <RegistryKey Root="HKCU" Key="Software\Classes\$(var.AppCommandOpenUrlScheme)\shell\open\command" ForceCreateOnInstall="yes" ForceDeleteOnUninstall="yes">
  172. <RegistryValue Type="string" Value="&quot;[INSTALLDIR]$(var.AppExe)&quot; &quot;%1&quot;" />
  173. </RegistryKey>
  174. </Component>
  175. </DirectoryRef>
  176. <!-- Features -->
  177. <Feature Id="Client" Title="$(var.AppName) $(var.PlatformBitness)" Display="collapse" Absent="disallow" ConfigurableDirectory="INSTALLDIR"
  178. Description="$(var.AppName) $(var.VerDesc)">
  179. <ComponentGroupRef Id="ClientFiles" />
  180. <ComponentRef Id="RegistryVersionInfo" />
  181. <ComponentRef Id="RegistryDefaultSettings" />
  182. <ComponentRef Id="RegistryUriHandler" />
  183. <Feature Id="ShellExtensions" Title="Integration for Windows Explorer"
  184. Description="This feature requires a reboot." >
  185. <ComponentGroupRef Id="ShellExtensions" />
  186. <Condition Level="0">(NO_SHELL_EXTENSIONS=1)</Condition>
  187. </Feature>
  188. <Feature Id="StartMenuShortcuts" Title="Start Menu Shortcut">
  189. <ComponentRef Id="StartMenuIcon" />
  190. <Condition Level="0">(NO_START_MENU_SHORTCUTS=1)</Condition>
  191. </Feature>
  192. <Feature Id="DesktopShortcut" Title="Desktop Shortcut">
  193. <ComponentRef Id="DesktopIcon" />
  194. <Condition Level="0">(NO_DESKTOP_SHORTCUT=1)</Condition>
  195. </Feature>
  196. </Feature>
  197. </Product>
  198. </Wix>