summaryrefslogtreecommitdiffstats
path: root/Utilities/Release
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-03-27 14:13:41 (GMT)
committerBrad King <brad.king@kitware.com>2024-03-28 20:20:04 (GMT)
commit7bd68cf381470642266595392b0dda5eef5ca55d (patch)
tree08c7163468495600ab9b7c21d2f9d1017a8befe6 /Utilities/Release
parentd320c76257febde76728ba53468b349d56d9f0fe (diff)
downloadCMake-7bd68cf381470642266595392b0dda5eef5ca55d.zip
CMake-7bd68cf381470642266595392b0dda5eef5ca55d.tar.gz
CMake-7bd68cf381470642266595392b0dda5eef5ca55d.tar.bz2
Utilities/Release/WiX: Convert PATH modification preference to checkbox
Add explicit support for passing a `ADD_CMAKE_TO_PATH={0,1}` property to `msiexec` command-line installations to control the checkbox. Also preserve compatibility with the old `ADD_CMAKE_TO_PATH={None,System}` property, which previously controlled the radio button group, by mapping the values to the checkbox. Remove the "Add CMake to the system PATH for the current user" option. It actually added CMake to the installing user's PATH, not the system PATH, even though CMake is installed to a system location. Also revise the wording of the desktop shortcut checkbox to match the style of the PATH checkbox wording. Issue: #21465
Diffstat (limited to 'Utilities/Release')
-rw-r--r--Utilities/Release/WiX/options.wxs18
-rw-r--r--Utilities/Release/WiX/options_dlg.wxs14
-rw-r--r--Utilities/Release/WiX/patch_path_env.xml11
3 files changed, 26 insertions, 17 deletions
diff --git a/Utilities/Release/WiX/options.wxs b/Utilities/Release/WiX/options.wxs
new file mode 100644
index 0000000..2c76bb7
--- /dev/null
+++ b/Utilities/Release/WiX/options.wxs
@@ -0,0 +1,18 @@
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
+ <Fragment>
+ <!-- Hold the "CMAKE_IN_PATH" checkbox value in a public property to propagate to the InstallExecuteSequence. -->
+ <Property Id="CMAKE_IN_PATH" Value="Init" />
+
+ <!-- Always initialize the checkbox value so it cannot be directly overridden from the command line. -->
+ <SetProperty Action="Set_CMAKE_IN_PATH_Init" Id="CMAKE_IN_PATH" After="AppSearch" Sequence="first" Value="{}" />
+
+ <!-- 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_Init" 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>
+ <!-- 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>
+ <!-- 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>
+ </Fragment>
+</Wix>
diff --git a/Utilities/Release/WiX/options_dlg.wxs b/Utilities/Release/WiX/options_dlg.wxs
index c8f5a7b..4d27d00 100644
--- a/Utilities/Release/WiX/options_dlg.wxs
+++ b/Utilities/Release/WiX/options_dlg.wxs
@@ -1,7 +1,7 @@
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI>
- <Property Id="ADD_CMAKE_TO_PATH" Value="None"/>
+ <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)"/>
@@ -17,18 +17,10 @@
<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="Hint" Type="Text" X="26" Y="60" Width="250" Height="16" Transparent="yes" Text="By default CMake does not add its directory to the system PATH."/>
-
- <Control Id="ADD_CMAKE_TO_PATHOption" Type="RadioButtonGroup" X="26" Y="100" Width="305" Height="65" Property="ADD_CMAKE_TO_PATH">
- <RadioButtonGroup Property="ADD_CMAKE_TO_PATH">
- <RadioButton Value="None" X="0" Y="0" Width="295" Height="16" Text="Do not add CMake to the system PATH"/>
- <RadioButton Value="System" X="0" Y="20" Width="295" Height="16" Text="Add CMake to the system PATH for all users"/>
- <RadioButton Value="User" X="0" Y="40" Width="295" Height="16" Text="Add CMake to the system PATH for the current user"/>
- </RadioButtonGroup>
- </Control>
+ <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="170" Width="330" Height="18" CheckBoxValue="1" Property="DESKTOP_SHORTCUT_REQUESTED" Text="Create CMake Desktop Icon"/>
+ <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 ?>
</Dialog>
</UI>
diff --git a/Utilities/Release/WiX/patch_path_env.xml b/Utilities/Release/WiX/patch_path_env.xml
index 0e335c4..ba4316d 100644
--- a/Utilities/Release/WiX/patch_path_env.xml
+++ b/Utilities/Release/WiX/patch_path_env.xml
@@ -1,18 +1,17 @@
<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>ADD_CMAKE_TO_PATH = "System"</Condition>
-
+ <Condition>CMAKE_IN_PATH AND ALLUSERS</Condition>
<Environment Id="CMakeSystemPathEntryENV" Action="set" Part="last"
Name="PATH" Value="[INSTALL_ROOT]bin"
System="yes"/>
</Component>
+ <!-- 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>ADD_CMAKE_TO_PATH = "User"</Condition>
-
+ <Condition>CMAKE_IN_PATH AND NOT ALLUSERS</Condition>
<Environment Id="CMakeUserPathEntryENV" Action="set" Part="last"
Name="PATH" Value="[INSTALL_ROOT]bin"
System="no"/>