From 58f3032c4e7a33e0ca10b0b31af0d1145f3d9ed6 Mon Sep 17 00:00:00 2001 From: ComFreek Date: Mon, 22 Aug 2016 17:55:30 +0200 Subject: [PATCH 1/2] (GH-920) Fix missing $ in Get-FtpFile In case an error occurs (e.g. server responds with 404) and Get-FtpFile's catch clause is reached, the syntax error is reached. --- src/chocolatey.resources/helpers/functions/Get-FtpFile.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chocolatey.resources/helpers/functions/Get-FtpFile.ps1 b/src/chocolatey.resources/helpers/functions/Get-FtpFile.ps1 index 454309b91d..8299e75a1e 100644 --- a/src/chocolatey.resources/helpers/functions/Get-FtpFile.ps1 +++ b/src/chocolatey.resources/helpers/functions/Get-FtpFile.ps1 @@ -190,7 +190,7 @@ param( } Set-PowerShellExitCode 404 - if (env:DownloadCacheAvailable -eq 'true') { + if ($env:DownloadCacheAvailable -eq 'true') { throw "The remote file either doesn't exist, is unauthorized, or is forbidden for url '$url'. $($_.Exception.Message) `nThis package is likely not broken for licensed users - see https://chocolatey.org/docs/features-private-cdn." } else { throw "The remote file either doesn't exist, is unauthorized, or is forbidden for url '$url'. $($_.Exception.Message)" From d36c699ba257d7935afa5093938ffdfc8bc3681c Mon Sep 17 00:00:00 2001 From: andmos Date: Wed, 24 Aug 2016 10:54:54 +0200 Subject: [PATCH 2/2] (GH-925) Make package title available to $env Some times the title of the package must be presented to the user in a "pretty" matter. The Package Id helps, but is not "GUI-friendly". To avoid the need to parse the Id ourselves, this adds the access to the package title as an environment variable. --- src/chocolatey/infrastructure.app/services/PowershellService.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/chocolatey/infrastructure.app/services/PowershellService.cs b/src/chocolatey/infrastructure.app/services/PowershellService.cs index d42d8c357c..4a9bbc016b 100644 --- a/src/chocolatey/infrastructure.app/services/PowershellService.cs +++ b/src/chocolatey/infrastructure.app/services/PowershellService.cs @@ -385,6 +385,8 @@ public void prepare_powershell_environment(IPackage package, ChocolateyConfigura Environment.SetEnvironmentVariable("chocolateyPackageName", package.Id); Environment.SetEnvironmentVariable("packageName", package.Id); + Environment.SetEnvironmentVariable("chocolateyPackageTitle", package.Title); + Environment.SetEnvironmentVariable("packageTitle", package.Title); Environment.SetEnvironmentVariable("chocolateyPackageVersion", package.Version.to_string()); Environment.SetEnvironmentVariable("packageVersion", package.Version.to_string()); Environment.SetEnvironmentVariable("chocolateyPackageFolder", packageDirectory);