main.wxs 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
  3. xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
  4. <?ifdef JpIsSystemWide ?>
  5. <?define JpInstallScope="perMachine"?>
  6. <?else?>
  7. <?define JpInstallScope="perUser"?>
  8. <?endif?>
  9. <?define JpProductLanguage=1033 ?>
  10. <?define JpInstallerVersion=200 ?>
  11. <?define JpCompressedMsi=yes ?>
  12. <?ifdef JpAllowUpgrades ?>
  13. <?define JpUpgradeVersionOnlyDetectUpgrade="no"?>
  14. <?else?>
  15. <?define JpUpgradeVersionOnlyDetectUpgrade="yes"?>
  16. <?endif?>
  17. <?ifdef JpAllowDowngrades ?>
  18. <?define JpUpgradeVersionOnlyDetectDowngrade="no"?>
  19. <?else?>
  20. <?define JpUpgradeVersionOnlyDetectDowngrade="yes"?>
  21. <?endif?>
  22. <!-- Cryptomator defaults -->
  23. <?define IconFileEncryptedData= "Cryptomator-Vault.ico" ?>
  24. <?define ProgIdContentType= "application/vnd.cryptomator.encrypted" ?>
  25. <?define CloseApplicationTarget= "cryptomator.exe" ?>
  26. <?include $(var.JpConfigDir)/overrides.wxi ?>
  27. <Product
  28. Id="$(var.JpProductCode)"
  29. Name="$(var.JpAppName)"
  30. Language="$(var.JpProductLanguage)"
  31. Version="$(var.JpAppVersion)"
  32. Manufacturer="$(var.JpAppVendor)"
  33. UpgradeCode="$(var.JpProductUpgradeCode)">
  34. <Package
  35. Description="$(var.JpAppDescription)"
  36. Manufacturer="$(var.JpAppVendor)"
  37. InstallerVersion="$(var.JpInstallerVersion)"
  38. Compressed="$(var.JpCompressedMsi)"
  39. InstallScope="$(var.JpInstallScope)" Platform="x64"
  40. />
  41. <Media Id="1" Cabinet="Data.cab" EmbedCab="yes" />
  42. <Upgrade Id="$(var.JpProductUpgradeCode)">
  43. <UpgradeVersion
  44. OnlyDetect="$(var.JpUpgradeVersionOnlyDetectUpgrade)"
  45. Property="JP_UPGRADABLE_FOUND"
  46. Maximum="$(var.JpAppVersion)"
  47. MigrateFeatures="yes"
  48. IncludeMaximum="yes" /> <!-- TODO: check if this needs to be set to yes-->
  49. <UpgradeVersion
  50. OnlyDetect="$(var.JpUpgradeVersionOnlyDetectDowngrade)"
  51. Property="JP_DOWNGRADABLE_FOUND"
  52. Minimum="$(var.JpAppVersion)"
  53. MigrateFeatures="yes"
  54. IncludeMinimum="$(var.JpUpgradeVersionOnlyDetectDowngrade)" />
  55. </Upgrade>
  56. <?ifndef JpAllowUpgrades ?>
  57. <CustomAction Id="JpDisallowUpgrade" Error="!(loc.DisallowUpgradeErrorMessage)" />
  58. <?endif?>
  59. <?ifndef JpAllowDowngrades ?>
  60. <CustomAction Id="JpDisallowDowngrade" Error="!(loc.DowngradeErrorMessage)" />
  61. <?endif?>
  62. <Binary Id="JpCaDll" SourceFile="$(env.JP_WIXHELPER_DIR)\wixhelper.dll"/>
  63. <CustomAction Id="JpFindRelatedProducts" BinaryKey="JpCaDll" DllEntry="FindRelatedProductsEx" />
  64. <?ifndef SkipCryptomatorLegacyCheck ?>
  65. <!-- Block installation if innosetup entry of Cryptomator is found -->
  66. <Property Id="OLDEXEINSTALLER">
  67. <RegistrySearch Id="InnoSetupInstallation" Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\Cryptomator_is1" Type="raw" Name="DisplayName" />
  68. </Property>
  69. <!-- TODO: localize -->
  70. <Condition Message="A lower version of [ProductName] is already installed. Uninstall it first and then start the setup again. Setup will now exit.">
  71. <![CDATA[Installed OR NOT OLDEXEINSTALLER]]>
  72. </Condition>
  73. <?endif?>
  74. <!-- Cryptomator uses UNIX Sockets, which are supported starting with Windows 10 v1803-->
  75. <Property Id="WINDOWSBUILDNUMBER" Secure="yes">
  76. <RegistrySearch Id="BuildNumberSearch" Root="HKLM" Key="SOFTWARE\Microsoft\Windows NT\CurrentVersion" Name="CurrentBuildNumber" Type="raw" />
  77. </Property>
  78. <Condition Message="This application requires Windows 10 version 1803 (build 17134) or newer.">
  79. <![CDATA[Installed OR (WINDOWSBUILDNUMBER >= 17134)]]>
  80. </Condition>
  81. <!-- Non-Opening ProgID -->
  82. <DirectoryRef Id="INSTALLDIR">
  83. <Component Win64="yes" Id="nonStartingProgID" >
  84. <File Id="IconFileForEncryptedData" KeyPath="yes" Source="$(env.JP_WIXWIZARD_RESOURCES)\$(var.IconFileEncryptedData)" Name="$(var.IconFileEncryptedData)"></File>
  85. <ProgId Id="$(var.JpAppName).Encrypted.1" Description="$(var.JpAppName) Encrypted Data" Icon="IconFileForEncryptedData" IconIndex="0">
  86. <Extension Id="c9r" Advertise="no" ContentType="$(var.ProgIdContentType)">
  87. <MIME ContentType="$(var.ProgIdContentType)" Default="yes"></MIME>
  88. </Extension>
  89. <Extension Id="c9s" Advertise="no" ContentType="$(var.ProgIdContentType)"/>
  90. </ProgId>
  91. </Component>
  92. </DirectoryRef>
  93. <!-- Standard required root -->
  94. <Directory Id="TARGETDIR" Name="SourceDir"/>
  95. <Feature Id="DefaultFeature" Title="!(loc.MainFeatureTitle)" Level="1">
  96. <ComponentGroupRef Id="Shortcuts"/>
  97. <ComponentGroupRef Id="Files"/>
  98. <ComponentGroupRef Id="FileAssociations"/>
  99. <!-- Ref to additional ProgIDs -->
  100. <ComponentRef Id="nonStartingProgID" />
  101. </Feature>
  102. <CustomAction Id="JpSetARPINSTALLLOCATION" Property="ARPINSTALLLOCATION" Value="[INSTALLDIR]" />
  103. <CustomAction Id="JpSetARPCOMMENTS" Property="ARPCOMMENTS" Value="$(var.JpAppDescription)" />
  104. <CustomAction Id="JpSetARPCONTACT" Property="ARPCONTACT" Value="$(var.JpAppVendor)" />
  105. <CustomAction Id="JpSetARPSIZE" Property="ARPSIZE" Value="$(var.JpAppSizeKb)" />
  106. <?ifdef JpHelpURL ?>
  107. <CustomAction Id="JpSetARPHELPLINK" Property="ARPHELPLINK" Value="$(var.JpHelpURL)" />
  108. <?endif?>
  109. <?ifdef JpAboutURL ?>
  110. <CustomAction Id="JpSetARPURLINFOABOUT" Property="ARPURLINFOABOUT" Value="$(var.JpAboutURL)" />
  111. <?endif?>
  112. <?ifdef JpUpdateURL ?>
  113. <CustomAction Id="JpSetARPURLUPDATEINFO" Property="ARPURLUPDATEINFO" Value="$(var.JpUpdateURL)" />
  114. <?endif?>
  115. <Property Id="WixQuietExec64CmdTimeout" Value="20" />
  116. <!-- Note for custom actions: Immediate CAs run BEFORE the files are installed, hence if you depend on installed files, the CAs must be deferred.-->
  117. <!-- WebDAV patches -->
  118. <SetProperty Id="PatchWebDAV" Value="&quot;[INSTALLDIR]patchWebDAV.bat&quot;"
  119. Sequence="execute" Before="PatchWebDAV" />
  120. <CustomAction Id="PatchWebDAV" BinaryKey="WixCA" DllEntry="WixQuietExec64" Execute="deferred" Return="ignore" Impersonate="no"/>
  121. <!-- Running App detection and exit -->
  122. <Property Id="FOUNDRUNNINGAPP" Admin="yes"/>
  123. <util:CloseApplication
  124. Target="$(var.CloseApplicationTarget)"
  125. Id="Close$(var.JpAppName)"
  126. CloseMessage="no"
  127. RebootPrompt="no"
  128. PromptToContinue="yes"
  129. Description="A running instance of $(var.JpAppName) is found, using files marked for update. Please close it to continue."
  130. Property="FOUNDRUNNINGAPP"
  131. >
  132. </util:CloseApplication>
  133. <CustomAction Id="FailOnRunningApp" Error="Installation aborted, because files marked for update are used by a running instance of $(var.JpAppName)."/>
  134. <?ifdef JpIcon ?>
  135. <Property Id="ARPPRODUCTICON" Value="JpARPPRODUCTICON"/>
  136. <Icon Id="JpARPPRODUCTICON" SourceFile="$(var.JpIcon)"/>
  137. <?endif?>
  138. <UIRef Id="JpUI"/>
  139. <InstallExecuteSequence>
  140. <Custom Action="JpSetARPINSTALLLOCATION" After="CostFinalize">Not Installed</Custom>
  141. <Custom Action="JpSetARPCOMMENTS" After="CostFinalize">Not Installed</Custom>
  142. <Custom Action="JpSetARPCONTACT" After="CostFinalize">Not Installed</Custom>
  143. <Custom Action="JpSetARPSIZE" After="CostFinalize">Not Installed</Custom>
  144. <?ifdef JpHelpURL ?>
  145. <Custom Action="JpSetARPHELPLINK" After="CostFinalize">Not Installed</Custom>
  146. <?endif?>
  147. <?ifdef JpAboutURL ?>
  148. <Custom Action="JpSetARPURLINFOABOUT" After="CostFinalize">Not Installed</Custom>
  149. <?endif?>
  150. <?ifdef JpUpdateURL ?>
  151. <Custom Action="JpSetARPURLUPDATEINFO" After="CostFinalize">Not Installed</Custom>
  152. <?endif?>
  153. <?ifndef JpAllowUpgrades ?>
  154. <Custom Action="JpDisallowUpgrade" After="JpFindRelatedProducts">JP_UPGRADABLE_FOUND</Custom>
  155. <?endif?>
  156. <?ifndef JpAllowDowngrades ?>
  157. <Custom Action="JpDisallowDowngrade" After="JpFindRelatedProducts">JP_DOWNGRADABLE_FOUND</Custom>
  158. <?endif?>
  159. <Custom Action="JpFindRelatedProducts" After="FindRelatedProducts"/>
  160. <!-- Check and fail if Cryptomator is running -->
  161. <Custom Action="WixCloseApplications" Before="InstallValidate"></Custom>
  162. <Custom Action="FailOnRunningApp" After="WixCloseApplications" >FOUNDRUNNINGAPP</Custom>
  163. <RemoveExistingProducts After="InstallValidate"/> <!-- Moved from CostInitialize, due to WixCloseApplications -->
  164. <Custom Action="PatchWebDAV" After="InstallFiles">NOT Installed OR REINSTALL</Custom>
  165. </InstallExecuteSequence>
  166. <InstallUISequence>
  167. <Custom Action="JpFindRelatedProducts" After="FindRelatedProducts"/>
  168. </InstallUISequence>
  169. <WixVariable Id="WixUIBannerBmp" Value="$(env.JP_WIXWIZARD_RESOURCES)\banner.bmp" />
  170. <WixVariable Id="WixUIDialogBmp" Value="$(env.JP_WIXWIZARD_RESOURCES)\background.bmp" />
  171. </Product>
  172. </Wix>