[llvm] workflows/release-binaries: Improve Windows installer (PR #220414)

Alexandre Ganea via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 1 15:52:11 PDT 2026


https://github.com/aganea created https://github.com/llvm/llvm-project/pull/220414

The Windows WiX installer was missing two things for its setup:
1. The "product ID" which is used to uninstall any previous installed LLVM versions. This avoids having versions living side-by-side with each new release. I've reused the same GUID as the current 23.1.0 Win64 installer, to continue that "line" of product. The AArch64 installation and any prior LLVM version (NSIS) before 23.1.0 will need to be uninstalled manually, if we want to avoid side-by-side installatin.
2. A "per machine" scope which avoids messy installations which are installed globally, but cannot be uninstalled globally, and available only for the current user. After this PR, the installation is available / uninstallable to all users on the machine.

Since LLVM currently requires cmake 3.20 for building, and hasn't been bumped yet to 3.31, also provide a workaround for the WiX scope setup.

Added a release note to signify that users would need to uninstall the previous versions manually.

>From 411e160c086f59885e1c909811c1880dd12626e2 Mon Sep 17 00:00:00 2001
From: Alexandre Ganea <aganea at havenstudios.com>
Date: Mon, 31 Aug 2026 15:25:16 -0400
Subject: [PATCH 1/3] Fix some unset WiX settings

---
 llvm/CMakeLists.txt | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 44299d51d784a..c84a297b34902 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -503,6 +503,12 @@ if(WIN32 AND NOT UNIX)
     # cabinet itself, and CAB supports only MSZIP/LZX/Quantum, so an MSI cannot
     # use LZMA the way the NSIS generator does.
     set(CPACK_WIX_LIGHT_EXTRA_FLAGS "-sval" "-dcl:high")
+    # Make the LLVM installation available for all users.
+    set(CPACK_WIX_INSTALL_SCOPE "perMachine")
+    # Identifies the LLVM product line accross all versions. Must not be changed.
+    # Ensures previous installations are uninstalled and do not live side by
+    # side.
+    set(CPACK_WIX_UPGRADE_GUID "B08613CD-8BD0-4FB6-8937-621936604DE3")
   endif()
 endif()
 include(CPack)

>From 14d3d9e424adc9394956b75a0f7f5a434649aeba Mon Sep 17 00:00:00 2001
From: Alexandre Ganea <aganea at havenstudios.com>
Date: Tue, 1 Sep 2026 12:12:30 -0400
Subject: [PATCH 2/3] Release notes

---
 llvm/docs/ReleaseNotes.md | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/llvm/docs/ReleaseNotes.md b/llvm/docs/ReleaseNotes.md
index 5c288a0ee6fa7..d39f2c4125c32 100644
--- a/llvm/docs/ReleaseNotes.md
+++ b/llvm/docs/ReleaseNotes.md
@@ -227,6 +227,10 @@ Makes programs 10x faster by doing Special New Thing.
 
 ### Changes to the Windows Target
 
+* The project has migrated to MSI installers. Previous installations of LLVM,
+  prior (and including) 23.1.0, must be manually uninstalled first, before
+  installing this new release.
+
 ### Changes to the X86 Backend
 
 ### Changes to the OCaml bindings

>From b49d1047858cc9c7eccb0708f137ca2ed7d4bffb Mon Sep 17 00:00:00 2001
From: Alexandre Ganea <aganea at havenstudios.com>
Date: Tue, 1 Sep 2026 17:36:52 -0400
Subject: [PATCH 3/3] Fix older cmake versions

---
 llvm/CMakeLists.txt               | 11 +++++++++--
 llvm/cmake/WiXPerMachinePatch.xml |  5 +++++
 2 files changed, 14 insertions(+), 2 deletions(-)
 create mode 100644 llvm/cmake/WiXPerMachinePatch.xml

diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index c84a297b34902..0a268f4fe641a 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -503,8 +503,15 @@ if(WIN32 AND NOT UNIX)
     # cabinet itself, and CAB supports only MSZIP/LZX/Quantum, so an MSI cannot
     # use LZMA the way the NSIS generator does.
     set(CPACK_WIX_LIGHT_EXTRA_FLAGS "-sval" "-dcl:high")
-    # Make the LLVM installation available for all users.
-    set(CPACK_WIX_INSTALL_SCOPE "perMachine")
+    # Make the LLVM installation available for all users.  CPack only gained
+    # CPACK_WIX_INSTALL_SCOPE in CMake 3.29, so inject the equivalent ALLUSERS
+    # property when packaging with an older CMake supported by LLVM.
+    if(CMAKE_VERSION VERSION_LESS "3.29")
+      list(APPEND CPACK_WIX_PATCH_FILE
+        "${CMAKE_CURRENT_SOURCE_DIR}/cmake/WiXPerMachinePatch.xml")
+    else()
+      set(CPACK_WIX_INSTALL_SCOPE "perMachine")
+    endif()
     # Identifies the LLVM product line accross all versions. Must not be changed.
     # Ensures previous installations are uninstalled and do not live side by
     # side.
diff --git a/llvm/cmake/WiXPerMachinePatch.xml b/llvm/cmake/WiXPerMachinePatch.xml
new file mode 100644
index 0000000000000..6780214b0b696
--- /dev/null
+++ b/llvm/cmake/WiXPerMachinePatch.xml
@@ -0,0 +1,5 @@
+<CPackWiXPatch>
+  <CPackWiXFragment Id="#PRODUCT">
+    <Property Id="ALLUSERS" Value="1"/>
+  </CPackWiXFragment>
+</CPackWiXPatch>



More information about the llvm-commits mailing list