diff options
author | Joerg Bornemann <joerg.bornemann@theqtcompany.com> | 2015-12-05 19:09:15 +0100 |
---|---|---|
committer | Oliver Wolff <oliver.wolff@theqtcompany.com> | 2015-12-08 06:37:57 +0000 |
commit | cbb2ce0f918c471a7306a2e6a91730aad6a01f7b (patch) | |
tree | 99f63b4aa010fe40c14d0ec292218370dcb0b8d9 /qmake/generators/win32/msvc_nmake.cpp | |
parent | 3304ea8f0e915b6562d9d89621c42a46bf92dafa (diff) |
Remove Wow6432Node versions of Visual Studio registry keys
The Visual Studio registry keys are stored in the 32 bit view.
Extend qt_readRegistryKey with an option that enables the caller to
choose the 32 bit or 64 bit registry view.
We now read the Visual Studio registry keys from the 32 bit registry
view even in a 64 bit build.
Adding the next Visual Studio version will become a bit easier.
Change-Id: I7300b992be6058f30a422e3f1fe0bafade6eea54
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'qmake/generators/win32/msvc_nmake.cpp')
-rw-r--r-- | qmake/generators/win32/msvc_nmake.cpp | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp index a546e03b59..06c99b6e38 100644 --- a/qmake/generators/win32/msvc_nmake.cpp +++ b/qmake/generators/win32/msvc_nmake.cpp @@ -142,18 +142,8 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t) const bool isPhone = project->isActiveConfig(QStringLiteral("winphone")); #ifdef Q_OS_WIN - QString regKeyPrefix; -#if !defined(Q_OS_WIN64) && _WIN32_WINNT >= 0x0501 - BOOL isWow64; - IsWow64Process(GetCurrentProcess(), &isWow64); - if (!isWow64) - regKeyPrefix = QStringLiteral("Software\\"); - else -#endif - regKeyPrefix = QStringLiteral("Software\\Wow6432Node\\"); - - QString regKey = regKeyPrefix + QStringLiteral("Microsoft\\VisualStudio\\") + msvcVer + ("\\Setup\\VC\\ProductDir"); - const QString vcInstallDir = qt_readRegistryKey(HKEY_LOCAL_MACHINE, regKey); + QString regKey = QStringLiteral("Software\\Microsoft\\VisualStudio\\") + msvcVer + ("\\Setup\\VC\\ProductDir"); + const QString vcInstallDir = qt_readRegistryKey(HKEY_LOCAL_MACHINE, regKey, KEY_WOW64_32KEY); if (vcInstallDir.isEmpty()) { fprintf(stderr, "Failed to find the Visual Studio installation directory.\n"); return false; @@ -161,13 +151,13 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t) QString windowsPath; if (isPhone) { - windowsPath = "Microsoft\\Microsoft SDKs\\WindowsPhoneApp\\v"; + windowsPath = "Software\\Microsoft\\Microsoft SDKs\\WindowsPhoneApp\\v"; } else { - windowsPath = "Microsoft\\Microsoft SDKs\\Windows\\v"; + windowsPath = "Software\\Microsoft\\Microsoft SDKs\\Windows\\v"; } - regKey = regKeyPrefix + windowsPath + winsdkVer + QStringLiteral("\\InstallationFolder"); - const QString kitDir = qt_readRegistryKey(HKEY_LOCAL_MACHINE, regKey); + regKey = windowsPath + winsdkVer + QStringLiteral("\\InstallationFolder"); + const QString kitDir = qt_readRegistryKey(HKEY_LOCAL_MACHINE, regKey, KEY_WOW64_32KEY); if (kitDir.isEmpty()) { fprintf(stderr, "Failed to find the Windows Kit installation directory.\n"); return false; |