Files
2023-09-07 23:11:09 +08:00

44 lines
1017 B
PowerShell
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
param($arch, $WindowsTargetPlatformMinVersion="", $CleanImport="")
$ProgramFiles = ${env:ProgramFiles(x86)}
if (-not $ProgramFiles)
{
$ProgramFiles = $env:ProgramFiles
}
$BuiltInVsWhereExe = "$ProgramFiles\Microsoft Visual Studio\Installer\vswhere.exe"
if (-not (Test-Path $BuiltInVsWhereExe))
{
Write-Error "找不到vswhere.exe!"
exit 1
}
Write-Output $BuiltInVsWhereExe
$LatestVisualStudioRoot = & $BuiltInVsWhereExe -latest -prerelease -property installationPath
if (-not (Test-Path $LatestVisualStudioRoot))
{
Write-Error "找不到 VisualStudioRoot!"
exit 1
}
& "$LatestVisualStudioRoot\Common7\Tools\Launch-VsDevShell.ps1" -arch $arch
$env:VC_LTL_Root = "${PSScriptRoot}\..\..\.."
if ($WindowsTargetPlatformMinVersion -ne "")
{
$env:WindowsTargetPlatformMinVersion = "$WindowsTargetPlatformMinVersion"
}
if ($CleanImport -ne "")
{
$env:CleanImport = "$CleanImport"
}
& "$env:VC_LTL_Root\VC-LTL helper for nmake.ps1"
exit 0