Skip to content

Commit f48af75

Browse files
authored
Merge pull request #493 from jenkinsci/revert-492-update_jenkinsversion_script
Revert "Add script to update Jenkins version info registry"
2 parents f28d8e1 + b79f860 commit f48af75

File tree

3 files changed

+0
-204
lines changed

3 files changed

+0
-204
lines changed

msi/build/Update-JenkinsVersion.ps1

-153
This file was deleted.

msi/build/build.ps1

-50
Original file line numberDiff line numberDiff line change
@@ -73,58 +73,8 @@ if($MSBuildPath -ne '') {
7373
$MSBuildPath = [System.IO.Path]::GetDirectoryName($MSBuildPath)
7474
}
7575
$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
8376
}
8477

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-
12878
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}"
12979

13080
Get-ChildItem .\bin\Release -Filter *.msi -Recurse |

msi/build/jenkins.wxs

-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@
188188
<File Id="JenkinsXml" Name="jenkins.xml" Source='tmp/jenkins.xml' DiskId='1' />
189189
<File Name="jenkins.exe.config" Source='jenkins.exe.config' DiskId='1' />
190190
<File Name="$(var.ArtifactName).war" Source='$(var.WAR)' DiskId='1' />
191-
<File Name="Update-JenkinsVersion.ps1" Source='tmp/Update-JenkinsVersion.ps1' DiskId='1' />
192191

193192
<!-- Update the XML file with the values selected during install -->
194193
<util:XmlFile Id='JenkinsXmlJenkinsData' Action='setValue' ElementPath='//service/env/@value' File='[#JenkinsXml]' Value='[JENKINS_ROOT].jenkins' Sequence="1"/>

0 commit comments

Comments
 (0)