Commit 7e4294a8 authored by Milian Wolff's avatar Milian Wolff

kdevelop-msvc.bat finds VS-2017 based on a registry key on Windows.

Some months earlier, we discussed [[ | here ]] about `kdevelop-msvc.bat` finding dynamically a VS2017 installation based on registry entries.

Although it works on my Dell laptop (Windows 7 Ultimate x64), I haven't tested it anywhere else as I don't have access to another windows machine. So... any takers?

Test Plan: In case some user has installed VS in a non-standard location (i.e. not in `C:\Program Files`), the script will be able to find the VS tools by not making the assumption that they are installed on `C:\`.

Reviewers: #kdevelop, kfunk, brauch, mwolff

Reviewed By: #kdevelop, mwolff

Subscribers: mwolff, kdevelop-devel

Tags: #kdevelop

Differential Revision:
parent 4a219756
......@@ -3,16 +3,14 @@
setlocal enabledelayedexpansion
setlocal enableextensions
REM Check for newest VS (2017) too. These variables are defined if the script is run from Developer Command Prompt
REM load Visual Studio 2017 developer command prompt if VS150COMNTOOLS is not set. It's ugly and hardcoded too.
for %%n in (Enterprise Professional Community BuildTools) do (
set "p=%ProgramFiles(x86)%\Microsoft Visual Studio\2017\%%n\Common7\Tools\"
if exist "!p!\VsDevCmd.bat" (
set "VS150COMNTOOLS=!p!"
goto :end
REM load Visual Studio 2017 developer command prompt if VS150COMNTOOLS isn't set. Read Windows registry in case VS is not istalled on C:\
for /f "usebackq tokens=3*" %%a in (`reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7" /s`) do (
set vs15_path=%%a %%b
if exist "!vs15_path!Common7\Tools\VsDevCmd.bat" (
set "VS150COMNTOOLS=!vs15_path!Common7\Tools\"
goto :end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment