From dd2a8c15dca7f1169c234f2d96ab25390b80f7c1 Mon Sep 17 00:00:00 2001 From: Iristyle Date: Mon, 15 Sep 2014 14:17:33 -0700 Subject: [PATCH] chore(ConEmu): release 14.9.14.0 from 9/14/2014 - change how executable is downloaded --- ConEmu/ConEmu.nuspec | 2 +- ConEmu/tools/chocolateyInstall.ps1 | 30 ++++++++++++++++++++++++++---- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/ConEmu/ConEmu.nuspec b/ConEmu/ConEmu.nuspec index c7ce159..6176174 100644 --- a/ConEmu/ConEmu.nuspec +++ b/ConEmu/ConEmu.nuspec @@ -2,7 +2,7 @@ ConEmu - 13.12.25.0 + 14.9.14.0 Maximus5 Xavier Decoster, Ethan J. Brown http://opensource.org/licenses/BSD-3-Clause diff --git a/ConEmu/tools/chocolateyInstall.ps1 b/ConEmu/tools/chocolateyInstall.ps1 index b0f447c..adb3446 100644 --- a/ConEmu/tools/chocolateyInstall.ps1 +++ b/ConEmu/tools/chocolateyInstall.ps1 @@ -1,5 +1,5 @@ $package = 'ConEmu' -$version = '131225' +$version = '140914' try { @@ -8,6 +8,28 @@ try { $os = if ($isSytem32Bit) { "x86" } else { "x64" } + + $url = "http://www.fosshub.com/download/ConEmuSetup.$version.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 + # Connection: keep-alive + # DNT: 1 + # $client.Headers.Add('Accept-Encoding', 'gzip,deflate,sdch') + # $client.Headers.Add('Accept-Language', 'en-US,en;q=0.8') + $client.Headers.Add('Referer', 'http://www.fosshub.com/ConEmu.html') + $client.Headers.Add('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8') + $client.Headers.Add('User-Agent', 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2145.4 Safari/537.36') + $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 = @{ @@ -16,11 +38,11 @@ try { SilentArgs = "/p:$os /passive"; # MSI installer, but packed inside wrapper to select x86 or x64 # version. Therefore, treat it as EXE type. - Url = "https://conemu-maximus5.googlecode.com/files/ConEmuSetup.$version.exe"; - ValidExitCodes = @(0); + File = $tempInstall; + # ValidExitCodes = @(0); } - Install-ChocolateyPackage @params + Install-ChocolateyInstallPackage @params Write-ChocolateySuccess $package } catch {