From 82a9720e3655d2c0c62cf234a39983fb15c41347 Mon Sep 17 00:00:00 2001 From: Dave Lane <42013603+ReenigneArcher@users.noreply.github.com> Date: Tue, 21 Jul 2026 18:29:24 -0400 Subject: [PATCH] fix(packaging/windows): Allow WiX installer downgrades (#5435) --- cmake/packaging/windows_wix.cmake | 10 ++++ cmake/packaging/wix_resources/wix.template.in | 51 +++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 cmake/packaging/wix_resources/wix.template.in diff --git a/cmake/packaging/windows_wix.cmake b/cmake/packaging/windows_wix.cmake index 4a2f4d03..abdb0430 100644 --- a/cmake/packaging/windows_wix.cmake +++ b/cmake/packaging/windows_wix.cmake @@ -64,6 +64,10 @@ set(CPACK_WIX_HELP_LINK "https://docs.lizardbyte.dev/projects/sunshine/latest/md set(CPACK_WIX_PRODUCT_ICON "${SUNSHINE_ICON_PATH}") set(CPACK_WIX_PRODUCT_URL "${CMAKE_PROJECT_HOMEPAGE_URL}") set(CPACK_WIX_PROGRAM_MENU_FOLDER "LizardByte") +# Force package files to replace existing files when switching between release +# and PR builds, regardless of their embedded file versions. +# https://learn.microsoft.com/en-us/windows/win32/msi/reinstallmode +set(CPACK_WIX_PROPERTY_REINSTALLMODE "amus") set(CPACK_WIX_EXTENSIONS "WixToolset.UI.wixext" @@ -82,6 +86,12 @@ set(CPACK_WIX_EXTRA_SOURCES set(CPACK_WIX_PATCH_FILE "${WIX_BUILD_PARENT_DIRECTORY}/patch.xml" ) +# CPack's default WiX template blocks downgrades. Sunshine users commonly switch +# between release and PR builds, so allow any build to replace the installed one. +# https://docs.firegiant.com/wix/schema/wxs/majorupgrade/#allowdowngrades +set(CPACK_WIX_TEMPLATE + "${WIX_BUILD_PARENT_DIRECTORY}/wix.template.in" +) # Copy root LICENSE and rename to have .txt extension file(COPY "${CMAKE_SOURCE_DIR}/LICENSE" diff --git a/cmake/packaging/wix_resources/wix.template.in b/cmake/packaging/wix_resources/wix.template.in new file mode 100644 index 00000000..e7f8cdd1 --- /dev/null +++ b/cmake/packaging/wix_resources/wix.template.in @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +