From d97150119d62ed06a702557d27a85a3e0c333187 Mon Sep 17 00:00:00 2001 From: Lex Li Date: Mon, 5 Aug 2024 23:29:16 -0400 Subject: [PATCH] Fixed signtool detection. --- sign.assembly.ps1 | 4 ++-- sign3.ps1 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sign.assembly.ps1 b/sign.assembly.ps1 index 2b58ece3..eecb4283 100644 --- a/sign.assembly.ps1 +++ b/sign.assembly.ps1 @@ -3,12 +3,12 @@ if ($env:CI -eq "true") { } $cert = Get-ChildItem -Path Cert:\CurrentUser\My -CodeSigningCert | Select-Object -First 1 -if ($cert -eq $null) { +if ($null -eq $cert) { Write-Host "No code signing certificate found in MY store. Exit." exit 1 } -$signtool = Get-ChildItem -Path "C:\Program Files (x86)\Windows Kits" -Recurse -Filter "signtool.exe" | Select-Object -First 1 -ExpandProperty FullName +$signtool = Get-ChildItem -Path "${env:ProgramFiles(x86)}\Windows Kits" -Recurse -Filter "signtool.exe" | Select-Object -First 1 -ExpandProperty FullName Write-host "Signtool path: $signtool" if (Test-Path $signtool) { Write-Output "sign the assembly" diff --git a/sign3.ps1 b/sign3.ps1 index ca419390..17a9acc5 100644 --- a/sign3.ps1 +++ b/sign3.ps1 @@ -2,7 +2,7 @@ if ($env:CI -eq "true") { exit 0 } -$signtool = Get-ChildItem -Path "C:\Program Files (x86)\Windows Kits" -Recurse -Filter "signtool.exe" | Select-Object -First 1 -ExpandProperty FullName +$signtool = Get-ChildItem -Path "${env:ProgramFiles(x86)}\Windows Kits" -Recurse -Filter "signtool.exe" | Select-Object -First 1 -ExpandProperty FullName Write-host "Signtool path: $signtool" if (Test-Path $signtool) { New-Item -ItemType Directory -Path ".\SharpSnmpLib\bin\Release" -Force | Out-Null