@@ -73,58 +73,8 @@ if($MSBuildPath -ne '') {
73
73
$MSBuildPath = [System.IO.Path ]::GetDirectoryName($MSBuildPath )
74
74
}
75
75
$env: PATH = $env: PATH + " ;" + $MSBuildPath
76
- } else {
77
- # try to find it with vswhere
78
- $MSBuildPath = & ' C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe' - products * - latest - requires Microsoft.Component.MSBuild - find MSBuild\** \Bin\MSBuild.exe
79
- if (($MSBuildPath -ne ' ' ) -and $MSBuildPath.ToLower ().EndsWith(' msbuild.exe' )) {
80
- $MSBuildPath = [System.IO.Path ]::GetDirectoryName($MSBuildPath )
81
- }
82
- $env: PATH = $env: PATH + " ;" + $MSBuildPath
83
76
}
84
77
85
- Copy-Item - Force - Path .\Update-JenkinsVersion.ps1 - Destination tmp
86
- # Sign the Update-JenkinsVersion.ps1 script if we have PKCS files
87
- if ((-not ([System.String ]::IsNullOrWhiteSpace($env: PKCS12_FILE )) -and (Test-Path $env: PKCS12_FILE )) -and (-not [System.String ]::IsNullOrWhiteSpace($env: SIGN_STOREPASS ))) {
88
- Write-Host " Signing Update-JenkinsVersion.ps1"
89
- # always disable tracing
90
- Set-PSDebug - Trace 0
91
-
92
- $retries = 10
93
- $i = $retries
94
- # Create an array of timestamp servers that includes each of the known timestamp servers duplicated $retries times so that the list won't be exhausted during retry
95
- # Start with digicert because we purchased the code signing certificate from digicert
96
- $timestampservers = " http://timestamp.digicert.com" , " http://rfc3161timestamp.globalsign.com/advanced" , " http://timestamp.sectigo.com/" , " http://timestamp.verisign.com/scripts/timstamp.dll" * $retries
97
- for (; $i -gt 0 ; $i -- ) {
98
- $Error.Clear () # clear out errors
99
- # Pop first entry from timestamp server array, use it as timestamp server for this attempt
100
- $timestamp , $timestampservers = $timestampservers
101
- # Submit SHA256 digest to RFC 3161 timestamp server
102
- $store_password = ConvertTo-SecureString " ${env: SIGN_STOREPASS} " - AsPlainText - Force
103
- $cert = Get-PfxCertificate - FilePath " ${env: PKCS12_FILE} " - Password $store_password
104
- Set-AuthenticodeSignature - Certificate $cert - FilePath .\tmp\Update-JenkinsVersion.ps1 - TimestampServer $timestamp - HashAlgorithm SHA256 - ErrorAction SilentlyContinue
105
- if ($Error.Count -eq 0 ) {
106
- break
107
- } else {
108
- Start-Sleep - Seconds 15
109
- }
110
- }
111
-
112
- if ($i -le 0 ) {
113
- Write-Error " Set-AuthenticodeSignature did not complete successfully after $retries tries"
114
- exit -1
115
- }
116
-
117
- if ($UseTracing ) { Set-PSDebug - Trace 1 }
118
-
119
- Write-Host " Checking the signature"
120
- $signature = Get-AuthenticodeSignature .\tmp\Update-JenkinsVersion.ps1
121
- if ($signature.Status -ne ' Valid' ) {
122
- Write-Error " Signature is not valid for Update-JenkinsVersion.ps1!"
123
- exit -1
124
- }
125
- }
126
-
127
-
128
78
msbuild " jenkins.wixproj" / p:Stable= " ${isLts} " / p:WAR= " ${War} " / p:Configuration= Release / p:DisplayVersion= $JenkinsVersion / p:ProductName= " ${ProductName} " / p:ProductSummary= " ${ProductSummary} " / p:ProductVendor= " ${ProductVendor} " / p:ArtifactName= " ${ArtifactName} " / p:BannerBmp= " ${BannerBmp} " / p:DialogBmp= " ${DialogBmp} " / p:InstallerIco= " ${InstallerIco} "
129
79
130
80
Get-ChildItem .\bin\Release - Filter * .msi - Recurse |
0 commit comments