From 61025c9e7aa41dae11422162a54cc7696f7e783e Mon Sep 17 00:00:00 2001
From: Luis Calle <53507599+TheLeoP@users.noreply.github.com>
Date: Tue, 4 Jun 2024 07:51:35 -0500
Subject: [PATCH] feat(install): mention standard paths, XDG vars in Windows
installer #29101
fix #25207
The `.wxs` files were copied from
- cmake repo (BSD 3-Clause License)
https://github.com/Kitware/CMake/blob/master/Utilities/Release/WiX/install_dir.wxs
- wix repo [Microsoft Reciprocal License](https://github.com/wixtoolset/wix3/blob/b40e9a32c24033e11b77baf2c91a704382f898ed/LICENSE.TXT))
https://github.com/wixtoolset/wix3/blob/b40e9a32c24033e11b77baf2c91a704382f898ed/src/ext/UIExtension/wixlib/WixUI_InstallDir.wxs
---
cmake.packaging/CMakeLists.txt | 4 ++
cmake.packaging/CustomInstallDirDlg.wxs | 41 +++++++++++
cmake.packaging/WixUI_CustomInstallDir.wxs | 81 ++++++++++++++++++++++
3 files changed, 126 insertions(+)
create mode 100644 cmake.packaging/CustomInstallDirDlg.wxs
create mode 100644 cmake.packaging/WixUI_CustomInstallDir.wxs
diff --git a/cmake.packaging/CMakeLists.txt b/cmake.packaging/CMakeLists.txt
index 645215ec92..7dd3f211f3 100644
--- a/cmake.packaging/CMakeLists.txt
+++ b/cmake.packaging/CMakeLists.txt
@@ -39,6 +39,10 @@ if(WIN32)
set(CPACK_WIX_PROGRAM_MENU_FOLDER "${CPACK_PACKAGE_NAME}")
set(CPACK_PACKAGE_EXECUTABLES "nvim" "Neovim")
+ set(CPACK_WIX_UI_REF "WixUI_CustomInstallDir")
+ list(APPEND CPACK_WIX_EXTRA_SOURCES ${CMAKE_CURRENT_LIST_DIR}/WixUI_CustomInstallDir.wxs)
+ list(APPEND CPACK_WIX_EXTRA_SOURCES ${CMAKE_CURRENT_LIST_DIR}/CustomInstallDirDlg.wxs)
+
# We use a wix patch to add further options to the installer.
# See: https://cmake.org/cmake/help/v3.7/module/CPackWIX.html#variable:CPACK_WIX_PATCH_FILE
list(APPEND CPACK_WIX_EXTENSIONS WixUtilExtension)
diff --git a/cmake.packaging/CustomInstallDirDlg.wxs b/cmake.packaging/CustomInstallDirDlg.wxs
new file mode 100644
index 0000000000..73864cec0b
--- /dev/null
+++ b/cmake.packaging/CustomInstallDirDlg.wxs
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/cmake.packaging/WixUI_CustomInstallDir.wxs b/cmake.packaging/WixUI_CustomInstallDir.wxs
new file mode 100644
index 0000000000..8015758771
--- /dev/null
+++ b/cmake.packaging/WixUI_CustomInstallDir.wxs
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1
+ "1"]]>
+
+ 1
+
+ NOT Installed
+ Installed AND PATCH
+
+ 1
+ LicenseAccepted = "1"
+
+ 1
+ 1
+ NOT WIXUI_DONTVALIDATEPATH
+ "1"]]>
+ WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"
+ 1
+ 1
+
+ NOT Installed
+ Installed AND NOT PATCH
+ Installed AND PATCH
+
+ 1
+
+ 1
+ 1
+ 1
+
+
+
+
+
+
+