main.wxs 9.2 KB

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