extracted a new script for finding a vstool (such as editbin.exe)

This commit is contained in:
David Sparer
2017-04-21 12:13:54 -06:00
parent 36a5cc7446
commit a9fcdd3341
2 changed files with 42 additions and 9 deletions

View File

@@ -11,15 +11,7 @@ param (
Write-Output "===== Beginning $($PSCmdlet.MyInvocation.MyCommand) ====="
# Find editbin.exe
$path_editBin = @((Resolve-Path -Path "C:\Program Files*\Microsoft Visual Studio*\VC\bin\editbin.exe").Path)[0]
# Verify editbin certificate
$microsoft_cert_thumbprint = "3BDA323E552DB1FDE5F4FBEE75D6D5B2B187EEDC"
$editbin_signature = Get-AuthenticodeSignature -FilePath $path_editBin
if (($editbin_signature.Status -ne "Valid") -or ($editbin_signature.SignerCertificate.Thumbprint -ne $microsoft_cert_thumbprint)) {
Write-Error "Could not validate the signature of editbin.exe - we can not set LargeAddressAware" -ErrorAction Stop
}
$path_editBin = & "$PSScriptRoot\find_vstool.ps1" -FileName "editbin.exe"
$path_outputExe = Join-Path -Path $TargetDir -ChildPath $TargetFileName