summaryrefslogtreecommitdiff
path: root/packaging/wix/CMakeLists.txt
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2017-06-17 11:15:18 -0700
committerGerald Combs <gerald@wireshark.org>2017-06-27 17:34:42 +0000
commitcd635206f039680aca8311c1514f1d44232ee3a1 (patch)
treee50db02b6bce46805f15478925fe67870edda6a6 /packaging/wix/CMakeLists.txt
parent89431bce5373fec79aea03bef9fa25908d92f7f4 (diff)
downloadwireshark-cd635206f039680aca8311c1514f1d44232ee3a1.tar.gz
WiX: Fixup merge module configuration.
Set the merge module path based on our platform and version of Visual Studio. Change-Id: Ic866447f36d5264d61fc988f3f9d8b4d2e5c0827 Reviewed-on: https://code.wireshark.org/review/22192 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net> (cherry picked from commit c89f4c628c315e8f472653856a0776469c65f34e) Reviewed-on: https://code.wireshark.org/review/22424
Diffstat (limited to 'packaging/wix/CMakeLists.txt')
-rw-r--r--packaging/wix/CMakeLists.txt18
1 files changed, 14 insertions, 4 deletions
diff --git a/packaging/wix/CMakeLists.txt b/packaging/wix/CMakeLists.txt
index 835112dc17..28f3d88a16 100644
--- a/packaging/wix/CMakeLists.txt
+++ b/packaging/wix/CMakeLists.txt
@@ -75,8 +75,11 @@ file(TO_NATIVE_PATH "${CMAKE_SOURCE_DIR}" TOP_SRC_DIR)
file(TO_NATIVE_PATH "${CMAKE_BINARY_DIR}/docbook" USER_GUIDE_DIR)
if ("${WIRESHARK_TARGET_PLATFORM}" STREQUAL "win32")
set(TARGET_MACHINE x86)
+ set (MSVC_REDIST_DIR "$ENV{PROGRAMFILES}/Common Files/Merge Modules")
elseif ("${WIRESHARK_TARGET_PLATFORM}" STREQUAL "win64")
set(TARGET_MACHINE x64)
+ set (PF86_ENV "ProgramFiles(x86)")
+ set (MSVC_REDIST_DIR "$ENV{${PF86_ENV}}/Common Files/Merge Modules")
else()
message(FATAL_ERROR "Your mysterious moon-man architecture \"${WIRESHARK_TARGET_PLATFORM}\" frightens and confuses us.")
endif()
@@ -101,10 +104,17 @@ set(PRODUCT_VERSION ${PROJECT_MAJOR_VERSION}.${PROJECT_MINOR_VERSION}.${PROJECT_
set (VERSION "${PROJECT_VERSION}")
set (PRODUCT_VERSION=${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MICRO}.${VERSION_BUILD})
-# Use the merge module that comes with Visual Studio (From MSVC 2015?)
-# This is currently hardcoded for MSVC 2015
-set (MSVC_CRT_VERSION "VC140")
-set (MSVC_REDIST_DIR "$ENV{PROGRAMFILES}/Common Files/Merge Modules")
+# Use the merge module that comes with our version of Visual Studio
+if(MSVC_VERSION GREATER_EQUAL 1910)
+ set (MSVC_CRT_VERSION "VC141")
+ # VS 2017 wasn't nearby at the time of this writing.
+ # set (MSVC_REDIST_DIR "$ENV{VCINSTALLDIR}/path/to/merge/modules")
+elseif(MSVC_VERSION GREATER_EQUAL 1900)
+ set (MSVC_CRT_VERSION "VC140")
+elseif(MSVC_VERSION GREATER_EQUAL 1800)
+ set (MSVC_CRT_VERSION "VC120")
+endif()
+
message(STATUS "Using ${MSVC_REDIST_DIR}/Microsoft_${MSVC_CRT_VERSION}_CRT_${TARGET_MACHINE}.msm for the installer")
if(NOT ENABLE_STATIC)