-
Notifications
You must be signed in to change notification settings - Fork 1
/
chocolateyInstall.ps1
28 lines (23 loc) · 1000 Bytes
/
chocolateyInstall.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
$packageName = "jenkins"
# the $version variable below is automatically set by our update script
# we hardcode the version in this script, so that users can install specific
# versions from Chocolatey.org
$version = "1.642"
$zipFile = "jenkins-$version.zip"
$msiFile = "jenkins.msi"
$url = "http://mirrors.jenkins-ci.org/windows/$zipFile"
$url64 = $url
$silentArgs = "/quiet"
$validExitCodes = @(0)
try {
$chocTempDir = Join-Path $env:TEMP "chocolatey"
$tempDir = Join-Path $chocTempDir "$packageName"
if (![System.IO.Directory]::Exists($tempDir)) {[System.IO.Directory]::CreateDirectory($tempDir)}
$file = Join-Path $tempDir $zipFile
Get-ChocolateyWebFile $packageName $file $url $url64
Get-ChocolateyUnzip $file $tempDir "" $packageName
$file = Join-Path $tempDir $msiFile
Install-ChocolateyInstallPackage $packageName 'msi' $silentArgs $file -validExitCodes $validExitCodes
} catch {
throw
}