From 847bdb70797a0913ceba4065accd38f729d8499b Mon Sep 17 00:00:00 2001 From: Davide Beatrici Date: Tue, 11 Aug 2020 04:03:16 +0200 Subject: [PATCH] FIX(cmake): set CMAKE_WIX_UPGRADE_GUID and generate CMAKE_WIX_PRODUCT_GUID This commit fixes two issues: 1. The installer ignoring Mumble < 1.4.0 installations. This resulted in two separate entries in the installed programs list and a cluttered installation folder. 2. The installer thinking that the product is already installed even if it's a different build. The first problem was caused by CMAKE_WIX_UPGRADE_GUID being explicitely set to a wrong value, due to an extra line in the file. The second problem was caused by CMAKE_WIX_PRODUCT_GUID being explicitely set to a static value due to us misunderstanding the "ProjectGuid" variable in the WiX project we used until 1.4.0. We thought it referred to the MSI product GUID, but instead it's just the MSBuild project identifier. Also, CMake's WiX documentation clearly says that the installer will abort if it detects a pre-existing installation that uses the same GUID: https://cmake.org/cmake/help/latest/cpack_gen/wix.html#variable:CPACK_WIX_PRODUCT_GUID --- cmake/packaging.cmake | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/cmake/packaging.cmake b/cmake/packaging.cmake index bb544109f..06a8baaf0 100644 --- a/cmake/packaging.cmake +++ b/cmake/packaging.cmake @@ -7,16 +7,15 @@ if(WIN32) set(CPACK_GENERATOR WIX) if(64_BIT) - set(CPACK_WIX_PRODUCT_GUID "E028BDFC-3FE2-4BEE-A33B-EB9C80611555") + set(CPACK_WIX_UPGRADE_GUID "E028BDFC-3FE2-4BEE-A33B-EB9C80611555") elseif(32_BIT) - set(CPACK_WIX_PRODUCT_GUID "B0EEFCC7-8A9C-4471-AB10-CBD35BE3161D") + set(CPACK_WIX_UPGRADE_GUID "B0EEFCC7-8A9C-4471-AB10-CBD35BE3161D") endif() set(CPACK_WIX_CULTURES "en-us") set(CPACK_WIX_LCID "1033") set(CPACK_WIX_UI_BANNER "${CMAKE_SOURCE_DIR}/installer/bannrbmp.bmp") set(CPACK_WIX_UI_DIALOG "${CMAKE_SOURCE_DIR}/installer/dlgbmp.bmp") - set(CPACK_WIX_PRODUCT_GUID "84afea8b-15e5-4cc7-b77d-27dd17030944") set(CPACK_WIX_PRODUCT_ICON "${CMAKE_SOURCE_DIR}/icons/mumble.ico") set(CPACK_WIX_EXTENSIONS "WiXUtilExtension") set(CPACK_WIX_TEMPLATE "wix-template.xml") @@ -53,8 +52,7 @@ endif() if(server) if(NOT client) if(WIN32) - set(CPACK_WIX_PRODUCT_GUID "ccc5eaa4-0b88-4197-9e54-580d37003903") - set(CPACK_WIX_UPGRADE_GUID "03e9476f-0f75-4661-bfc9-a9daeb23d3a0") + set(CPACK_WIX_UPGRADE_GUID "03E9476F-0F75-4661-BFC9-A9DAEB23D3A0") endif() set(CPACK_PACKAGE_NAME "Mumble (server)") @@ -101,7 +99,6 @@ if(client AND server) endif() if(WIN32) - set(CPACK_WIX_UPGRADE_GUID ${CPACK_WIX_PRODUCT_GUID}) configure_file("${CMAKE_SOURCE_DIR}/installer/wix-template.xml" ${CMAKE_CURRENT_BINARY_DIR}) endif()