-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcrystal.ps1
31 lines (27 loc) · 1.05 KB
/
crystal.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
$buildToolsPath = vswhere.exe -latest -products 'Microsoft.VisualStudio.Product.BuildTools' -property installationPath
$fullInstallPath = vswhere.exe -version '[15.0,)' -property installationPath
$installationPath = ""
if($buildToolsPath) {
$installationPath = $buildToolsPath
}
elseif($fullInstallPath){
$installationPath = $fullInstallPath
}
else
{
"Can't find a full Visual Studio installation or a Visual Studio Build Tools installation."
return
}
if ($installationPath -and (test-path "$installationPath\Common7\Tools\vsdevcmd.bat")) {
if(!$env:READY_FOR_CRYSTAL) {
& "${env:COMSPEC}" /s /c "`"$installationPath\Common7\Tools\vsdevcmd.bat`" -no_logo -arch=amd64 && set" | foreach-object {
$name, $value = $_ -split '=', 2
set-content env:\"$name" $value
}
$env:READY_FOR_CRYSTAL = $true
}
& _crystal.exe $args
}
else {
"Can't find MSVC to load a dev environment, please verify the following workloads and components are installed: Microsoft.VisualStudio.Workload.VCTools and Microsoft.VisualStudio.Component.VC.ATL"
}