main.wxs 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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. <Feature Id="DefaultFeature" Title="!(loc.MainFeatureTitle)" Level="1">
  42. <ComponentGroupRef Id="Shortcuts"/>
  43. <ComponentGroupRef Id="Files"/>
  44. <ComponentGroupRef Id="FileAssociations"/>
  45. </Feature>
  46. <?ifdef JpInstallDirChooser ?>
  47. <Binary Id="JpCaDll" SourceFile="wixhelper.dll"/>
  48. <CustomAction Id="JpCheckInstallDir" BinaryKey="JpCaDll" DllEntry="CheckInstallDir" />
  49. <?endif?>
  50. <CustomAction Id="JpSetARPINSTALLLOCATION" Property="ARPINSTALLLOCATION" Value="[INSTALLDIR]" />
  51. <?ifdef JpIcon ?>
  52. <Property Id="ARPPRODUCTICON" Value="JpARPPRODUCTICON"/>
  53. <Icon Id="JpARPPRODUCTICON" SourceFile="$(var.JpIcon)"/>
  54. <?endif?>
  55. <UI>
  56. <?ifdef JpInstallDirChooser ?>
  57. <Dialog Id="JpInvalidInstallDir" Width="300" Height="85" Title="[ProductName] Setup" NoMinimize="yes">
  58. <Control Id="JpInvalidInstallDirYes" Type="PushButton" X="100" Y="55" Width="50" Height="15" Default="no" Cancel="no" Text="Yes">
  59. <Publish Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
  60. </Control>
  61. <Control Id="JpInvalidInstallDirNo" Type="PushButton" X="150" Y="55" Width="50" Height="15" Default="yes" Cancel="yes" Text="No">
  62. <Publish Event="NewDialog" Value="InstallDirDlg">1</Publish>
  63. </Control>
  64. <Control Id="Text" Type="Text" X="25" Y="15" Width="250" Height="30" TabSkip="no">
  65. <Text>!(loc.message.install.dir.exist)</Text>
  66. </Control>
  67. </Dialog>
  68. <!--
  69. Run our custom wizard in the default install directory.
  70. -->
  71. <Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR"/>
  72. <!-- included at the end -->
  73. <UIRef Id="CustomWizard" />
  74. <Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="JpCheckInstallDir" Order="3">1</Publish>
  75. <Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="JpInvalidInstallDir" Order="5">INSTALLDIR_VALID="0"</Publish>
  76. <Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="5">INSTALLDIR_VALID="1"</Publish>
  77. <?ifndef JpLicenseRtf ?>
  78. <!--
  79. No license file provided.
  80. Override the dialog sequence in built-in dialog set "WixUI_InstallDir"
  81. to exclude license dialog.
  82. -->
  83. <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg" Order="2">1</Publish>
  84. <Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">1</Publish>
  85. <?endif?>
  86. <?else?>
  87. <?ifdef JpLicenseRtf ?>
  88. <UIRef Id="WixUI_Minimal" />
  89. <?endif?>
  90. <?endif?>
  91. </UI>
  92. <?ifdef JpLicenseRtf ?>
  93. <WixVariable Id="WixUILicenseRtf" Value="$(var.JpLicenseRtf)"/>
  94. <?endif?>
  95. <InstallExecuteSequence>
  96. <Custom Action="JpSetARPINSTALLLOCATION" After="CostFinalize">Not Installed</Custom>
  97. <?ifndef JpAllowUpgrades ?>
  98. <Custom Action="JpDisallowUpgrade" After="FindRelatedProducts">JP_UPGRADABLE_FOUND</Custom>
  99. <?endif?>
  100. <?ifndef JpAllowDowngrades ?>
  101. <Custom Action="JpDisallowDowngrade" After="FindRelatedProducts">JP_DOWNGRADABLE_FOUND</Custom>
  102. <?endif?>
  103. <RemoveExistingProducts Before="CostInitialize"/>
  104. </InstallExecuteSequence>
  105. <WixVariable Id="WixUIBannerBmp" Value="$(env.JP_WIXWIZARD_RESOURCES)\banner.bmp" />
  106. <WixVariable Id="WixUIDialogBmp" Value="$(env.JP_WIXWIZARD_RESOURCES)\background.bmp" />
  107. </Product>
  108. <?include $(env.JP_WIXWIZARD_RESOURCES)\customWizard.wxi ?>
  109. </Wix>