diff options
author | Brad King <brad.king@kitware.com> | 2024-06-06 14:46:12 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2024-06-10 15:22:15 (GMT) |
commit | f6c2f64d049530c97e8497ee54d817d746d06cdb (patch) | |
tree | d44685f37a695cdaef654b5d25fea649991c4666 | |
parent | a8cecc3b7ffd66359e85e21ea1678b7839fa3fac (diff) | |
download | CMake-f6c2f64d049530c97e8497ee54d817d746d06cdb.zip CMake-f6c2f64d049530c97e8497ee54d817d746d06cdb.tar.gz CMake-f6c2f64d049530c97e8497ee54d817d746d06cdb.tar.bz2 |
Utilities/Release: Update MSI generation to use WIX 4
-rw-r--r-- | .gitlab/ci/env_windows_arm64_package.ps1 | 2 | ||||
-rw-r--r-- | .gitlab/ci/env_windows_i386_package.ps1 | 2 | ||||
-rw-r--r-- | .gitlab/ci/env_windows_x86_64_package.ps1 | 2 | ||||
-rw-r--r-- | .gitlab/ci/wix3-env.ps1 | 6 | ||||
-rw-r--r-- | .gitlab/ci/wix4-env.ps1 | 7 | ||||
-rw-r--r-- | CMakeCPackOptions.cmake.in | 18 | ||||
-rw-r--r-- | Utilities/Release/WiX/WIX.template.in | 27 | ||||
-rw-r--r-- | Utilities/Release/WiX/cmake_nsis_overwrite_dialog.wxs | 12 | ||||
-rw-r--r-- | Utilities/Release/WiX/custom_action_dll.wxs.in | 2 | ||||
-rw-r--r-- | Utilities/Release/WiX/install_dir.wxs | 73 | ||||
-rw-r--r-- | Utilities/Release/WiX/options.wxs | 20 | ||||
-rw-r--r-- | Utilities/Release/WiX/options_dlg.wxs | 20 | ||||
-rw-r--r-- | Utilities/Release/WiX/patch_desktop_shortcut.xml | 4 | ||||
-rw-r--r-- | Utilities/Release/WiX/patch_path_env.xml | 6 |
14 files changed, 101 insertions, 100 deletions
diff --git a/.gitlab/ci/env_windows_arm64_package.ps1 b/.gitlab/ci/env_windows_arm64_package.ps1 index a898007..74c9c2b 100644 --- a/.gitlab/ci/env_windows_arm64_package.ps1 +++ b/.gitlab/ci/env_windows_arm64_package.ps1 @@ -1 +1 @@ -. .gitlab/ci/wix3-env.ps1 +. .gitlab/ci/wix4-env.ps1 diff --git a/.gitlab/ci/env_windows_i386_package.ps1 b/.gitlab/ci/env_windows_i386_package.ps1 index a898007..74c9c2b 100644 --- a/.gitlab/ci/env_windows_i386_package.ps1 +++ b/.gitlab/ci/env_windows_i386_package.ps1 @@ -1 +1 @@ -. .gitlab/ci/wix3-env.ps1 +. .gitlab/ci/wix4-env.ps1 diff --git a/.gitlab/ci/env_windows_x86_64_package.ps1 b/.gitlab/ci/env_windows_x86_64_package.ps1 index a898007..74c9c2b 100644 --- a/.gitlab/ci/env_windows_x86_64_package.ps1 +++ b/.gitlab/ci/env_windows_x86_64_package.ps1 @@ -1 +1 @@ -. .gitlab/ci/wix3-env.ps1 +. .gitlab/ci/wix4-env.ps1 diff --git a/.gitlab/ci/wix3-env.ps1 b/.gitlab/ci/wix3-env.ps1 deleted file mode 100644 index a872b74..0000000 --- a/.gitlab/ci/wix3-env.ps1 +++ /dev/null @@ -1,6 +0,0 @@ -& "$pwsh" -File .gitlab/ci/wix3.ps1 - -$pwdpath = $pwd.Path -Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\wix3;$env:PATH" - -light -help | Select -First 1 diff --git a/.gitlab/ci/wix4-env.ps1 b/.gitlab/ci/wix4-env.ps1 new file mode 100644 index 0000000..f1fe8b6 --- /dev/null +++ b/.gitlab/ci/wix4-env.ps1 @@ -0,0 +1,7 @@ +& "$pwsh" -File .gitlab/ci/wix4.ps1 + +$pwdpath = $pwd.Path +Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\wix4;$env:PATH" +Set-Item -Force -Path "env:WIX_EXTENSIONS" -Value "$pwdpath\.gitlab\wix4" +Write-Host "wix version: $(wix --version)" +Write-Host "wix extensions: $(wix extension list -g)" diff --git a/CMakeCPackOptions.cmake.in b/CMakeCPackOptions.cmake.in index cbe73e7..65f266e 100644 --- a/CMakeCPackOptions.cmake.in +++ b/CMakeCPackOptions.cmake.in @@ -206,6 +206,9 @@ if("${CPACK_GENERATOR}" STREQUAL "DragNDrop") endif() if("${CPACK_GENERATOR}" STREQUAL "WIX") + set(CPACK_WIX_VERSION 4) + set(CPACK_WIX_BUILD_EXTRA_FLAGS "") + # Reset CPACK_PACKAGE_VERSION to deal with WiX restriction. # But the file names still use the full CMake_VERSION value: set(CPACK_PACKAGE_FILE_NAME @@ -246,14 +249,7 @@ if("${CPACK_GENERATOR}" STREQUAL "WIX") CPACK_START_MENU_SHORTCUTS "CMake Web Site" ) - set(CPACK_WIX_LIGHT_EXTRA_FLAGS "-dcl:high") - - if(NOT "$ENV{CMAKE_CI_PACKAGE}" STREQUAL "") - # Suppress validation. It does not work without - # an interactive session or an admin account. - # https://github.com/wixtoolset/issues/issues/3968 - list(APPEND CPACK_WIX_LIGHT_EXTRA_FLAGS "-sval") - endif() + list(APPEND CPACK_WIX_BUILD_EXTRA_FLAGS -dcl high) set(CPACK_WIX_UI_BANNER "@CMake_SOURCE_DIR@/Utilities/Release/WiX/ui_banner.jpg" @@ -274,7 +270,7 @@ if("${CPACK_GENERATOR}" STREQUAL "WIX") list(APPEND CPACK_WIX_EXTRA_SOURCES "@CMake_SOURCE_DIR@/Utilities/Release/WiX/cmake_nsis_overwrite_dialog.wxs" ) - list(APPEND CPACK_WIX_CANDLE_EXTRA_FLAGS -dCHECK_NSIS=1) + list(APPEND CPACK_WIX_BUILD_EXTRA_FLAGS -d CHECK_NSIS=1) set(_WIX_CUSTOM_ACTION_MULTI_CONFIG "@CMake_BUILD_WIX_CUSTOM_ACTION_MULTI_CONFIG@") if(_WIX_CUSTOM_ACTION_MULTI_CONFIG) @@ -292,7 +288,7 @@ if("${CPACK_GENERATOR}" STREQUAL "WIX") endif() endif() - set(CPACK_WIX_UI_REF "CMakeUI_InstallDir") + set(CPACK_WIX_UI_REF "CMakeUI_InstallDir_$(sys.BUILDARCHSHORT)") set(CPACK_WIX_PATCH_FILE "@CMake_SOURCE_DIR@/Utilities/Release/WiX/patch_path_env.xml" @@ -308,6 +304,6 @@ if("${CPACK_GENERATOR}" STREQUAL "WIX") list(APPEND CPACK_WIX_PATCH_FILE "@CMake_SOURCE_DIR@/Utilities/Release/WiX/patch_desktop_shortcut.xml" ) - list(APPEND CPACK_WIX_CANDLE_EXTRA_FLAGS -dBUILD_QtDialog=1) + list(APPEND CPACK_WIX_BUILD_EXTRA_FLAGS -d BUILD_QtDialog=1) endif() endif() diff --git a/Utilities/Release/WiX/WIX.template.in b/Utilities/Release/WiX/WIX.template.in index fb8fa59..afbd66f 100644 --- a/Utilities/Release/WiX/WIX.template.in +++ b/Utilities/Release/WiX/WIX.template.in @@ -2,17 +2,22 @@ <?include "cpack_variables.wxi"?> -<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" - RequiredVersion="3.6.3303.0"> +<Wix + xmlns="http://wixtoolset.org/schemas/v4/wxs"@CPACK_WIX_CUSTOM_XMLNS_EXPANDED@ + RequiredVersion="4.0" + > - <Product Id="$(var.CPACK_WIX_PRODUCT_GUID)" + <Package Name="$(var.CPACK_PACKAGE_NAME)" - Language="1033" Version="$(var.CPACK_PACKAGE_VERSION)" Manufacturer="$(var.CPACK_PACKAGE_VENDOR)" - UpgradeCode="$(var.CPACK_WIX_UPGRADE_GUID)"> - - <Package InstallerVersion="500" Compressed="yes" InstallScope="perMachine"/> + UpgradeCode="$(var.CPACK_WIX_UPGRADE_GUID)" + ProductCode="$(var.CPACK_WIX_PRODUCT_GUID)" + Scope="perMachine" + InstallerVersion="500" + Language="1033" + Compressed="yes" + > <Media Id="1" Cabinet="media1.cab" EmbedCab="yes"/> @@ -26,7 +31,7 @@ <Property Id="WIXUI_INSTALLDIR" Value="INSTALL_ROOT"/> <?ifdef CPACK_WIX_PRODUCT_ICON?> - <Property Id="ARPPRODUCTICON">ProductIcon.ico</Property> + <Property Id="ARPPRODUCTICON" Value="ProductIcon.ico" /> <Icon Id="ProductIcon.ico" SourceFile="$(var.CPACK_WIX_PRODUCT_ICON)"/> <?endif?> @@ -38,11 +43,11 @@ <WixVariable Id="WixUIDialogBmp" Value="$(var.CPACK_WIX_UI_DIALOG)"/> <?endif?> - <DirectoryRef Id="TARGETDIR"> + <StandardDirectory Id="TARGETDIR"> <Component Id="CMakeRegistry_InstallDir"> <RegistryValue Root="HKLM" Key="Software\Kitware\CMake" Name="InstallDir" Type="string" Value="[INSTALL_ROOT]" /> </Component> - </DirectoryRef> + </StandardDirectory> <FeatureRef Id="ProductFeature"> <ComponentRef Id="CMakeRegistry_InstallDir" /> @@ -54,5 +59,5 @@ <?include "properties.wxi"?> <?include "product_fragment.wxi"?> - </Product> + </Package> </Wix> diff --git a/Utilities/Release/WiX/cmake_nsis_overwrite_dialog.wxs b/Utilities/Release/WiX/cmake_nsis_overwrite_dialog.wxs index 88335f8..deec0f0 100644 --- a/Utilities/Release/WiX/cmake_nsis_overwrite_dialog.wxs +++ b/Utilities/Release/WiX/cmake_nsis_overwrite_dialog.wxs @@ -1,18 +1,12 @@ -<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> +<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> <Fragment> <UI> <Dialog Id="CMakeNsisOverwriteDialog" Width="310" Height="120" Title="NSIS Installation Conflict"> <Control Id="OK" Type="PushButton" X="122" Y="90" Width="56" Height="17" Default="yes" Cancel="yes" Text="!(loc.WixUIOK)"> - <Publish Event="EndDialog" Value="Return">1</Publish> + <Publish Event="EndDialog" Value="Return" /> </Control> <Control Id="Text" Type="Text" X="48" Y="22" Width="260" Height="60"> - <Text> - Uninstall.exe was detected in your chosen installation prefix. - This indicates a conflicting NSIS based installation of CMake. - - Please uninstall your old CMake installation or choose a different - installation directory. - </Text> + <Text Value="Uninstall.exe was detected in your chosen installation prefix.
This indicates a conflicting NSIS based installation of CMake.

Please uninstall your old CMake installation or choose a different
installation directory." /> </Control> <Control Id="Icon" Type="Icon" X="15" Y="15" Width="24" Height="24" ToolTip="!(loc.InvalidDirDlgIconTooltip)" FixedSize="yes" IconSize="32" Text="!(loc.InvalidDirDlgIcon)" /> </Dialog> diff --git a/Utilities/Release/WiX/custom_action_dll.wxs.in b/Utilities/Release/WiX/custom_action_dll.wxs.in index 64e9762..a39bc0d 100644 --- a/Utilities/Release/WiX/custom_action_dll.wxs.in +++ b/Utilities/Release/WiX/custom_action_dll.wxs.in @@ -1,4 +1,4 @@ -<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> +<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> <Fragment> <Binary Id="CMakeCustomActionsDll" SourceFile="$<TARGET_FILE:CMakeWiXCustomActions>"/> diff --git a/Utilities/Release/WiX/install_dir.wxs b/Utilities/Release/WiX/install_dir.wxs index d7debde..a13da97 100644 --- a/Utilities/Release/WiX/install_dir.wxs +++ b/Utilities/Release/WiX/install_dir.wxs @@ -1,17 +1,28 @@ -<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> +<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> + <?foreach WIXUIARCH in X86;X64;A64 ?> <Fragment> - <UI Id="CMakeUI_InstallDir"> + <UI Id="CMakeUI_InstallDir_$(WIXUIARCH)"> + <Publish Dialog="LicenseAgreementDlg" Control="Print" Event="DoAction" Value="WixUIPrintEula_$(WIXUIARCH)" /> + <Publish Dialog="BrowseDlg" Control="OK" Event="DoAction" Value="WixUIValidatePath_$(WIXUIARCH)" Order="3" Condition="NOT WIXUI_DONTVALIDATEPATH" /> + <Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath_$(WIXUIARCH)" Order="2" Condition="NOT WIXUI_DONTVALIDATEPATH" /> + </UI> + + <UIRef Id="CMakeUI_InstallDir" /> + </Fragment> + <?endforeach?> + + <Fragment> + <UI Id="file CMakeUI_InstallDir"> <TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" /> <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" /> <TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" /> <Property Id="DefaultUIFont" Value="WixUI_Font_Normal" /> - <Property Id="WixUI_Mode" Value="InstallDir" /> <DialogRef Id="CMakeOptionsDlg" /> <?ifdef CHECK_NSIS ?> <DialogRef Id="CMakeNsisOverwriteDialog" /> - <?endif ?> + <?endif?> <DialogRef Id="BrowseDlg" /> <DialogRef Id="DiskCostDlg" /> @@ -24,41 +35,39 @@ <DialogRef Id="ResumeDlg" /> <DialogRef Id="UserExit" /> - <Publish Dialog="BrowseDlg" Control="OK" Event="DoAction" Value="WixUIValidatePath" Order="3">1</Publish> - <Publish Dialog="BrowseDlg" Control="OK" Event="SpawnDialog" Value="InvalidDirDlg" Order="4"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish> + <Publish Dialog="BrowseDlg" Control="OK" Event="SpawnDialog" Value="InvalidDirDlg" Order="4" Condition="NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"" /> - <Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish> + <Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999" /> - <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg">NOT Installed</Publish> - <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish> + <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg" Condition="NOT Installed" /> + <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Condition="Installed AND PATCH" /> - <Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish> - <Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="CMakeOptionsDlg">LicenseAccepted = "1"</Publish> + <Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" /> + <Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="CMakeOptionsDlg" Condition="LicenseAccepted = "1"" /> - <Publish Dialog="CMakeOptionsDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg">1</Publish> - <Publish Dialog="CMakeOptionsDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg">1</Publish> + <Publish Dialog="CMakeOptionsDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg" /> + <Publish Dialog="CMakeOptionsDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg" /> - <Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="CMakeOptionsDlg">1</Publish> - <Publish Dialog="InstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish> - <Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath" Order="2">NOT WIXUI_DONTVALIDATEPATH</Publish> - <Publish Dialog="InstallDirDlg" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="3"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish> + <Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="CMakeOptionsDlg" /> + <Publish Dialog="InstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1" /> + <Publish Dialog="InstallDirDlg" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="3" Condition="NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"" /> <?ifdef CHECK_NSIS ?> - <Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="CMakeDetectNsisOverwrite" Order="4">1</Publish> - <Publish Dialog="InstallDirDlg" Control="Next" Event="SpawnDialog" Value="CMakeNsisOverwriteDialog" Order="5">CMAKE_NSIS_OVERWRITE_DETECTED="1"</Publish> - <?endif ?> - <Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="6"><![CDATA[(WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1") AND CMAKE_NSIS_OVERWRITE_DETECTED<>1]]></Publish> - <Publish Dialog="InstallDirDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish> - <Publish Dialog="InstallDirDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish> + <Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="CMakeDetectNsisOverwrite" Order="4" /> + <Publish Dialog="InstallDirDlg" Control="Next" Event="SpawnDialog" Value="CMakeNsisOverwriteDialog" Order="5" Condition="CMAKE_NSIS_OVERWRITE_DETECTED="1"" /> + <?endif?> + <Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="6" Condition="(WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1") AND CMAKE_NSIS_OVERWRITE_DETECTED<>1" /> + <Publish Dialog="InstallDirDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1" /> + <Publish Dialog="InstallDirDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2" /> - <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="InstallDirDlg" Order="1">NOT Installed</Publish> - <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2">Installed AND NOT PATCH</Publish> - <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">Installed AND PATCH</Publish> + <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="InstallDirDlg" Order="1" Condition="NOT Installed" /> + <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2" Condition="Installed AND NOT PATCH" /> + <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2" Condition="Installed AND PATCH" /> - <Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish> + <Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg" /> - <Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish> - <Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish> - <Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish> + <Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg" /> + <Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg" /> + <Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg" /> <Property Id="ARPNOMODIFY" Value="1" /> </UI> @@ -66,7 +75,7 @@ <UIRef Id="WixUI_Common" /> <?ifdef CHECK_NSIS ?> - <CustomAction Id="CMakeDetectNsisOverwrite" BinaryKey="CMakeCustomActionsDll" DllEntry="DetectNsisOverwrite"/> - <?endif ?> + <CustomAction Id="CMakeDetectNsisOverwrite" BinaryRef="CMakeCustomActionsDll" DllEntry="DetectNsisOverwrite" /> + <?endif?> </Fragment> </Wix> diff --git a/Utilities/Release/WiX/options.wxs b/Utilities/Release/WiX/options.wxs index 0fd3527..28d4365 100644 --- a/Utilities/Release/WiX/options.wxs +++ b/Utilities/Release/WiX/options.wxs @@ -1,4 +1,4 @@ -<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> +<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> <Fragment> <!-- Hold the "CMAKE_IN_PATH" checkbox value in a public property to propagate to the InstallExecuteSequence. --> <Property Id="CMAKE_IN_PATH" Value="Init" /> @@ -13,24 +13,24 @@ </Property> <!-- Override the default "CMAKE_IN_PATH" checkbox with a value read from the registry, if any. --> - <SetProperty Action="Set_CMAKE_IN_PATH_REG_0" Id="CMAKE_IN_PATH" After="Set_CMAKE_IN_PATH_Init" Sequence="first" Value="{}"> _CMAKE_IN_PATH_REG = "#0" </SetProperty> - <SetProperty Action="Set_CMAKE_IN_PATH_REG_1" Id="CMAKE_IN_PATH" After="Set_CMAKE_IN_PATH_REG_0" Sequence="first" Value="1"> _CMAKE_IN_PATH_REG = "#1" </SetProperty> + <SetProperty Action="Set_CMAKE_IN_PATH_REG_0" Id="CMAKE_IN_PATH" After="Set_CMAKE_IN_PATH_Init" Sequence="first" Value="{}" Condition="_CMAKE_IN_PATH_REG = "#0"" /> + <SetProperty Action="Set_CMAKE_IN_PATH_REG_1" Id="CMAKE_IN_PATH" After="Set_CMAKE_IN_PATH_REG_0" Sequence="first" Value="1" Condition="_CMAKE_IN_PATH_REG = "#1"" /> <!-- Override the default "CMAKE_IN_PATH" checkbox with a value specified on the command line, if any. --> - <SetProperty Action="Set_CMAKE_IN_PATH_CMD_0" Id="CMAKE_IN_PATH" After="Set_CMAKE_IN_PATH_REG_1" Sequence="first" Value="{}"> ADD_CMAKE_TO_PATH = "0" </SetProperty> - <SetProperty Action="Set_CMAKE_IN_PATH_CMD_1" Id="CMAKE_IN_PATH" After="Set_CMAKE_IN_PATH_CMD_0" Sequence="first" Value="1"> ADD_CMAKE_TO_PATH = "1" </SetProperty> + <SetProperty Action="Set_CMAKE_IN_PATH_CMD_0" Id="CMAKE_IN_PATH" After="Set_CMAKE_IN_PATH_REG_1" Sequence="first" Value="{}" Condition="ADD_CMAKE_TO_PATH = "0"" /> + <SetProperty Action="Set_CMAKE_IN_PATH_CMD_1" Id="CMAKE_IN_PATH" After="Set_CMAKE_IN_PATH_CMD_0" Sequence="first" Value="1" Condition="ADD_CMAKE_TO_PATH = "1"" /> <!-- Support legacy values too. --> - <SetProperty Action="Set_CMAKE_IN_PATH_CMD_None" Id="CMAKE_IN_PATH" After="Set_CMAKE_IN_PATH_CMD_1" Sequence="first" Value="{}"> ADD_CMAKE_TO_PATH = "None" </SetProperty> - <SetProperty Action="Set_CMAKE_IN_PATH_CMD_System" Id="CMAKE_IN_PATH" After="Set_CMAKE_IN_PATH_CMD_None" Sequence="first" Value="1"> ADD_CMAKE_TO_PATH = "System" AND ALLUSERS </SetProperty> + <SetProperty Action="Set_CMAKE_IN_PATH_CMD_None" Id="CMAKE_IN_PATH" After="Set_CMAKE_IN_PATH_CMD_1" Sequence="first" Value="{}" Condition="ADD_CMAKE_TO_PATH = "None"" /> + <SetProperty Action="Set_CMAKE_IN_PATH_CMD_System" Id="CMAKE_IN_PATH" After="Set_CMAKE_IN_PATH_CMD_None" Sequence="first" Value="1" Condition="ADD_CMAKE_TO_PATH = "System" AND ALLUSERS" /> <!-- Per-user installation is not implemented, but reserve the old value for future use. --> - <SetProperty Action="Set_CMAKE_IN_PATH_CMD_User" Id="CMAKE_IN_PATH" After="Set_CMAKE_IN_PATH_CMD_System" Sequence="first" Value="1"> ADD_CMAKE_TO_PATH = "User" AND NOT ALLUSERS </SetProperty> + <SetProperty Action="Set_CMAKE_IN_PATH_CMD_User" Id="CMAKE_IN_PATH" After="Set_CMAKE_IN_PATH_CMD_System" Sequence="first" Value="1" Condition="ADD_CMAKE_TO_PATH = "User" AND NOT ALLUSERS" /> - <DirectoryRef Id="TARGETDIR"> + <StandardDirectory Id="TARGETDIR"> <!-- Save the "CMAKE_IN_PATH" checkbox value persistently in the registry. --> <Component Id="CMakeRegistry_InstallInPATH"> <!-- Use a leading "0" so the value parses as an integer even when the property is unset. --> <RegistryValue Root="HKLM" Key="Software\Kitware\CMake" Name="InstallInPATH" Type="integer" Value="0[CMAKE_IN_PATH]" /> </Component> - </DirectoryRef> + </StandardDirectory> </Fragment> </Wix> diff --git a/Utilities/Release/WiX/options_dlg.wxs b/Utilities/Release/WiX/options_dlg.wxs index 4d27d00..ea2854f 100644 --- a/Utilities/Release/WiX/options_dlg.wxs +++ b/Utilities/Release/WiX/options_dlg.wxs @@ -1,27 +1,27 @@ -<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> +<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> <Fragment> <UI> <PropertyRef Id="CMAKE_IN_PATH" /> <Dialog Id="CMakeOptionsDlg" Width="370" Height="270" Title="Install Options"> - <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)"/> - <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)"/> + <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)" /> + <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" /> <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)"> - <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish> + <Publish Event="SpawnDialog" Value="CancelDlg" /> </Control> - <Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="Choose options for installing CMake [ProductVersion]"/> - <Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="Install Options"/> - <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.InstallDirDlgBannerBitmap)"/> - <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0"/> - <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0"/> + <Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="Choose options for installing CMake [ProductVersion]" /> + <Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="Install Options" /> + <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.InstallDirDlgBannerBitmap)" /> + <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" /> + <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" /> <Control Id="CMAKE_IN_PATH_CheckBox" Type="CheckBox" X="20" Y="60" Width="330" Height="18" CheckBoxValue="1" Property="CMAKE_IN_PATH" Text="Add CMake to the PATH environment variable" /> <?ifdef BUILD_QtDialog ?> <Control Id="DesktopShortcutCheckBox" Type="CheckBox" X="20" Y="80" Width="330" Height="18" CheckBoxValue="1" Property="DESKTOP_SHORTCUT_REQUESTED" Text="Add CMake shortcut to the Desktop" /> - <?endif ?> + <?endif?> </Dialog> </UI> </Fragment> diff --git a/Utilities/Release/WiX/patch_desktop_shortcut.xml b/Utilities/Release/WiX/patch_desktop_shortcut.xml index 8ec2c12..6170d64 100644 --- a/Utilities/Release/WiX/patch_desktop_shortcut.xml +++ b/Utilities/Release/WiX/patch_desktop_shortcut.xml @@ -1,5 +1,3 @@ <CPackWiXPatch> - <CPackWiXFragment Id="CM_SHORTCUT_DESKTOP"> - <Condition>DESKTOP_SHORTCUT_REQUESTED</Condition> - </CPackWiXFragment> + <CPackWiXFragment Id="CM_SHORTCUT_DESKTOP" Condition="DESKTOP_SHORTCUT_REQUESTED" /> </CPackWiXPatch> diff --git a/Utilities/Release/WiX/patch_path_env.xml b/Utilities/Release/WiX/patch_path_env.xml index ba4316d..bf52b27 100644 --- a/Utilities/Release/WiX/patch_path_env.xml +++ b/Utilities/Release/WiX/patch_path_env.xml @@ -1,8 +1,7 @@ <CPackWiXPatch> <CPackWiXFragment Id="CM_DP_bin"> <!-- Implement the "CMAKE_IN_PATH" checkbox when installing for all users. --> - <Component Id="CMakeSystemPathEntryCMP" KeyPath="yes" Guid="0E782367-5D68-4539-81D1-B9757AE496A1"> - <Condition>CMAKE_IN_PATH AND ALLUSERS</Condition> + <Component Id="CMakeSystemPathEntryCMP" KeyPath="yes" Guid="0E782367-5D68-4539-81D1-B9757AE496A1" Condition="CMAKE_IN_PATH AND ALLUSERS"> <Environment Id="CMakeSystemPathEntryENV" Action="set" Part="last" Name="PATH" Value="[INSTALL_ROOT]bin" System="yes"/> @@ -10,8 +9,7 @@ <!-- Implement the "CMAKE_IN_PATH" checkbox when installing per-user. --> <!-- This is not currently reachable, but is reserved for future use. --> - <Component Id="CMakeUserPathEntryCMP" KeyPath="yes" Guid="392E524D-D5BF-4F16-A7AF-A82B07482CB9"> - <Condition>CMAKE_IN_PATH AND NOT ALLUSERS</Condition> + <Component Id="CMakeUserPathEntryCMP" KeyPath="yes" Guid="392E524D-D5BF-4F16-A7AF-A82B07482CB9" Condition="CMAKE_IN_PATH AND NOT ALLUSERS"> <Environment Id="CMakeUserPathEntryENV" Action="set" Part="last" Name="PATH" Value="[INSTALL_ROOT]bin" System="no"/> |