main.wxs 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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. <?include $(var.JpConfigDir)/overrides.wxi ?>
  23. <Product
  24. Id="$(var.JpProductCode)"
  25. Name="$(var.JpAppName)"
  26. Language="$(var.JpProductLanguage)"
  27. Version="$(var.JpAppVersion)"
  28. Manufacturer="$(var.JpAppVendor)"
  29. UpgradeCode="$(var.JpProductUpgradeCode)">
  30. <Package
  31. Description="$(var.JpAppDescription)"
  32. Manufacturer="$(var.JpAppVendor)"
  33. InstallerVersion="$(var.JpInstallerVersion)"
  34. Compressed="$(var.JpCompressedMsi)"
  35. InstallScope="$(var.JpInstallScope)" Platform="x64"
  36. />
  37. <Media Id="1" Cabinet="Data.cab" EmbedCab="yes" />
  38. <Upgrade Id="$(var.JpProductUpgradeCode)">
  39. <UpgradeVersion
  40. OnlyDetect="$(var.JpUpgradeVersionOnlyDetectUpgrade)"
  41. Property="JP_UPGRADABLE_FOUND"
  42. Maximum="$(var.JpAppVersion)"
  43. MigrateFeatures="yes"
  44. IncludeMaximum="$(var.JpUpgradeVersionOnlyDetectUpgrade)" />
  45. <UpgradeVersion
  46. OnlyDetect="$(var.JpUpgradeVersionOnlyDetectDowngrade)"
  47. Property="JP_DOWNGRADABLE_FOUND"
  48. Minimum="$(var.JpAppVersion)"
  49. MigrateFeatures="yes"
  50. IncludeMinimum="$(var.JpUpgradeVersionOnlyDetectDowngrade)" />
  51. </Upgrade>
  52. <?ifndef JpAllowUpgrades ?>
  53. <CustomAction Id="JpDisallowUpgrade" Error="!(loc.DisallowUpgradeErrorMessage)" />
  54. <?endif?>
  55. <?ifndef JpAllowDowngrades ?>
  56. <CustomAction Id="JpDisallowDowngrade" Error="!(loc.DowngradeErrorMessage)" />
  57. <?endif?>
  58. <!-- Looking for legacy Cryptomator versions-->
  59. <Property Id="OLDEXEINSTALLER">
  60. <RegistrySearch Id="InnoSetupInstallation" Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\Cryptomator_is1" Type="raw" Name="DisplayName" />
  61. </Property>
  62. <!-- Block installation if innosetup entry of Cryptomator is found -->
  63. <!-- TODO: localize -->
  64. <Condition Message="A lower version of [ProductName] is already installed. Uninstall it first and then start the setup again. Setup will now exit.">
  65. <![CDATA[Installed OR NOT OLDEXEINSTALLER]]>
  66. </Condition>
  67. <!-- Cryptomator uses UNIX Sockets, which are supported starting with Windows 10 v1803-->
  68. <Property Id="WINDOWSBUILDNUMBER" Secure="yes">
  69. <RegistrySearch Id="BuildNumberSearch" Root="HKLM" Key="SOFTWARE\Microsoft\Windows NT\CurrentVersion" Name="CurrentBuildNumber" Type="raw" />
  70. </Property>
  71. <Condition Message="This application requires Windows 10 version 1803 (build 17134) or newer.">
  72. <![CDATA[Installed OR (WINDOWSBUILDNUMBER >= 17134)]]>
  73. </Condition>
  74. <!-- Non-Opening ProgID -->
  75. <DirectoryRef Id="INSTALLDIR">
  76. <Component Win64="yes" Id="nonStartingProgID" >
  77. <File Id="IconFileForEncryptedData" KeyPath="yes" Source="$(env.JP_WIXWIZARD_RESOURCES)\$(var.IconFileC9rC9s)" Name="$(var.IconFileC9rC9s)"></File>
  78. <ProgId Id="$(var.JpAppName).Encrypted.1" Description="$(var.JpAppName) Encrypted Data" Icon="IconFileForEncryptedData" IconIndex="0">
  79. <Extension Id="c9r" Advertise="no" ContentType="$(var.ProgIdContentType)">
  80. <MIME ContentType="$(var.ProgIdContentType)" Default="yes"></MIME>
  81. </Extension>
  82. <Extension Id="c9s" Advertise="no" ContentType="$(var.ProgIdContentType)"/>
  83. </ProgId>
  84. </Component>
  85. </DirectoryRef>
  86. <!-- Standard required root -->
  87. <Directory Id="TARGETDIR" Name="SourceDir"/>
  88. <Feature Id="DefaultFeature" Title="!(loc.MainFeatureTitle)" Level="1">
  89. <ComponentGroupRef Id="Shortcuts"/>
  90. <ComponentGroupRef Id="Files"/>
  91. <ComponentGroupRef Id="FileAssociations"/>
  92. <!-- Ref to additional ProgIDs -->
  93. <ComponentRef Id="nonStartingProgID" />
  94. </Feature>
  95. <CustomAction Id="JpSetARPINSTALLLOCATION" Property="ARPINSTALLLOCATION" Value="[INSTALLDIR]" />
  96. <CustomAction Id="JpSetARPCOMMENTS" Property="ARPCOMMENTS" Value="$(var.JpAppDescription)" />
  97. <CustomAction Id="JpSetARPCONTACT" Property="ARPCONTACT" Value="$(var.JpAppVendor)" />
  98. <CustomAction Id="JpSetARPSIZE" Property="ARPSIZE" Value="$(var.JpAppSizeKb)" />
  99. <?ifdef JpHelpURL ?>
  100. <CustomAction Id="JpSetARPHELPLINK" Property="ARPHELPLINK" Value="$(var.JpHelpURL)" />
  101. <?endif?>
  102. <?ifdef JpAboutURL ?>
  103. <CustomAction Id="JpSetARPURLINFOABOUT" Property="ARPURLINFOABOUT" Value="$(var.JpAboutURL)" />
  104. <?endif?>
  105. <?ifdef JpUpdateURL ?>
  106. <CustomAction Id="JpSetARPURLUPDATEINFO" Property="ARPURLUPDATEINFO" Value="$(var.JpUpdateURL)" />
  107. <?endif?>
  108. <!-- WebDAV patches -->
  109. <CustomAction Id="PatchWebDAV" Impersonate="no" ExeCommand="[INSTALLDIR]patchWebDAV.bat" Directory="INSTALLDIR" Execute="deferred" Return="asyncWait" />
  110. <!-- Running App detection and exit -->
  111. <Property Id="FOUNDRUNNINGAPP" Admin="yes"/>
  112. <util:CloseApplication
  113. Target="$(var.CloseApplicationTarget)"
  114. Id="Close$(var.JpAppName)"
  115. CloseMessage="no"
  116. RebootPrompt="no"
  117. PromptToContinue="yes"
  118. Description="A running instance of $(var.JpAppName) is found. Please close it to continue."
  119. Property="FOUNDRUNNINGAPP"
  120. >
  121. </util:CloseApplication>
  122. <CustomAction Id="FailOnRunningApp" Impersonate="no" ExeCommand="[SystemFolder]\cmd.exe /c &quot;exit 1&quot;" Directory="INSTALLDIR" Execute="immediate" Return="check" />
  123. <?ifdef JpIcon ?>
  124. <Property Id="ARPPRODUCTICON" Value="JpARPPRODUCTICON"/>
  125. <Icon Id="JpARPPRODUCTICON" SourceFile="$(var.JpIcon)"/>
  126. <?endif?>
  127. <UIRef Id="JpUI"/>
  128. <InstallExecuteSequence>
  129. <Custom Action="JpSetARPINSTALLLOCATION" After="CostFinalize">Not Installed</Custom>
  130. <Custom Action="JpSetARPCOMMENTS" After="CostFinalize">Not Installed</Custom>
  131. <Custom Action="JpSetARPCONTACT" After="CostFinalize">Not Installed</Custom>
  132. <Custom Action="JpSetARPSIZE" After="CostFinalize">Not Installed</Custom>
  133. <?ifdef JpHelpURL ?>
  134. <Custom Action="JpSetARPHELPLINK" After="CostFinalize">Not Installed</Custom>
  135. <?endif?>
  136. <?ifdef JpAboutURL ?>
  137. <Custom Action="JpSetARPURLINFOABOUT" After="CostFinalize">Not Installed</Custom>
  138. <?endif?>
  139. <?ifdef JpUpdateURL ?>
  140. <Custom Action="JpSetARPURLUPDATEINFO" After="CostFinalize">Not Installed</Custom>
  141. <?endif?>
  142. <?ifndef JpAllowUpgrades ?>
  143. <Custom Action="JpDisallowUpgrade" After="FindRelatedProducts">JP_UPGRADABLE_FOUND</Custom>
  144. <?endif?>
  145. <?ifndef JpAllowDowngrades ?>
  146. <Custom Action="JpDisallowDowngrade" After="FindRelatedProducts">JP_DOWNGRADABLE_FOUND</Custom>
  147. <?endif?>
  148. <!-- Check and fail if Cryptomator is running -->
  149. <Custom Action="WixCloseApplications" Before="InstallValidate"></Custom>
  150. <Custom Action="FailOnRunningApp" After="WixCloseApplications" >FOUNDRUNNINGAPP</Custom>
  151. <RemoveExistingProducts After="InstallValidate"/>
  152. <Custom Action="PatchWebDAV" After="InstallFiles">NOT Installed OR REINSTALL</Custom>
  153. </InstallExecuteSequence>
  154. <WixVariable Id="WixUIBannerBmp" Value="$(env.JP_WIXWIZARD_RESOURCES)\banner.bmp" />
  155. <WixVariable Id="WixUIDialogBmp" Value="$(env.JP_WIXWIZARD_RESOURCES)\background.bmp" />
  156. </Product>
  157. </Wix>