File tree Expand file tree Collapse file tree 6 files changed +34
-54
lines changed Expand file tree Collapse file tree 6 files changed +34
-54
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ del *.nupkg
4
4
del *.snupkg
5
5
call build.release.bat
6
6
IF %ERRORLEVEL% NEQ 0 exit /b 1
7
- call sign3.bat
7
+ powershell -ExecutionPolicy Bypass -file sign3.ps1
8
8
IF %ERRORLEVEL% NEQ 0 exit /b 1
9
9
copy SharpSnmpLib\bin\Release\*.nupkg .
10
10
copy SharpSnmpLib\bin\Release\*.snupkg .
Original file line number Diff line number Diff line change @@ -17,28 +17,11 @@ catch
17
17
{
18
18
Write-Host " MSBuild doesn't exist. Use VSSetup instead."
19
19
20
- Install-Module VSSetup - Scope CurrentUser - Force
21
- Update-Module VSSetup
22
- $instance = Get-VSSetupInstance - All - Prerelease | Select-VSSetupInstance - Latest
23
- $installDir = $instance.installationPath
24
- Write-Host " Found VS in " + $installDir
25
- $msBuild = $installDir + ' \MSBuild\Current\Bin\MSBuild.exe'
20
+ $msbuild = & " ${env: ProgramFiles(x86)} \Microsoft Visual Studio\Installer\vswhere.exe" - latest - requires Microsoft.Component.MSBuild - find MSBuild\** \Bin\MSBuild.exe - products * - nologo | select-object - first 1
26
21
if (! [System.IO.File ]::Exists($msBuild ))
27
22
{
28
- $msBuild = $installDir + ' \MSBuild\15.0\Bin\MSBuild.exe'
29
- if (! [System.IO.File ]::Exists($msBuild ))
30
- {
31
- Write-Host " MSBuild doesn't exist. Exit."
32
- exit 1
33
- }
34
- else
35
- {
36
- Write-Host " Likely on Windows with VS2017."
37
- }
38
- }
39
- else
40
- {
41
- Write-Host " Likely on Windows with VS2019 or VS2022."
23
+ Write-Host " MSBuild doesn't exist. Exit."
24
+ exit 1
42
25
}
43
26
44
27
Write-Host " MSBuild found. Compile the projects."
Original file line number Diff line number Diff line change 1
- $file = Join-Path $PSScriptRoot " cert.txt"
2
- if (-not (Test-Path $file ))
3
- {
4
- Write-Host " No certificate specified. Exit."
5
- exit 0
6
- }
1
+ $cert = Get-ChildItem - Path Cert:\CurrentUser\My - CodeSigningCert | Select-Object - First 1
7
2
8
- $cert = Get-Content - Path $file - TotalCount 1
9
- $foundCert = Test-Certificate - Cert $cert - User
10
- if (! $foundCert )
11
- {
12
- Write-Host " Certificate doesn't exist. Exit."
13
- exit 0
3
+ if ($cert -eq $null ) {
4
+ Write-Host " No code signing certificate found in MY store. Exit."
5
+ exit 1
14
6
}
15
7
16
- $signtool = " C:\Program Files (x86)\Windows Kits\10\bin\10.0.17134.0\x64\signtool.exe"
8
+ $signtool = Get-ChildItem - Path " C:\Program Files (x86)\Windows Kits" - Recurse - Filter " signtool.exe" | Select-Object - First 1 - ExpandProperty FullName
9
+ Write-host " Signtool path: $signtool "
17
10
if (Test-Path $signtool ) {
18
11
Write-Output " sign the assembly"
19
12
& $signtool sign / tr http:// timestamp.digicert.com / td sha256 / fd sha256 / a $args [0 ]
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ $signtool = Get-ChildItem - Path " C:\Program Files (x86)\Windows Kits" - Recurse - Filter " signtool.exe" | Select-Object - First 1 - ExpandProperty FullName
2
+ Write-host " Signtool path: $signtool "
3
+ if (Test-Path $signtool ) {
4
+ New-Item - ItemType Directory - Path " .\SharpSnmpLib\bin\Release" - Force | Out-Null
5
+ Set-Location - Path " .\SharpSnmpLib\bin\Release"
6
+ Get-ChildItem - Recurse - Include * .exe, * .dll | ForEach-Object {
7
+ & $signtool verify / pa / q $_.FullName
8
+ if ($LASTEXITCODE -ne 0 ) {
9
+ Read-Host " Press Enter to continue..."
10
+ }
11
+ }
12
+ Set-Location - Path " ..\..\.."
13
+ New-Item - ItemType Directory - Path " .\SharpSnmpLib.BouncyCastle\bin\Release" - Force | Out-Null
14
+ Set-Location - Path " .\SharpSnmpLib.BouncyCastle\bin\Release"
15
+ Get-ChildItem - Recurse - Include * .exe, * .dll | ForEach-Object {
16
+ & $signtool verify / pa / q $_.FullName
17
+ if ($LASTEXITCODE -ne 0 ) {
18
+ Read-Host " Press Enter to continue..."
19
+ }
20
+ }
21
+ Set-Location - Path " ..\..\.."
22
+ }
23
+
24
+ Exit 0
You can’t perform that action at this time.
0 commit comments