Skip to content

Commit fb9e8fc

Browse files
author
Steve Salas
committed
Test for valid signtool.exe path
1 parent 198d652 commit fb9e8fc

File tree

4 files changed

+21
-10
lines changed

4 files changed

+21
-10
lines changed

installers/DotNet-Tracer/build.ps1

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ Push-Location $PSScriptRoot
1717

1818
. ..\Scripts\common.ps1
1919

20+
if ($signOutput -and (-not(test-path $signToolPath))) {
21+
Write-Error "Unable to find signtool.exe at $signToolPath"
22+
exit 1
23+
}
24+
2025
$filesFolderPath = join-path $PSScriptRoot 'Files\codepulse'
2126
$filesDownloadFolderPath = join-path $PSScriptRoot 'Files\codepulse-download'
2227
$filesDownloadFolderImgPath = join-path $filesDownloadFolderPath 'img'
@@ -184,7 +189,7 @@ Press Enter *after* you have signed the bundle...
184189
$bundlePath = join-path $dotNetTracerMainPath "CodePulse.Bundle\bin\$buildConfiguration\CodePulse.DotNet.Tracer.Installer.exe"
185190

186191
Write-Verbose 'Verifying that the bundle is signed...'
187-
signtool.exe verify /pa /tw $bundlePath
192+
& $signToolPath verify /pa /tw $bundlePath
188193
if ($lastexitcode -ne 0) {
189194
Write-Verbose 'Cannot continue because the bundle is not signed.'
190195
exit $lastexitcode

installers/Scripts/common.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ $zipFilePath = join-path $toolsPath 'ZipFile\bin\ZipFile.exe'
190190
$dotNetSymbolServicePath = join-path $codePulsePath 'dotnet-symbol-service'
191191
$dotNetTracerPath = join-path $codePulsePath 'dotnet-tracer'
192192
$dotNetTracerMainPath = join-path $dotNetTracerPath 'main'
193+
$signToolPath = 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x86\signtool.exe'
193194

194195
$buildConfiguration = 'Release'
195196

installers/Windows/build.ps1

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
# This script creates the Windows Code Pulse package
33
#
44
param (
5-
[switch] $signOutput,
6-
[string] $version='1.0.0',
5+
[switch] $signOutput,
6+
[string] $version='1.0.0',
77
[string] $releaseDate=([DateTime]::Now.ToShortDateString())
88
)
99

@@ -15,6 +15,11 @@ Push-Location $PSScriptRoot
1515

1616
. ..\Scripts\common.ps1
1717

18+
if ($signOutput -and (-not(test-path $signToolPath))) {
19+
Write-Error "Unable to find signtool.exe at $signToolPath"
20+
exit 1
21+
}
22+
1823
if (-not (Test-MsBuild)) {
1924
exit 1
2025
}
@@ -78,7 +83,7 @@ Press Enter *after* you have signed the bundle...
7883
Write-Host $signingInstructions; Read-Host
7984

8085
Write-Verbose 'Verifying that the MSI is signed...'
81-
signtool.exe verify /pa /tw $msiPath
86+
& $signToolPath verify /pa /tw $msiPath
8287
if ($lastexitcode -ne 0) {
8388
Write-Verbose 'Cannot continue because the MSI is not signed.'
8489
exit $lastexitcode

installers/build.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
# 4. locate generated Code Pulse packages in this directory
88
#
99
param (
10-
[switch] $skipInit,
10+
[switch] $skipInit,
1111
[switch] $skipDotNetTracer,
12-
[switch] $skipWindows,
13-
[switch] $skipMac,
14-
[switch] $skipLinux,
12+
[switch] $skipWindows,
13+
[switch] $skipMac,
14+
[switch] $skipLinux,
1515
[switch] $signOutput,
1616
[switch] $useGitHubDotNetTracerWindowsDownloadUrl,
17-
[string] $version='1.0.0',
18-
[string] $versionForDotNetTracerWindowsDownloadUrl='1.0.0',
17+
[string] $version='1.0.0',
18+
[string] $versionForDotNetTracerWindowsDownloadUrl='1.0.0',
1919
[string] $releaseDate=([DateTime]::Now.ToShortDateString())
2020
)
2121

0 commit comments

Comments
 (0)