aboutsummaryrefslogtreecommitdiffstats
path: root/packaging
diff options
context:
space:
mode:
Diffstat (limited to 'packaging')
-rw-r--r--packaging/wix/CMakeLists.txt18
-rw-r--r--packaging/wix/README2
2 files changed, 15 insertions, 5 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)
diff --git a/packaging/wix/README b/packaging/wix/README
index e851082aeb..e800ed62fa 100644
--- a/packaging/wix/README
+++ b/packaging/wix/README
@@ -23,7 +23,7 @@ currently come as NSIS installers and it seems it would make more sense to "bund
with WiX rather than include them as part of the Wireshark.msi.
2. Needs more flexible handling of VC CRT Merge module (need build script to provide
appropriate macros). Something like (or modifying existing) FindMSVC_REDIST.cmake.
-Currently only VS2013 CRT120 is supported.
+Currently only VS2013 / CRT120 and VS 2015 / CRT140 are supported.
3. Uninstalling previous versions. NSIS installer did things more "manually" than Wix does
by default. Need to merge as best as possible to handle backwards compatibility. The .msi
architecture uses an "UpgradeCode" help facilitate install/uninstall/upgrade and NSIS