main.wxs 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!-- Cryptomator's Jpackage Wix installer file
  3. Remark: Expressions like $(var.name) are preprocessor variables, see also https://wixtoolset.org/documentation/manual/v3/overview/preprocessor.html
  4. -->
  5. <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
  6. xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
  7. <?ifdef JpIsSystemWide ?>
  8. <?define JpInstallScope="perMachine"?>
  9. <?else?>
  10. <?define JpInstallScope="perUser"?>
  11. <?endif?>
  12. <?define JpProductLanguage=1033 ?>
  13. <?define JpInstallerVersion=200 ?>
  14. <?define JpCompressedMsi=yes ?>
  15. <?ifdef JpAllowUpgrades ?>
  16. <?define JpUpgradeVersionOnlyDetectUpgrade="no"?>
  17. <?else?>
  18. <?define JpUpgradeVersionOnlyDetectUpgrade="yes"?>
  19. <?endif?>
  20. <?ifdef JpAllowDowngrades ?>
  21. <?define JpUpgradeVersionOnlyDetectDowngrade="no"?>
  22. <?else?>
  23. <?define JpUpgradeVersionOnlyDetectDowngrade="yes"?>
  24. <?endif?>
  25. <?include $(var.JpConfigDir)/overrides.wxi ?>
  26. <Product Id="$(var.JpProductCode)" Name="$(var.JpAppName)" Language="$(var.JpProductLanguage)" Version="$(var.JpAppVersion)" Manufacturer="$(var.JpAppVendor)" UpgradeCode="$(var.JpProductUpgradeCode)">
  27. <Package Description="$(var.JpAppDescription)" Manufacturer="$(var.JpAppVendor)" InstallerVersion="$(var.JpInstallerVersion)" Compressed="$(var.JpCompressedMsi)" InstallScope="$(var.JpInstallScope)" Platform="x64" />
  28. <Media Id="1" Cabinet="Data.cab" EmbedCab="yes" />
  29. <Upgrade Id="$(var.JpProductUpgradeCode)">
  30. <UpgradeVersion OnlyDetect="$(var.JpUpgradeVersionOnlyDetectUpgrade)" Property="JP_UPGRADABLE_FOUND" Maximum="$(var.JpAppVersion)" MigrateFeatures="yes" IncludeMaximum="$(var.JpUpgradeVersionOnlyDetectUpgrade)" />
  31. <UpgradeVersion OnlyDetect="$(var.JpUpgradeVersionOnlyDetectDowngrade)" Property="JP_DOWNGRADABLE_FOUND" Minimum="$(var.JpAppVersion)" MigrateFeatures="yes" IncludeMinimum="$(var.JpUpgradeVersionOnlyDetectDowngrade)" />
  32. </Upgrade>
  33. <?ifndef JpAllowUpgrades ?>
  34. <CustomAction Id="JpDisallowUpgrade" Error="!(loc.DisallowUpgradeErrorMessage)" />
  35. <?endif?>
  36. <?ifndef JpAllowDowngrades ?>
  37. <CustomAction Id="JpDisallowDowngrade" Error="!(loc.DowngradeErrorMessage)" />
  38. <?endif?>
  39. <!-- Looking for legacy Cryptomator versions-->
  40. <Property Id="OLDEXEINSTALLER">
  41. <RegistrySearch Id="InnoSetupInstallation" Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\Cryptomator_is1" Type="raw" Name="DisplayName" />
  42. </Property>
  43. <!-- Block installation if innosetup entry of Cryptomator is found -->
  44. <!-- TODO: localize -->
  45. <Condition Message="A lower version of [ProductName] is already installed. Uninstall it first and then start the setup again. Setup will now exit.">
  46. <![CDATA[Installed OR NOT OLDEXEINSTALLER]]>
  47. </Condition>
  48. <!-- Standard required root -->
  49. <Directory Id="TARGETDIR" Name="SourceDir"/>
  50. <!-- Non-Opening ProgID -->
  51. <DirectoryRef Id="INSTALLDIR">
  52. <Component Win64="yes" Id="nonStartingProgID" >
  53. <File Id="IconFileForEncryptedData" KeyPath="yes" Source="$(env.JP_WIXWIZARD_RESOURCES)\Cryptomator-Vault.ico" Name="Cryptomator-Vault.ico"></File>
  54. <ProgId Id="Cryptomator.Encrypted.1" Description="Cryptomator Encrypted Data" Icon="IconFileForEncryptedData" IconIndex="0">
  55. <Extension Id="c9r" Advertise="no" ContentType="application/vnd.cryptomator.encrypted">
  56. <MIME ContentType="application/vnd.cryptomator.encrypted" Default="yes"></MIME>
  57. </Extension>
  58. <Extension Id="c9s" Advertise="no" ContentType="application/vnd.cryptomator.encrypted"/>
  59. </ProgId>
  60. </Component>
  61. </DirectoryRef>
  62. <Feature Id="DefaultFeature" Title="!(loc.MainFeatureTitle)" Level="1">
  63. <ComponentGroupRef Id="Shortcuts"/>
  64. <ComponentGroupRef Id="Files"/>
  65. <ComponentGroupRef Id="FileAssociations"/>
  66. <!-- Ref to additional ProgIDs -->
  67. <ComponentRef Id="nonStartingProgID" />
  68. </Feature>
  69. <?ifdef JpInstallDirChooser ?>
  70. <Binary Id="JpCaDll" SourceFile="wixhelper.dll"/>
  71. <CustomAction Id="JpCheckInstallDir" BinaryKey="JpCaDll" DllEntry="CheckInstallDir" />
  72. <?endif?>
  73. <CustomAction Id="JpSetARPINSTALLLOCATION" Property="ARPINSTALLLOCATION" Value="[INSTALLDIR]" />
  74. <?ifdef JpIcon ?>
  75. <Property Id="ARPPRODUCTICON" Value="JpARPPRODUCTICON"/>
  76. <Icon Id="JpARPPRODUCTICON" SourceFile="$(var.JpIcon)"/>
  77. <?endif?>
  78. <UI>
  79. <?ifdef JpInstallDirChooser ?>
  80. <Dialog Id="JpInvalidInstallDir" Width="300" Height="85" Title="[ProductName] Setup" NoMinimize="yes">
  81. <Control Id="JpInvalidInstallDirYes" Type="PushButton" X="100" Y="55" Width="50" Height="15" Default="no" Cancel="no" Text="Yes">
  82. <Publish Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
  83. </Control>
  84. <Control Id="JpInvalidInstallDirNo" Type="PushButton" X="150" Y="55" Width="50" Height="15" Default="yes" Cancel="yes" Text="No">
  85. <Publish Event="NewDialog" Value="InstallDirDlg">1</Publish>
  86. </Control>
  87. <Control Id="Text" Type="Text" X="25" Y="15" Width="250" Height="30" TabSkip="no">
  88. <Text>!(loc.message.install.dir.exist)</Text>
  89. </Control>
  90. </Dialog>
  91. <!--
  92. Run our custom wizard in the default install directory.
  93. -->
  94. <Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR"/>
  95. <!-- included at the end -->
  96. <UIRef Id="CustomWizard" />
  97. <Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="JpCheckInstallDir" Order="3">1</Publish>
  98. <Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="JpInvalidInstallDir" Order="5">INSTALLDIR_VALID="0"</Publish>
  99. <Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="5">INSTALLDIR_VALID="1"</Publish>
  100. <?ifndef JpLicenseRtf ?>
  101. <!--
  102. No license file provided.
  103. Override the dialog sequence in built-in dialog set "WixUI_InstallDir"
  104. to exclude license dialog.
  105. -->
  106. <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg" Order="2">1</Publish>
  107. <Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">1</Publish>
  108. <?endif?>
  109. <?else?>
  110. <?ifdef JpLicenseRtf ?>
  111. <UIRef Id="WixUI_Minimal" />
  112. <?endif?>
  113. <?endif?>
  114. </UI>
  115. <?ifdef JpLicenseRtf ?>
  116. <WixVariable Id="WixUILicenseRtf" Value="$(var.JpLicenseRtf)"/>
  117. <?endif?>
  118. <InstallExecuteSequence>
  119. <Custom Action="JpSetARPINSTALLLOCATION" After="CostFinalize">Not Installed</Custom>
  120. <?ifndef JpAllowUpgrades ?>
  121. <Custom Action="JpDisallowUpgrade" After="FindRelatedProducts">JP_UPGRADABLE_FOUND</Custom>
  122. <?endif?>
  123. <?ifndef JpAllowDowngrades ?>
  124. <Custom Action="JpDisallowDowngrade" After="FindRelatedProducts">JP_DOWNGRADABLE_FOUND</Custom>
  125. <?endif?>
  126. <RemoveExistingProducts Before="CostInitialize"/>
  127. </InstallExecuteSequence>
  128. <WixVariable Id="WixUIBannerBmp" Value="$(env.JP_WIXWIZARD_RESOURCES)\banner.bmp" />
  129. <WixVariable Id="WixUIDialogBmp" Value="$(env.JP_WIXWIZARD_RESOURCES)\background.bmp" />
  130. </Product>
  131. <?include $(env.JP_WIXWIZARD_RESOURCES)\customWizard.wxi ?>
  132. </Wix>