Skip to content

Commit 735e3a3

Browse files
rainersthewilsonator
authored andcommitted
fix #722 DMD Windows installer doesn't detect recent release of VisualStudio
run vswhere.exe from VS installer to detect installation path
1 parent 08fc8d8 commit 735e3a3

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

windows/d2-installer.nsi

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,19 @@ FunctionEnd
384384
Function DetectVC
385385
ClearErrors
386386

387+
StrCpy $0 "$PROGRAMFILES\Microsoft Visual Studio\Installer\vswhere.exe"
388+
389+
IfFileExists "$0" 0 no_vswhere
390+
nsExec::ExecToStack '"$0" -products * -prerelease -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath'
391+
Pop $1 ; stdout: path
392+
Pop $0 ; result code
393+
StrCmp $0 0 no_vswhere
394+
StrCmp $1 "" no_vswhere
395+
StrCpy $VCVer "VC2017+" ; value not used, but only checked if empty
396+
StrCpy $VCPath $1
397+
Goto done
398+
no_vswhere:
399+
387400
Call DetectVS2019_InstallationFolder
388401
StrCpy $1 "VC2019"
389402
StrCmp $0 "" not_vc2019 vs2019

0 commit comments

Comments
 (0)