Skip to content

Commit 8f9d433

Browse files
committed
Fixed WIX detection code if WIX environment variable ends with a '\' character.
1 parent c7d247f commit 8f9d433

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

cmake/FindWIX.cmake

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,19 @@
1919
if (WIN32)
2020
# Define possible search locations in the registry
2121
set(_WIX_ROOT_HINTS
22-
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Microsoft\\Windows Installer XML\\3.11;InstallFolder")
23-
22+
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Microsoft\\Windows Installer XML;InstallFolder")
23+
2424
# Search for directories matching 'WiX Toolset*' in both Program Files directories.
2525
file(GLOB _WIX_DIRECTORIES_X64 "C:/Program Files/WiX Toolset*")
2626
file(GLOB _WIX_DIRECTORIES_X86 "C:/Program Files (x86)/WiX Toolset*")
27-
27+
28+
# The environment variable WIX can end with a '\' character. This backslash character is escaping the next character which is the list separator ';'.
29+
set(_WIX_ENV_PATH "$ENV{WIX}")
30+
string(REPLACE "\\" "/" _WIX_ENV_PATH ${_WIX_ENV_PATH})
31+
2832
# Define know directory locations where it could be installed.
2933
set(_WIX_ROOT_PATHS
30-
"$ENV{WIX}"
34+
${_WIX_ENV_PATH}
3135
${_WIX_DIRECTORIES_X86}
3236
${_WIX_DIRECTORIES_X64}
3337
)
@@ -44,11 +48,11 @@ if (WIN32)
4448
)
4549
mark_as_advanced(WIX_ROOT_PATH)
4650
#message("WIX_ROOT_PATH=" "${WIX_ROOT_PATH}")
47-
51+
4852
if (WIX_ROOT_PATH)
4953
set(WIX_BIN_DIR ${WIX_ROOT_PATH}/bin)
5054
endif (WIX_ROOT_PATH)
51-
55+
5256
# Search for the main executables
5357
find_program(WIX_CANDLE
5458
NAMES

0 commit comments

Comments
 (0)