Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CacheLocation parameter not respected during downloading packages #1591

Closed
buenyX opened this issue Jun 8, 2018 · 14 comments
Closed

CacheLocation parameter not respected during downloading packages #1591

buenyX opened this issue Jun 8, 2018 · 14 comments

Comments

@buenyX
Copy link

buenyX commented Jun 8, 2018

We have a terminal server environment where we configured UserProfileDisks with a limit of 1 GB.

Every user (also the administrative accounts) are affected by this policy. If we are trying to install a package above the profile size choco doesn't do anything or crashes (not sure).

While digging into it we saw the following behaviour.

What You Are Seeing?

choco is not using CacheLocation for downloaded packages instead it uses $env:USERPROFILE\AppData\Local\NuGet\Cache (for example C:\Users\Administrator\AppData\Local\NuGet\Cache)

What is Expected?

choco should use the defined CacheLocation

How Did You Get This To Happen? (Steps to Reproduce)

choco install packagename

Output Log

Full Log Output

PS C:\Users\Administrator> choco install 7zip-german -dv
Chocolatey v0.10.11
Chocolatey is running on Windows v 10.0.14393.0
Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".
Attempting to delete file "C:\ProgramData\chocolatey\choco.exe.old".
Command line: "C:\ProgramData\chocolatey\choco.exe" install 7zip-german -dv
Received arguments: install 7zip-german -dv
RemovePendingPackagesTask is now ready and waiting for PreRunMessage.
Sending message 'PreRunMessage' out if there are subscribers...
[Pending] Removing all pending packages that should not be considered installed...
The source 'https://chocolatey.companyname.de:443/chocolatey' evaluated to a 'normal' source type

NOTE: Hiding sensitive configuration data! Please double and triple
 check to be sure no sensitive data is shown, especially if copying
 output to a gist for review.
Configuration: CommandName='install'|CacheLocation='c:\temp\choco'|
ContainsLegacyPackageInstalls='True'|
CommandExecutionTimeoutSeconds='2700'|WebRequestTimeoutSeconds='30'|
Sources='https://chocolatey.companyname.de:443/chocolatey'|
SourceType='normal'|Debug='True'|Verbose='True'|Trace='False'|
Force='False'|Noop='False'|HelpRequested='False'|
UnsuccessfulParsing='False'|RegularOutput='True'|QuietOutput='False'|
PromptForConfirmation='True'|AcceptLicense='False'|
AllowUnofficialBuild='False'|Input='7zip-german'|AllVersions='False'|
SkipPackageInstallProvider='False'|PackageNames='7zip-german'|
Prerelease='False'|ForceX86='False'|OverrideArguments='False'|
NotSilent='False'|ApplyPackageParametersToDependencies='False'|
ApplyInstallArgumentsToDependencies='False'|IgnoreDependencies='False'|
AllowMultipleVersions='False'|AllowDowngrade='False'|
ForceDependencies='False'|Information.PlatformType='Windows'|
Information.PlatformVersion='10.0.14393.0'|
Information.PlatformName='Windows Server 2016'|
Information.ChocolateyVersion='0.10.11.0'|
Information.ChocolateyProductVersion='0.10.11'|
Information.FullName='choco, Version=0.10.11.0, Culture=neutral, PublicKeyToken=79d02ea9cad655eb'|

Information.Is64BitOperatingSystem='True'|
Information.Is64BitProcess='True'|Information.IsInteractive='True'|
Information.UserName='Administrator'|
Information.UserDomainName='PLAYGROUND'|
Information.IsUserAdministrator='True'|
Information.IsUserSystemAccount='False'|
Information.IsUserRemoteDesktop='False'|
Information.IsUserRemote='True'|
Information.IsProcessElevated='True'|
Information.IsLicensedVersion='False'|Information.LicenseType='Foss'|
Features.AutoUninstaller='True'|Features.ChecksumFiles='True'|
Features.AllowEmptyChecksums='False'|
Features.AllowEmptyChecksumsSecure='True'|
Features.FailOnAutoUninstaller='False'|
Features.FailOnStandardError='False'|Features.UsePowerShellHost='True'|
Features.LogEnvironmentValues='False'|Features.LogWithoutColor='False'|
Features.VirusCheck='False'|
Features.FailOnInvalidOrMissingLicense='False'|
Features.IgnoreInvalidOptionsSwitches='True'|
Features.UsePackageExitCodes='True'|
Features.UseFipsCompliantChecksums='False'|
Features.ShowNonElevatedWarnings='True'|
Features.ShowDownloadProgress='True'|
Features.StopOnFirstPackageFailure='False'|
Features.UseRememberedArgumentsForUpgrades='False'|
Features.IgnoreUnfoundPackagesOnUpgradeOutdated='False'|
Features.RemovePackageInformationOnUninstall='False'|
Features.ScriptsCheckLastExitCode='False'|
ListCommand.LocalOnly='False'|
ListCommand.IdOnly='False'|ListCommand.IncludeRegistryPrograms='False'|
ListCommand.PageSize='25'|ListCommand.Exact='False'|
ListCommand.ByIdOnly='False'|ListCommand.ByTagOnly='False'|
ListCommand.IdStartsWith='False'|ListCommand.OrderByPopularity='False'|
ListCommand.ApprovedOnly='False'|
ListCommand.DownloadCacheAvailable='False'|
ListCommand.NotBroken='False'|
ListCommand.IncludeVersionOverrides='False'|
UpgradeCommand.FailOnUnfound='False'|
UpgradeCommand.FailOnNotInstalled='False'|
UpgradeCommand.NotifyOnlyAvailableUpgrades='False'|
UpgradeCommand.ExcludePrerelease='False'|
NewCommand.AutomaticPackage='False'|
NewCommand.UseOriginalTemplate='False'|SourceCommand.Command='unknown'|
SourceCommand.Priority='0'|SourceCommand.BypassProxy='False'|
SourceCommand.AllowSelfService='False'|
SourceCommand.VisibleToAdminsOnly='False'|
FeatureCommand.Command='unknown'|ConfigCommand.Command='unknown'|
PinCommand.Command='unknown'|OutdatedCommand.IgnorePinned='False'|
Proxy.BypassOnLocal='True'|
_ Chocolatey:ChocolateyInstallCommand - Normal Run Mode _
Installing the following packages:
7zip-german
By installing you accept licenses for the packages.
[NuGet] Attempting to resolve dependency 'chocolatey-core.extension (= 1.2)'.
Progress: Downloading chocolatey-core.extension 1.3.3... 100%
Progress: Downloading 7zip-german 18.0.5... 100%
[NuGet] Installing 'chocolatey-core.extension 1.3.3'.
[NuGet] Added file 'chocolatey-core.psm1' to folder 'chocolatey-core.extension\extensions'.
[NuGet] Added file 'Get-AppInstallLocation.ps1' to folder 'chocolatey-core.extension\extensions'.
[NuGet] Added file 'Get-AvailableDriveLetter.ps1' to folder 'chocolatey-core.extension\extensions'.
[NuGet] Added file 'Get-EffectiveProxy.ps1' to folder 'chocolatey-core.extension\extensions'.
[NuGet] Added file 'Get-PackageCacheLocation.ps1' to folder 'chocolatey-core.extension\extensions'.
[NuGet] Added file 'Get-PackageParameters.ps1' to folder 'chocolatey-core.extension\extensions'.
[NuGet] Added file 'Get-UninstallRegistryKey.ps1' to folder 'chocolatey-core.extension\extensions'.
[NuGet] Added file 'Get-WebContent.ps1' to folder 'chocolatey-core.extension\extensions'.
[NuGet] Added file 'Register-Application.ps1' to folder 'chocolatey-core.extension\extensions'.
[NuGet] Added file 'chocolatey-core.extension.nuspec' to folder 'chocolatey-core.extension'.
[NuGet] Added file 'chocolatey-core.extension.nupkg' to folder 'chocolatey-core.extension'.
[NuGet] Successfully installed 'chocolatey-core.extension 1.3.3'.

chocolatey-core.extension v1.3.3
chocolatey-core.extension package files install completed. Performing other installation steps.
Capturing package files in 'C:\ProgramData\chocolatey\lib\chocolatey-core.extension'
 Found 'C:\ProgramData\chocolatey\lib\chocolatey-core.extension\chocolatey-core.extension.nupkg'
  with checksum '10F9271BEADE1B696AE3870C2FACC8ED'
 Found 'C:\ProgramData\chocolatey\lib\chocolatey-core.extension\chocolatey-core.extension.nuspec'
  with checksum 'DF6C67EA1E5F6EE4E17B63508B279D94'
 Found 'C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\chocolatey-core.psm1'
  with checksum '8007E67FDE249548DBF78D1DC8AFDCCC'
 Found 'C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Get-AppInstallLocation.ps1'
  with checksum 'D036C97BC50A3731BF69A15417F60E72'
 Found 'C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Get-AvailableDriveLetter.ps1'
  with checksum '2F386746AFC2ACB9561DFB245239B93F'
 Found 'C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Get-EffectiveProxy.ps1'
  with checksum '3895F062D2D91D9D32D1FC57A619066C'
 Found 'C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Get-PackageCacheLocation.ps1'
  with checksum '77A378E5C659E5A53D2D64E276159B62'
 Found 'C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Get-PackageParameters.ps1'
  with checksum 'C08B3AF8CA150B6609DF2B978B693269'
 Found 'C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Get-UninstallRegistryKey.ps1'
  with checksum '3FAA5C11AAFC4EA35BB98EA797446C97'
 Found 'C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Get-WebContent.ps1'
  with checksum '57D013E581EFEA3D4D8366183C9A5797'
 Found 'C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Register-Application.ps1'
  with checksum 'D2853E569DAC9A341642BA76EC4FB411'
Attempting to create directory "C:\ProgramData\chocolatey\extensions".
Attempting to create directory "C:\ProgramData\chocolatey\extensions\chocolatey-core".
Attempting to copy "C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\chocolatey-core.psm1"
 to "C:\ProgramData\chocolatey\extensions\chocolatey-core\chocolatey-core.psm1".
Attempting to copy "C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Get-AppInstallLocation.ps1"
 to "C:\ProgramData\chocolatey\extensions\chocolatey-core\Get-AppInstallLocation.ps1".
Attempting to copy "C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Get-AvailableDriveLetter.ps1"
 to "C:\ProgramData\chocolatey\extensions\chocolatey-core\Get-AvailableDriveLetter.ps1".
Attempting to copy "C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Get-EffectiveProxy.ps1"
 to "C:\ProgramData\chocolatey\extensions\chocolatey-core\Get-EffectiveProxy.ps1".
Attempting to copy "C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Get-PackageCacheLocation.ps1"
 to "C:\ProgramData\chocolatey\extensions\chocolatey-core\Get-PackageCacheLocation.ps1".
Attempting to copy "C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Get-PackageParameters.ps1"
 to "C:\ProgramData\chocolatey\extensions\chocolatey-core\Get-PackageParameters.ps1".
Attempting to copy "C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Get-UninstallRegistryKey.ps1"
 to "C:\ProgramData\chocolatey\extensions\chocolatey-core\Get-UninstallRegistryKey.ps1".
Attempting to copy "C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Get-WebContent.ps1"
 to "C:\ProgramData\chocolatey\extensions\chocolatey-core\Get-WebContent.ps1".
Attempting to copy "C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Register-Application.ps1"
 to "C:\ProgramData\chocolatey\extensions\chocolatey-core\Register-Application.ps1".
 Installed/updated chocolatey-core extensions.
Attempting to create directory "C:\ProgramData\chocolatey\.chocolatey".
Adding 'Hidden' attribute(s) to 'C:\ProgramData\chocolatey\.chocolatey'.
Attempting to create directory "C:\ProgramData\chocolatey\.chocolatey\chocolatey-core.extension.1.3.3".
There was no original file at 'C:\ProgramData\chocolatey\.chocolatey\chocolatey-core.extension.1.3.3\.files'
Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\chocolatey-core.extension.1.3.3\.extra".
Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\chocolatey-core.extension.1.3.3\.version".
Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\chocolatey-core.extension.1.3.3\.sxs".
Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\chocolatey-core.extension.1.3.3\.pin".
Sending message 'HandlePackageResultCompletedMessage' out if there are subscribers...
Attempting to delete file "C:\ProgramData\chocolatey\lib\chocolatey-core.extension\.chocolateyPending".
 The install of chocolatey-core.extension was successful.
  Software installed to 'C:\ProgramData\chocolatey\extensions\chocolatey-core'
[NuGet] Installing '7zip-german 18.0.5'.
[NuGet] Added file '7zip_x32.exe' to folder '7zip-german\tools'.
[NuGet] Added file '7zip_x64.exe' to folder '7zip-german\tools'.
[NuGet] Added file 'chocolateyInstall.ps1' to folder '7zip-german\tools'.
[NuGet] Added file 'chocolateyUninstall.ps1' to folder '7zip-german\tools'.
[NuGet] Added file '7zip-german.nuspec' to folder '7zip-german'.
[NuGet] Added file '7zip-german.nupkg' to folder '7zip-german'.
[NuGet] Successfully installed '7zip-german 18.0.5'.

7zip-german v18.0.5
7zip-german package files install completed. Performing other installation steps.
Setting installer args for 7zip-german
Setting package parameters for 7zip-german
Contents of 'C:\ProgramData\chocolatey\lib\7zip-german\tools\chocolateyInstall.ps1':
$ErrorActionPreference = 'Stop'

$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$filePath = if ((Get-ProcessorBits 64) -and $env:chocolateyForceX86 -ne $true) {
       Write-Host "Installing 64 bit version" ; gi $toolsDir\*_x64.exe }
else { Write-Host "Installing 32 bit version" ; gi $toolsDir\*_x32.exe }

$packageArgs = @{
  packageName    = '7zip-german'
  fileType       = 'exe'
  softwareName   = '7-zip*'
  file           = ($filePath).FullName
  silentArgs     = '/S'
  validExitCodes = @(0)
}
Install-ChocolateyInstallPackage @packageArgs
rm $toolsDir\*.exe -ea 0 -force

$installLocation = Get-AppInstallLocation $packageArgs.softwareName
if (!$installLocation)  { Write-Warning "Can't find 7zip install location"; return }
Write-Host "7zip installed to '$installLocation'"

Install-BinFile '7z' $installLocation\7z.exe

The package 7zip-german wants to run 'chocolateyInstall.ps1'.
Note: If you don't run this script, the installation will fail.
Note: To confirm automatically next time, use '-y' or consider:
choco feature enable -n allowGlobalConfirmation
Do you want to run the script?([Y]es/[N]o/[P]rint): y

Calling built-in PowerShell host with ['[System.Threading.Thread]::CurrentThread.CurrentCulture = '';[System.Threading.Thread]::CurrentThread.CurrentUICulture = ''; & import-module -name 'C:\ProgramData\chocolatey\helpers\chocolateyInstaller.psm1'; & 'C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1' -packageScript 'C:\ProgramData\chocolatey\lib\7zip-german\tools\chocolateyInstall.ps1' -installArguments '' -packageParameters ''']
Redirecting System.Management.Automation.resources, Version=3.0.0.0, Culture=de-DE, PublicKeyToken=31bf3856ad364e35, requested by ''
Host version is 5.1.14393.0, PowerShell Version is '5.1.14393.2248' and CLR Version is '4.0.30319.42000'.
VERBOSE: Exporting function 'Format-FileSize'.
VERBOSE: Exporting function 'Get-ChecksumValid'.
VERBOSE: Exporting function 'Get-ChocolateyUnzip'.
VERBOSE: Exporting function 'Get-ChocolateyWebFile'.
VERBOSE: Exporting function 'Get-EnvironmentVariable'.
VERBOSE: Exporting function 'Get-EnvironmentVariableNames'.
VERBOSE: Exporting function 'Get-FtpFile'.
VERBOSE: Exporting function 'Get-OSArchitectureWidth'.
VERBOSE: Exporting function 'Get-PackageParameters'.
VERBOSE: Exporting function 'Get-PackageParametersBuiltIn'.
VERBOSE: Exporting function 'Get-ToolsLocation'.
VERBOSE: Exporting function 'Get-UACEnabled'.
VERBOSE: Exporting function 'Get-UninstallRegistryKey'.
VERBOSE: Exporting function 'Get-VirusCheckValid'.
VERBOSE: Exporting function 'Get-WebFile'.
VERBOSE: Exporting function 'Get-WebFileName'.
VERBOSE: Exporting function 'Get-WebHeaders'.
VERBOSE: Exporting function 'Install-BinFile'.
VERBOSE: Exporting function 'Install-ChocolateyDesktopLink'.
VERBOSE: Exporting function 'Install-ChocolateyEnvironmentVariable'.
VERBOSE: Exporting function 'Install-ChocolateyExplorerMenuItem'.
VERBOSE: Exporting function 'Install-ChocolateyFileAssociation'.
VERBOSE: Exporting function 'Install-ChocolateyInstallPackage'.
VERBOSE: Exporting function 'Install-ChocolateyPackage'.
VERBOSE: Exporting function 'Install-ChocolateyPath'.
VERBOSE: Exporting function 'Install-ChocolateyPinnedTaskBarItem'.
VERBOSE: Exporting function 'Install-ChocolateyPowershellCommand'.
VERBOSE: Exporting function 'Install-ChocolateyShortcut'.
VERBOSE: Exporting function 'Install-ChocolateyVsixPackage'.
VERBOSE: Exporting function 'Install-ChocolateyZipPackage'.
VERBOSE: Exporting function 'Install-Vsix'.
VERBOSE: Exporting function 'Set-EnvironmentVariable'.
VERBOSE: Exporting function 'Set-PowerShellExitCode'.
VERBOSE: Exporting function 'Start-ChocolateyProcessAsAdmin'.
VERBOSE: Exporting function 'Test-ProcessAdminRights'.
VERBOSE: Exporting function 'Uninstall-BinFile'.
VERBOSE: Exporting function 'Uninstall-ChocolateyEnvironmentVariable'.
VERBOSE: Exporting function 'Uninstall-ChocolateyPackage'.
VERBOSE: Exporting function 'Uninstall-ChocolateyZipPackage'.
VERBOSE: Exporting function 'Update-SessionEnvironment'.
VERBOSE: Exporting function 'Write-ChocolateyFailure'.
VERBOSE: Exporting function 'Write-ChocolateySuccess'.
VERBOSE: Exporting function 'Write-FileUpdateLog'.
VERBOSE: Exporting function 'Write-FunctionCallLogMessage'.
VERBOSE: Exporting alias 'Get-ProcessorBits'.
VERBOSE: Exporting alias 'Get-OSBitness'.
VERBOSE: Exporting alias 'Get-InstallRegistryKey'.
VERBOSE: Exporting alias 'Generate-BinFile'.
VERBOSE: Exporting alias 'Add-BinFile'.
VERBOSE: Exporting alias 'Start-ChocolateyProcess'.
VERBOSE: Exporting alias 'Invoke-ChocolateyProcess'.
VERBOSE: Exporting alias 'Remove-BinFile'.
VERBOSE: Exporting alias 'refreshenv'.
Loading community extensions
Importing 'C:\ProgramData\chocolatey\extensions\chocolatey-core\chocolatey-core.psm1'
VERBOSE: Loading module from path 'C:\ProgramData\chocolatey\extensions\chocolatey-core\chocolatey-core.psm1'.
VERBOSE: Exporting function 'Get-UninstallRegistryKey'.
VERBOSE: Exporting function 'Get-AppInstallLocation'.
VERBOSE: Exporting function 'Get-AvailableDriveLetter'.
VERBOSE: Exporting function 'Get-EffectiveProxy'.
VERBOSE: Exporting function 'Get-PackageCacheLocation'.
VERBOSE: Exporting function 'Get-PackageParameters'.
VERBOSE: Exporting function 'Get-WebContent'.
VERBOSE: Exporting function 'Register-Application'.
VERBOSE: Importing function 'Get-AppInstallLocation'.
VERBOSE: Importing function 'Get-AvailableDriveLetter'.
VERBOSE: Importing function 'Get-EffectiveProxy'.
VERBOSE: Importing function 'Get-PackageCacheLocation'.
VERBOSE: Importing function 'Get-PackageParameters'.
VERBOSE: Importing function 'Get-UninstallRegistryKey'.
VERBOSE: Importing function 'Get-WebContent'.
VERBOSE: Importing function 'Register-Application'.
VERBOSE: Exporting function 'Format-FileSize'.
VERBOSE: Exporting function 'Get-ChecksumValid'.
VERBOSE: Exporting function 'Get-ChocolateyUnzip'.
VERBOSE: Exporting function 'Get-ChocolateyWebFile'.
VERBOSE: Exporting function 'Get-EnvironmentVariable'.
VERBOSE: Exporting function 'Get-EnvironmentVariableNames'.
VERBOSE: Exporting function 'Get-FtpFile'.
VERBOSE: Exporting function 'Get-OSArchitectureWidth'.
VERBOSE: Exporting function 'Get-PackageParameters'.
VERBOSE: Exporting function 'Get-PackageParametersBuiltIn'.
VERBOSE: Exporting function 'Get-ToolsLocation'.
VERBOSE: Exporting function 'Get-UACEnabled'.
VERBOSE: Exporting function 'Get-UninstallRegistryKey'.
VERBOSE: Exporting function 'Get-VirusCheckValid'.
VERBOSE: Exporting function 'Get-WebFile'.
VERBOSE: Exporting function 'Get-WebFileName'.
VERBOSE: Exporting function 'Get-WebHeaders'.
VERBOSE: Exporting function 'Install-BinFile'.
VERBOSE: Exporting function 'Install-ChocolateyDesktopLink'.
VERBOSE: Exporting function 'Install-ChocolateyEnvironmentVariable'.
VERBOSE: Exporting function 'Install-ChocolateyExplorerMenuItem'.
VERBOSE: Exporting function 'Install-ChocolateyFileAssociation'.
VERBOSE: Exporting function 'Install-ChocolateyInstallPackage'.
VERBOSE: Exporting function 'Install-ChocolateyPackage'.
VERBOSE: Exporting function 'Install-ChocolateyPath'.
VERBOSE: Exporting function 'Install-ChocolateyPinnedTaskBarItem'.
VERBOSE: Exporting function 'Install-ChocolateyPowershellCommand'.
VERBOSE: Exporting function 'Install-ChocolateyShortcut'.
VERBOSE: Exporting function 'Install-ChocolateyVsixPackage'.
VERBOSE: Exporting function 'Install-ChocolateyZipPackage'.
VERBOSE: Exporting function 'Install-Vsix'.
VERBOSE: Exporting function 'Set-EnvironmentVariable'.
VERBOSE: Exporting function 'Set-PowerShellExitCode'.
VERBOSE: Exporting function 'Start-ChocolateyProcessAsAdmin'.
VERBOSE: Exporting function 'Test-ProcessAdminRights'.
VERBOSE: Exporting function 'Uninstall-BinFile'.
VERBOSE: Exporting function 'Uninstall-ChocolateyEnvironmentVariable'.
VERBOSE: Exporting function 'Uninstall-ChocolateyPackage'.
VERBOSE: Exporting function 'Uninstall-ChocolateyZipPackage'.
VERBOSE: Exporting function 'Update-SessionEnvironment'.
VERBOSE: Exporting function 'Write-ChocolateyFailure'.
VERBOSE: Exporting function 'Write-ChocolateySuccess'.
VERBOSE: Exporting function 'Write-FileUpdateLog'.
VERBOSE: Exporting function 'Write-FunctionCallLogMessage'.
VERBOSE: Exporting function 'Get-AppInstallLocation'.
VERBOSE: Exporting function 'Get-AvailableDriveLetter'.
VERBOSE: Exporting function 'Get-EffectiveProxy'.
VERBOSE: Exporting function 'Get-PackageCacheLocation'.
VERBOSE: Exporting function 'Get-WebContent'.
VERBOSE: Exporting function 'Register-Application'.
VERBOSE: Exporting alias 'Get-ProcessorBits'.
VERBOSE: Exporting alias 'Get-OSBitness'.
VERBOSE: Exporting alias 'Get-InstallRegistryKey'.
VERBOSE: Exporting alias 'Generate-BinFile'.
VERBOSE: Exporting alias 'Add-BinFile'.
VERBOSE: Exporting alias 'Start-ChocolateyProcess'.
VERBOSE: Exporting alias 'Invoke-ChocolateyProcess'.
VERBOSE: Exporting alias 'Remove-BinFile'.
VERBOSE: Exporting alias 'refreshenv'.
VERBOSE: Importing function 'Format-FileSize'.
VERBOSE: Importing function 'Get-AppInstallLocation'.
VERBOSE: Importing function 'Get-AvailableDriveLetter'.
VERBOSE: Importing function 'Get-ChecksumValid'.
VERBOSE: Importing function 'Get-ChocolateyUnzip'.
VERBOSE: Importing function 'Get-ChocolateyWebFile'.
VERBOSE: Importing function 'Get-EffectiveProxy'.
VERBOSE: Importing function 'Get-EnvironmentVariable'.
VERBOSE: Importing function 'Get-EnvironmentVariableNames'.
VERBOSE: Importing function 'Get-FtpFile'.
VERBOSE: Importing function 'Get-OSArchitectureWidth'.
VERBOSE: Importing function 'Get-PackageCacheLocation'.
VERBOSE: Importing function 'Get-PackageParameters'.
VERBOSE: Importing function 'Get-PackageParametersBuiltIn'.
VERBOSE: Importing function 'Get-ToolsLocation'.
VERBOSE: Importing function 'Get-UACEnabled'.
VERBOSE: Importing function 'Get-UninstallRegistryKey'.
VERBOSE: Importing function 'Get-VirusCheckValid'.
VERBOSE: Importing function 'Get-WebContent'.
VERBOSE: Importing function 'Get-WebFile'.
VERBOSE: Importing function 'Get-WebFileName'.
VERBOSE: Importing function 'Get-WebHeaders'.
VERBOSE: Importing function 'Install-BinFile'.
VERBOSE: Importing function 'Install-ChocolateyDesktopLink'.
VERBOSE: Importing function 'Install-ChocolateyEnvironmentVariable'.
VERBOSE: Importing function 'Install-ChocolateyExplorerMenuItem'.
VERBOSE: Importing function 'Install-ChocolateyFileAssociation'.
VERBOSE: Importing function 'Install-ChocolateyInstallPackage'.
VERBOSE: Importing function 'Install-ChocolateyPackage'.
VERBOSE: Importing function 'Install-ChocolateyPath'.
VERBOSE: Importing function 'Install-ChocolateyPinnedTaskBarItem'.
VERBOSE: Importing function 'Install-ChocolateyPowershellCommand'.
VERBOSE: Importing function 'Install-ChocolateyShortcut'.
VERBOSE: Importing function 'Install-ChocolateyVsixPackage'.
VERBOSE: Importing function 'Install-ChocolateyZipPackage'.
VERBOSE: Importing function 'Install-Vsix'.
VERBOSE: Importing function 'Register-Application'.
VERBOSE: Importing function 'Set-EnvironmentVariable'.
VERBOSE: Importing function 'Set-PowerShellExitCode'.
VERBOSE: Importing function 'Start-ChocolateyProcessAsAdmin'.
VERBOSE: Importing function 'Test-ProcessAdminRights'.
VERBOSE: Importing function 'Uninstall-BinFile'.
VERBOSE: Importing function 'Uninstall-ChocolateyEnvironmentVariable'.
VERBOSE: Importing function 'Uninstall-ChocolateyPackage'.
VERBOSE: Importing function 'Uninstall-ChocolateyZipPackage'.
VERBOSE: Importing function 'Update-SessionEnvironment'.
VERBOSE: Importing function 'Write-ChocolateyFailure'.
VERBOSE: Importing function 'Write-ChocolateySuccess'.
VERBOSE: Importing function 'Write-FileUpdateLog'.
VERBOSE: Importing function 'Write-FunctionCallLogMessage'.
VERBOSE: Importing alias 'Add-BinFile'.
VERBOSE: Importing alias 'Generate-BinFile'.
VERBOSE: Importing alias 'Get-InstallRegistryKey'.
VERBOSE: Importing alias 'Get-OSBitness'.
VERBOSE: Importing alias 'Get-ProcessorBits'.
VERBOSE: Importing alias 'Invoke-ChocolateyProcess'.
VERBOSE: Importing alias 'refreshenv'.
VERBOSE: Importing alias 'Remove-BinFile'.
VERBOSE: Importing alias 'Start-ChocolateyProcess'.
Running 'ChocolateyScriptRunner' for 7zip-german v18.0.5 with packageScript 'C:\ProgramData\chocolatey\lib\7zip-german\tools\chocolateyInstall.ps1', packageFolder:'C:\ProgramData\chocolatey\lib\7zip-german', installArguments: '', packageParameters: '',
Running 'C:\ProgramData\chocolatey\lib\7zip-german\tools\chocolateyInstall.ps1'
Running Get-ProcessorBits -compare '64'
Installing 64 bit version
Running Install-ChocolateyInstallPackage -silentArgs '/S' -file 'C:\ProgramData\chocolatey\lib\7zip-german\tools\7zip_x64.exe' -fileType 'exe' -validExitCodes '0' -packageName '7zip-german'
Running Get-ProcessorBits -compare '32'
Installing 7zip-german...
Running Start-ChocolateyProcessAsAdmin -validExitCodes '0' -workingDirectory 'C:\ProgramData\chocolatey\lib\7zip-german\tools' -statements '/S ' -exeToRun 'C:\ProgramData\chocolatey\lib\7zip-german\tools\7zip_x64.exe'
Test-ProcessAdminRights: returning True
Elevating permissions and running ["C:\ProgramData\chocolatey\lib\7zip-german\tools\7zip_x64.exe" /S ]. This may take awhile, depending on the statements.
Command ["C:\ProgramData\chocolatey\lib\7zip-german\tools\7zip_x64.exe" /S ] exited with '0'.
Finishing 'Start-ChocolateyProcessAsAdmin'
7zip-german has been installed.
VERBOSE: Trying local and machine (x32 & x64) Uninstall keys
Running 'Get-UninstallRegistryKey' for '7zip-german' with SoftwareName:'7-zip*'
VERBOSE: Retrieving all uninstall registry keys
Registry uninstall keys on system: 27
Error handling check: 'Get-ItemProperty' fails if a registry key is encoded incorrectly.
Found 1 uninstall registry key(s) with SoftwareName:'7-zip*'
VERBOSE: Trying Uninstall key property 'InstallLocation'
7zip installed to 'C:\Program Files\7-Zip'
Running Install-BinFile -name '7z' -path 'C:\Program Files\7-Zip\7z.exe'
ShimGen found at 'C:\ProgramData\chocolatey\tools\shimgen.exe'
Calling C:\ProgramData\chocolatey\tools\shimgen.exe -o "C:\ProgramData\chocolatey\bin\7z.exe" -p "c:\program files\7-zip\7z.exe" -i "C:\Program Files\7-Zip\7z.exe"
Added C:\ProgramData\chocolatey\bin\7z.exe shim pointed to 'c:\program files\7-zip\7z.exe'.
Built-in PowerShell host called with ['[System.Threading.Thread]::CurrentThread.CurrentCulture = '';[System.Threading.Thread]::CurrentThread.CurrentUICulture = ''; & import-module -name 'C:\ProgramData\chocolatey\helpers\chocolateyInstaller.psm1'; & 'C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1' -packageScript 'C:\ProgramData\chocolatey\lib\7zip-german\tools\chocolateyInstall.ps1' -installArguments '' -packageParameters '''] exited with '0'.
Calling command ['"C:\Windows\System32\shutdown.exe" /a']
Command ['"C:\Windows\System32\shutdown.exe" /a'] exited with '1116'
  7zip-german may be able to be automatically uninstalled.
Capturing package files in 'C:\ProgramData\chocolatey\lib\7zip-german'
 Found 'C:\ProgramData\chocolatey\lib\7zip-german\7zip-german.nupkg'
  with checksum 'F92F364499C1E429CF84BC9B0AC98F3F'
 Found 'C:\ProgramData\chocolatey\lib\7zip-german\7zip-german.nuspec'
  with checksum 'EA7105654A4EE5A4E7266B2CDEE71E17'
 Found 'C:\ProgramData\chocolatey\lib\7zip-german\tools\7zip_x64.exe.ignore'
  with checksum 'BEA07E6D2B8DCE396FE21BAA61B34956'
 Found 'C:\ProgramData\chocolatey\lib\7zip-german\tools\chocolateyInstall.ps1'
  with checksum '0A3C59DB9C8CDDC7799650681C39620D'
 Found 'C:\ProgramData\chocolatey\lib\7zip-german\tools\chocolateyUninstall.ps1'
  with checksum '3E981BE0C9F6847AC8F53D8C35962A50'
Attempting to create directory "C:\ProgramData\chocolatey\.chocolatey\7zip-german.18.0.5".
There was no original file at 'C:\ProgramData\chocolatey\.chocolatey\7zip-german.18.0.5\.registry'
There was no original file at 'C:\ProgramData\chocolatey\.chocolatey\7zip-german.18.0.5\.files'
Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\7zip-german.18.0.5\.extra".
Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\7zip-german.18.0.5\.version".
Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\7zip-german.18.0.5\.sxs".
Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\7zip-german.18.0.5\.pin".
Sending message 'HandlePackageResultCompletedMessage' out if there are subscribers...
Attempting to delete file "C:\ProgramData\chocolatey\lib\7zip-german\.chocolateyPending".
 The install of 7zip-german was successful.
  Software installed to 'C:\Program Files\7-Zip\'
Attempting to delete file "C:\Users\Administrator\AppData\Local\NuGet\Cache\7zip-german.18.0.5.nupkg".

Chocolatey installed 2/2 packages.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
Sending message 'PostRunMessage' out if there are subscribers...
Exiting with 0

@bcurran3
Copy link

Check the CacheLocation for downloaded installers. They're probably there.

REF: info at #1592

@bcurran3
Copy link

bcurran3 commented Sep 3, 2018

p.s.

You really should consider using my choco-cleaner:
https://chocolatey.org/packages/choco-cleaner and depending on how often you do updates, edit the task to be more frequent.

You really should try setting cacheLocation to a shared drive for your setup.

If you're not running a licensed version of Chocolatey with internalized packages take a look at this:
https://groups.google.com/forum/#!searchin/chocolatey/cacheLocation%7Csort:date/chocolatey/zUpGgRgwRdo/aGTz5hwUCgAJ

@buenyX
Copy link
Author

buenyX commented Sep 6, 2018

Can't use your choco-cleaner because the profile size of 1 GB is too small for packages with e.g. 4 GB.

We need a way to define the download location (or download location should be cacheLocation).

@bcurran3
Copy link

bcurran3 commented Sep 6, 2018

I'm not following you. The choco-cleaner package is 16 KB.

@bcurran3
Copy link

bcurran3 commented Sep 6, 2018

...and I think you're bumping up against a NuGet problem, not a Chocolatey problem; i.e. Chocolatey is built on top of NuGet. So NuGet puts the packges in a particular place and Chocolatey extracts them in another. choco-cleaner cleans up both locations.

@buenyX
Copy link
Author

buenyX commented Sep 6, 2018

Let me try again:
Your maximum profile size is 1 GB (it can be 1 GB; not more, defined via group policies).
You try to install a package that has a size of 2 GB. It exceeds the profile size, so choco can't download it and does nothing.

Didn't know that it's caused by NuGet, so thanks for the info.

@bcurran3
Copy link

bcurran3 commented Sep 6, 2018

OK. I missed it was the problem of a SINGLE package size being to big. Gotcha now.

Just found this, I have not tried it. Maybe you can experiment and report back:

https://stackoverflow.com/questions/47860222/change-nuget-package-location-folder

To change the nuget packager folder, you can you can set "NUGET_PACKAGES" environment variable. Just Set "NUGET_PACKAGES" = "c:\teampackages". Or you can place a NuGet.Config file next to the solution with the following content:

@bcurran3
Copy link

@buenyamin, any luck?

@buenyX
Copy link
Author

buenyX commented Sep 22, 2018

@buenyamin, any luck?

Couldn't try it yet, will do and post results here.

@ferventcoder
Copy link
Member

@buenyamin I don't see a repo from the logs, just that Chocolatey thought to go look in C:\Users\Administrator\AppData\Local\NuGet\Cache at the end of the logs. Are you actually seeing packages placed here? It does appear there may be a bug somewhere that CacheLocation is being forgotten in that it is looking there instead.

@ferventcoder
Copy link
Member

I am basing this on inspecting the logs you put here - Attempting to delete file "C:\Users\Administrator\AppData\Local\NuGet\Cache\7zip-german.18.0.5.nupkg". is at the end.

@ferventcoder
Copy link
Member

I'm also going to note this is output from the command line - I'm looking for the log file where more information tends to end up that is only logged there.

@teknowledgist
Copy link

teknowledgist commented May 1, 2020

I believe I am encountering the same bug. I'm trying to set a cache location for a single package, but while the --cache-location parameter is recognized, the specified location isn't used.

Chocolatey.log

In this case, the package is being installed by SYSTEM, so the profile location is not a normal user. Nevertheless, while the --cache-location is requested as "C:\Windows\Temp", the path actually used is "C:\WINDOWS\system32\config\systemprofile\AppData\Local\Temp".

@corbob
Copy link
Member

corbob commented Oct 17, 2024

It looks like this issue was resolved with the uplift in Chocolatey 2.0.0 (or possibly a subsequent release). I can confirm that I see this behaviour in 1.4.0, but not in 2.3.0. Based on that, I will close this issue. If it's still an issue that can be reproduced on the latest Chocolatey CLI (2.3.0 as of today), then we can reopen it and update the reproduction steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants