main.wxs 10 KB

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