Files
ChocolateyPackages/ConEmu/tools/chocolateyInstall.ps1
Iristyle ee34c1c43f chore(ConEmu): release 14.9.23.0
- use GitHub download url instead of unreliable fosshub
2014-09-25 11:48:30 -07:00

45 lines
1.3 KiB
PowerShell

$package = 'ConEmu'
$version = '14.09.23'
try {
$isSytem32Bit = (($Env:PROCESSOR_ARCHITECTURE -eq 'x86') -and `
($Env:PROCESSOR_ARCHITEW6432 -eq $null))
$os = if ($isSytem32Bit) { "x86" } else { "x64" }
# TODO: use github api to grab latest release?
$url = "https://github.com/Maximus5/ConEmu/releases/download/v$version/ConEmuSetup.$($version.replace('.','')).exe"
$chocTemp = Join-Path $Env:TEMP 'chocolatey'
$tempInstall = Join-Path $chocTemp "ConEmu\ConEmuSetup.$version.exe"
Write-Host "Downloading from $url to $tempInstall"
# need a Referer, User-Agent and Accept to be able to download
# other headers not required
$client = New-Object Net.WebClient
$client.DownloadFile($url, $tempInstall)
Write-Host "Download from $url complete"
# If having problems with untrusted cetrificates on HTTPS, use
# solution: http://stackoverflow.com/a/561242/1579985
$params = @{
PackageName = $package;
FileType = 'exe';
SilentArgs = "/p:$os /passive";
# MSI installer, but packed inside wrapper to select x86 or x64
# version. Therefore, treat it as EXE type.
File = $tempInstall;
# ValidExitCodes = @(0);
}
Install-ChocolateyInstallPackage @params
Write-ChocolateySuccess $package
} catch {
Write-ChocolateyFailure $package "$($_.Exception.Message)"
throw
}