diff --git a/CMakeLists.txt b/CMakeLists.txt index 76b9595e5..07ee92417 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -347,11 +347,17 @@ if(WIN32) SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.openmw.org") SET(CPACK_NSIS_INSTALLED_ICON_NAME "omwlauncher.exe") - SET(VCREDIST "${OpenMW_BINARY_DIR}/vcredist_x86.exe") - if(EXISTS ${VCREDIST}) - INSTALL(FILES ${VCREDIST} DESTINATION "redist") + SET(VCREDIST32 "${OpenMW_BINARY_DIR}/vcredist_x86.exe") + if(EXISTS ${VCREDIST32}) + INSTALL(FILES ${VCREDIST32} DESTINATION "redist") SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecWait '\\\"$INSTDIR\\\\redist\\\\vcredist_x86.exe\\\" /q'" ) - endif(EXISTS ${VCREDIST}) + endif(EXISTS ${VCREDIST32}) + + SET(VCREDIST64 "${OpenMW_BINARY_DIR}/vcredist_x64.exe") + if(EXISTS ${VCREDIST64}) + INSTALL(FILES ${VCREDIST64} DESTINATION "redist") + SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecWait '\\\"$INSTDIR\\\\redist\\\\vcredist_x64.exe\\\" /q'" ) + endif(EXISTS ${VCREDIST64}) SET(OALREDIST "${OpenMW_BINARY_DIR}/oalinst.exe") if(EXISTS ${OALREDIST}) @@ -360,6 +366,10 @@ if(WIN32) ExecWait '\\\"$INSTDIR\\\\redist\\\\oalinst.exe\\\" /s'" ) endif(EXISTS ${OALREDIST}) + if(CMAKE_CL_64) + SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64") + endif() + include(CPack) endif(WIN32) diff --git a/components/files/windowspath.cpp b/components/files/windowspath.cpp index cf73b3728..dfa8f20cc 100644 --- a/components/files/windowspath.cpp +++ b/components/files/windowspath.cpp @@ -75,7 +75,7 @@ boost::filesystem::path WindowsPath::getInstallPath() const BOOL f64 = FALSE; LPCTSTR regkey; - if (IsWow64Process(GetCurrentProcess(), &f64) && f64) + if ((IsWow64Process(GetCurrentProcess(), &f64) && f64) || sizeof(void*) == 8) { regkey = "SOFTWARE\\Wow6432Node\\Bethesda Softworks\\Morrowind"; }