main.wxs 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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. <!-- Standard required root -->
  40. <Directory Id="TARGETDIR" Name="SourceDir"/>
  41. <!-- Non-Opening ProgID -->
  42. <DirectoryRef Id="INSTALLDIR">
  43. <Component Win64="yes" Id="nonStartingProgID" >
  44. <File Id="IconFileForEncryptedData" KeyPath="yes" Source="$(env.JP_WIXWIZARD_RESOURCES)\Cryptomator-Vault.ico" Name="Cryptomator-Vault.ico"></File>
  45. <ProgId Id="Cryptomator.Encrypted.1" Description="Cryptomator Encrypted Data" Icon="IconFileForEncryptedData" IconIndex="0">
  46. <Extension Id="c9r" Advertise="no" ContentType="application/vnd.cryptomator.encrypted">
  47. <MIME ContentType="application/vnd.cryptomator.encrypted" Default="yes"></MIME>
  48. </Extension>
  49. <Extension Id="c9s" Advertise="no" ContentType="application/vnd.cryptomator.encrypted"/>
  50. </ProgId>
  51. </Component>
  52. </DirectoryRef>
  53. <Feature Id="DefaultFeature" Title="!(loc.MainFeatureTitle)" Level="1">
  54. <ComponentGroupRef Id="Shortcuts"/>
  55. <ComponentGroupRef Id="Files"/>
  56. <ComponentGroupRef Id="FileAssociations"/>
  57. <!-- Ref to additional ProgIDs -->
  58. <ComponentRef Id="nonStartingProgID" />
  59. </Feature>
  60. <?ifdef JpInstallDirChooser ?>
  61. <Binary Id="JpCaDll" SourceFile="wixhelper.dll"/>
  62. <CustomAction Id="JpCheckInstallDir" BinaryKey="JpCaDll" DllEntry="CheckInstallDir" />
  63. <?endif?>
  64. <CustomAction Id="JpSetARPINSTALLLOCATION" Property="ARPINSTALLLOCATION" Value="[INSTALLDIR]" />
  65. <?ifdef JpIcon ?>
  66. <Property Id="ARPPRODUCTICON" Value="JpARPPRODUCTICON"/>
  67. <Icon Id="JpARPPRODUCTICON" SourceFile="$(var.JpIcon)"/>
  68. <?endif?>
  69. <UI>
  70. <?ifdef JpInstallDirChooser ?>
  71. <Dialog Id="JpInvalidInstallDir" Width="300" Height="85" Title="[ProductName] Setup" NoMinimize="yes">
  72. <Control Id="JpInvalidInstallDirYes" Type="PushButton" X="100" Y="55" Width="50" Height="15" Default="no" Cancel="no" Text="Yes">
  73. <Publish Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
  74. </Control>
  75. <Control Id="JpInvalidInstallDirNo" Type="PushButton" X="150" Y="55" Width="50" Height="15" Default="yes" Cancel="yes" Text="No">
  76. <Publish Event="NewDialog" Value="InstallDirDlg">1</Publish>
  77. </Control>
  78. <Control Id="Text" Type="Text" X="25" Y="15" Width="250" Height="30" TabSkip="no">
  79. <Text>!(loc.message.install.dir.exist)</Text>
  80. </Control>
  81. </Dialog>
  82. <!--
  83. Run our custom wizard in the default install directory.
  84. -->
  85. <Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR"/>
  86. <!-- included at the end -->
  87. <UIRef Id="CustomWizard" />
  88. <Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="JpCheckInstallDir" Order="3">1</Publish>
  89. <Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="JpInvalidInstallDir" Order="5">INSTALLDIR_VALID="0"</Publish>
  90. <Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="5">INSTALLDIR_VALID="1"</Publish>
  91. <?ifndef JpLicenseRtf ?>
  92. <!--
  93. No license file provided.
  94. Override the dialog sequence in built-in dialog set "WixUI_InstallDir"
  95. to exclude license dialog.
  96. -->
  97. <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg" Order="2">1</Publish>
  98. <Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">1</Publish>
  99. <?endif?>
  100. <?else?>
  101. <?ifdef JpLicenseRtf ?>
  102. <UIRef Id="WixUI_Minimal" />
  103. <?endif?>
  104. <?endif?>
  105. </UI>
  106. <?ifdef JpLicenseRtf ?>
  107. <WixVariable Id="WixUILicenseRtf" Value="$(var.JpLicenseRtf)"/>
  108. <?endif?>
  109. <InstallExecuteSequence>
  110. <Custom Action="JpSetARPINSTALLLOCATION" After="CostFinalize">Not Installed</Custom>
  111. <?ifndef JpAllowUpgrades ?>
  112. <Custom Action="JpDisallowUpgrade" After="FindRelatedProducts">JP_UPGRADABLE_FOUND</Custom>
  113. <?endif?>
  114. <?ifndef JpAllowDowngrades ?>
  115. <Custom Action="JpDisallowDowngrade" After="FindRelatedProducts">JP_DOWNGRADABLE_FOUND</Custom>
  116. <?endif?>
  117. <RemoveExistingProducts Before="CostInitialize"/>
  118. </InstallExecuteSequence>
  119. <WixVariable Id="WixUIBannerBmp" Value="$(env.JP_WIXWIZARD_RESOURCES)\banner.bmp" />
  120. <WixVariable Id="WixUIDialogBmp" Value="$(env.JP_WIXWIZARD_RESOURCES)\background.bmp" />
  121. </Product>
  122. <?include $(env.JP_WIXWIZARD_RESOURCES)\customWizard.wxi ?>
  123. </Wix>