chocolatey / choco

Chocolatey - the package manager for Windows
https://chocolatey.org
Other
10.32k stars 904 forks source link

Chocolatey forgets packages where CTRL+C was pressed during upgrade #1548

Closed dinfinity closed 2 months ago

dinfinity commented 6 years ago

What You Are Seeing?

Because #1443 is still not fixed, I sometimes need to CTRL+C during choco upgrade all, because chocolatey wants to install a package into the wrong directory. I just noticed that after I do that, Chocolatey forgets that I had the package installed.

What is Expected?

That after aborting an upgrade of a package, the next run of choco upgrade tries to upgrade it again instead of forgetting about the package.

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

See #1443 and above.

Output Log

Ruby upgrade aborted with CTRL+C to prevent installation to C:\Frameworks\PHP:

2018-04-22 13:57:25,178 11748 [WARN ] - 
You have ruby v2.5.0.2 installed. Version 2.5.1.1 is available based on your source(s).
2018-04-22 13:57:25,182 11748 [DEBUG] - ruby - Adding remembered arguments for upgrade:  --install-arguments="'INSTALLDIR=C:\Frameworks\NodeJS'" --package-parameters="'/ThreadSafe /InstallDir:C:\Frameworks\PHP'" --allow-downgrade --cache-location="'C:\Users\Dual Infinity\AppData\Local\Temp\chocolatey'"
2018-04-22 13:57:25,186 11748 [DEBUG] - Backing up existing ruby prior to operation.
2018-04-22 13:57:25,187 11748 [DEBUG] - Moving 'C:\ProgramData\chocolatey\lib\ruby'
 to 'C:\ProgramData\chocolatey\lib-bkp\ruby'
2018-04-22 13:57:27,188 11748 [DEBUG] - Attempting to create directory "C:\ProgramData\chocolatey\lib\ruby".
2018-04-22 13:57:27,189 11748 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\ruby\ruby.nupkg"
 to "C:\ProgramData\chocolatey\lib\ruby\ruby.nupkg".
2018-04-22 13:57:27,220 11748 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\ruby\ruby.nuspec"
 to "C:\ProgramData\chocolatey\lib\ruby\ruby.nuspec".
2018-04-22 13:57:27,221 11748 [DEBUG] - Attempting to create directory "C:\ProgramData\chocolatey\lib\ruby\legal".
2018-04-22 13:57:27,222 11748 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\ruby\legal\LICENSE.txt"
 to "C:\ProgramData\chocolatey\lib\ruby\legal\LICENSE.txt".
2018-04-22 13:57:27,223 11748 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\ruby\legal\VERIFICATION.txt"
 to "C:\ProgramData\chocolatey\lib\ruby\legal\VERIFICATION.txt".
2018-04-22 13:57:27,225 11748 [DEBUG] - Attempting to create directory "C:\ProgramData\chocolatey\lib\ruby\tools".
2018-04-22 13:57:27,226 11748 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\ruby\tools\chocolateyInstall.ps1"
 to "C:\ProgramData\chocolatey\lib\ruby\tools\chocolateyInstall.ps1".
2018-04-22 13:57:27,227 11748 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\ruby\tools\rubyinstaller-2.5.0-2-x64_x64.exe"
 to "C:\ProgramData\chocolatey\lib\ruby\tools\rubyinstaller-2.5.0-2-x64_x64.exe".
2018-04-22 13:57:27,245 11748 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\ruby\tools\rubyinstaller-2.5.0-2-x64_x64.exe.ignore"
 to "C:\ProgramData\chocolatey\lib\ruby\tools\rubyinstaller-2.5.0-2-x64_x64.exe.ignore".
2018-04-22 13:57:27,246 11748 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\ruby\tools\rubyinstaller-2.5.0-2-x86_x32.exe"
 to "C:\ProgramData\chocolatey\lib\ruby\tools\rubyinstaller-2.5.0-2-x86_x32.exe".
2018-04-22 13:57:28,763 11748 [DEBUG] - Capturing package files in 'C:\ProgramData\chocolatey\lib\ruby'
2018-04-22 13:57:28,811 11748 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ruby\ruby.nupkg'
  with checksum 'C1361FADEC8F1AF64EBF2CB5F5965EEB'
2018-04-22 13:57:28,812 11748 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ruby\ruby.nuspec'
  with checksum '31E4C238B4F760C52DA9EBA9271510B9'
2018-04-22 13:57:28,812 11748 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ruby\legal\LICENSE.txt'
  with checksum 'DAFD6B74A417987376F810C3AA5C69C3'
2018-04-22 13:57:28,813 11748 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ruby\legal\VERIFICATION.txt'
  with checksum '28D30B3FE30831883DDAE0B4FE297D86'
2018-04-22 13:57:28,813 11748 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ruby\tools\chocolateyInstall.ps1'
  with checksum '9A4D4D85B4E9CA4AA305B961E4550F3A'
2018-04-22 13:57:28,836 11748 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ruby\tools\rubyinstaller-2.5.0-2-x64_x64.exe'
  with checksum '91264364EC0343F4F5F16C5ABD3E153B'
2018-04-22 13:57:28,837 11748 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ruby\tools\rubyinstaller-2.5.0-2-x64_x64.exe.ignore'
  with checksum 'BEA07E6D2B8DCE396FE21BAA61B34956'
2018-04-22 13:57:28,861 11748 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ruby\tools\rubyinstaller-2.5.0-2-x86_x32.exe'
  with checksum '6D23BF1C05E572B1333627F7451ED9D0'
2018-04-22 13:57:28,862 11748 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\lib\ruby\tools\rubyinstaller-2.5.0-2-x64_x64.exe.ignore".
2018-04-22 13:57:29,471 11748 [INFO ] - [NuGet] Attempting to resolve dependency 'chocolatey-core.extension (= 1.3.3)'.
2018-04-22 13:57:42,443 11748 [INFO ] - [NuGet] Attempting to resolve dependency 'chocolatey (= 0.10.5)'.
2018-04-22 13:57:42,492 11748 [INFO ] - [NuGet] Uninstalling 'ruby 2.5.0.2'.
2018-04-22 13:57:42,496 11748 [DEBUG] - [NuGet] Removed file 'LICENSE.txt' to folder 'C:\ProgramData\chocolatey\lib\ruby\legal'.
2018-04-22 13:57:42,497 11748 [DEBUG] - [NuGet] Removed file 'VERIFICATION.txt' to folder 'C:\ProgramData\chocolatey\lib\ruby\legal'.
2018-04-22 13:57:42,497 11748 [DEBUG] - [NuGet] Removed folder 'C:\ProgramData\chocolatey\lib\ruby\legal'.
2018-04-22 13:57:42,498 11748 [DEBUG] - [NuGet] Removed file 'chocolateyInstall.ps1' to folder 'C:\ProgramData\chocolatey\lib\ruby\tools'.
2018-04-22 13:57:42,524 11748 [DEBUG] - [NuGet] Removed file 'rubyinstaller-2.5.0-2-x64_x64.exe' to folder 'C:\ProgramData\chocolatey\lib\ruby\tools'.
2018-04-22 13:57:42,548 11748 [DEBUG] - [NuGet] Removed file 'rubyinstaller-2.5.0-2-x86_x32.exe' to folder 'C:\ProgramData\chocolatey\lib\ruby\tools'.
2018-04-22 13:57:42,549 11748 [DEBUG] - [NuGet] Removed folder 'C:\ProgramData\chocolatey\lib\ruby\tools'.
2018-04-22 13:57:42,549 11748 [DEBUG] - [NuGet] Removed file 'ruby.nuspec' to folder 'C:\ProgramData\chocolatey\lib\ruby'.
2018-04-22 13:57:42,551 11748 [DEBUG] - [NuGet] Removed file 'ruby.nupkg' to folder 'C:\ProgramData\chocolatey\lib\ruby'.
2018-04-22 13:57:42,551 11748 [DEBUG] - [NuGet] Removed folder 'C:\ProgramData\chocolatey\lib\ruby'.
2018-04-22 13:57:42,552 11748 [INFO ] - [NuGet] Successfully uninstalled 'ruby 2.5.0.2'.
2018-04-22 13:57:42,567 11748 [INFO ] - [NuGet] Installing 'ruby 2.5.1.1'.
2018-04-22 13:57:42,568 11748 [DEBUG] - [NuGet] Added file 'LICENSE.txt' to folder 'ruby\legal'.
2018-04-22 13:57:42,569 11748 [DEBUG] - [NuGet] Added file 'VERIFICATION.txt' to folder 'ruby\legal'.
2018-04-22 13:57:42,569 11748 [DEBUG] - [NuGet] Added file 'chocolateyInstall.ps1' to folder 'ruby\tools'.
2018-04-22 13:57:42,664 11748 [DEBUG] - [NuGet] Added file 'rubyinstaller-devkit-2.5.1-1-x64_x64.exe' to folder 'ruby\tools'.
2018-04-22 13:57:42,756 11748 [DEBUG] - [NuGet] Added file 'rubyinstaller-devkit-2.5.1-1-x86_x32.exe' to folder 'ruby\tools'.
2018-04-22 13:57:42,758 11748 [DEBUG] - [NuGet] Added file 'ruby.nuspec' to folder 'ruby'.
2018-04-22 13:57:42,922 11748 [DEBUG] - [NuGet] Added file 'ruby.nupkg' to folder 'ruby'.
2018-04-22 13:57:42,923 11748 [INFO ] - [NuGet] Successfully installed 'ruby 2.5.1.1'.
2018-04-22 13:57:42,923 11748 [INFO ] - 
ruby v2.5.1.1 [Approved]
2018-04-22 13:57:42,926 11748 [INFO ] - ruby package files upgrade completed. Performing other installation steps.
2018-04-22 13:57:42,951 11748 [DEBUG] - Setting installer args for ruby
2018-04-22 13:57:42,951 11748 [DEBUG] - Setting package parameters for ruby
2018-04-22 13:57:42,952 11748 [DEBUG] - Contents of 'C:\ProgramData\chocolatey\lib\ruby\tools\chocolateyInstall.ps1':
2018-04-22 13:57:42,952 11748 [DEBUG] - $ErrorActionPreference = 'Stop'

$toolsDir = Split-Path $MyInvocation.MyCommand.Definition
$rubyDir =  'ruby' + ($Env:ChocolateyPackageVersion -replace '\.').Substring(0,2)

$pp = Get-PackageParameters
$installDir = if ($pp.InstallDir) { $pp.InstallDir } else { Join-Path (Get-ToolsLocation) $rubyDir }

$tasks = 'assocfiles', 'noridkinstall'
if ( !$pp.NoPath ) { $tasks += 'modpath'  }

Write-Host "Ruby is going to be installed in '$installDir'"

$packageArgs = @{
  packageName    = 'ruby'
  fileType       = 'exe'
  file           = Get-Item "$toolsDir\*_x32.exe"
  file64         = Get-Item "$toolsDir\*_x64.exe"
  silentArgs     = '/verysilent /dir="{0}" /tasks="{1}"' -f $installDir, ($tasks -join ',')
  validExitCodes = @(0)
  softwareName   = 'ruby *'
}
Install-ChocolateyInstallPackage @packageArgs
Get-ChildItem $toolsPath\*.exe | ForEach-Object { Remove-Item $_ -ea 0; if (Test-Path $_) { Set-Content "$_.ignore" }

2018-04-22 13:57:42,953 11748 [DEBUG] - 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\ruby\tools\chocolateyInstall.ps1' -installArguments 'INSTALLDIR=C:\Frameworks\NodeJS' -packageParameters '/ThreadSafe /InstallDir:C:\Frameworks\PHP'']
2018-04-22 13:57:42,962 11748 [DEBUG] - Redirecting Microsoft.WSMan.Management.resources, Version=3.0.0.0, Culture=en-US, PublicKeyToken=31bf3856ad364e35, requested by ''
2018-04-22 13:57:42,983 11748 [DEBUG] - Host version is 5.1.16299.15, PowerShell Version is '5.1.16299.251' and CLR Version is '4.0.30319.42000'.
2018-04-22 13:57:43,019 11748 [INFO ] - VERBOSE: Exporting function 'Format-FileSize'.
2018-04-22 13:57:43,019 11748 [INFO ] - VERBOSE: Exporting function 'Get-ChecksumValid'.
2018-04-22 13:57:43,020 11748 [INFO ] - VERBOSE: Exporting function 'Get-ChocolateyUnzip'.
2018-04-22 13:57:43,021 11748 [INFO ] - VERBOSE: Exporting function 'Get-ChocolateyWebFile'.
2018-04-22 13:57:43,021 11748 [INFO ] - VERBOSE: Exporting function 'Get-EnvironmentVariable'.
2018-04-22 13:57:43,021 11748 [INFO ] - VERBOSE: Exporting function 'Get-EnvironmentVariableNames'.
2018-04-22 13:57:43,022 11748 [INFO ] - VERBOSE: Exporting function 'Get-FtpFile'.
2018-04-22 13:57:43,022 11748 [INFO ] - VERBOSE: Exporting function 'Get-OSArchitectureWidth'.
2018-04-22 13:57:43,023 11748 [INFO ] - VERBOSE: Exporting function 'Get-PackageParameters'.
2018-04-22 13:57:43,023 11748 [INFO ] - VERBOSE: Exporting function 'Get-PackageParametersBuiltIn'.
2018-04-22 13:57:43,023 11748 [INFO ] - VERBOSE: Exporting function 'Get-ToolsLocation'.
2018-04-22 13:57:43,024 11748 [INFO ] - VERBOSE: Exporting function 'Get-UACEnabled'.
2018-04-22 13:57:43,025 11748 [INFO ] - VERBOSE: Exporting function 'Get-UninstallRegistryKey'.
2018-04-22 13:57:43,025 11748 [INFO ] - VERBOSE: Exporting function 'Get-VirusCheckValid'.
2018-04-22 13:57:43,025 11748 [INFO ] - VERBOSE: Exporting function 'Get-WebFile'.
2018-04-22 13:57:43,026 11748 [INFO ] - VERBOSE: Exporting function 'Get-WebFileName'.
2018-04-22 13:57:43,026 11748 [INFO ] - VERBOSE: Exporting function 'Get-WebHeaders'.
2018-04-22 13:57:43,027 11748 [INFO ] - VERBOSE: Exporting function 'Install-BinFile'.
2018-04-22 13:57:43,027 11748 [INFO ] - VERBOSE: Exporting function 'Install-ChocolateyDesktopLink'.
2018-04-22 13:57:43,027 11748 [INFO ] - VERBOSE: Exporting function 'Install-ChocolateyEnvironmentVariable'.
2018-04-22 13:57:43,028 11748 [INFO ] - VERBOSE: Exporting function 'Install-ChocolateyExplorerMenuItem'.
2018-04-22 13:57:43,028 11748 [INFO ] - VERBOSE: Exporting function 'Install-ChocolateyFileAssociation'.
2018-04-22 13:57:43,029 11748 [INFO ] - VERBOSE: Exporting function 'Install-ChocolateyInstallPackage'.
2018-04-22 13:57:43,029 11748 [INFO ] - VERBOSE: Exporting function 'Install-ChocolateyPackage'.
2018-04-22 13:57:43,029 11748 [INFO ] - VERBOSE: Exporting function 'Install-ChocolateyPath'.
2018-04-22 13:57:43,030 11748 [INFO ] - VERBOSE: Exporting function 'Install-ChocolateyPinnedTaskBarItem'.
2018-04-22 13:57:43,030 11748 [INFO ] - VERBOSE: Exporting function 'Install-ChocolateyPowershellCommand'.
2018-04-22 13:57:43,031 11748 [INFO ] - VERBOSE: Exporting function 'Install-ChocolateyShortcut'.
2018-04-22 13:57:43,031 11748 [INFO ] - VERBOSE: Exporting function 'Install-ChocolateyVsixPackage'.
2018-04-22 13:57:43,031 11748 [INFO ] - VERBOSE: Exporting function 'Install-ChocolateyZipPackage'.
2018-04-22 13:57:43,032 11748 [INFO ] - VERBOSE: Exporting function 'Install-Vsix'.
2018-04-22 13:57:43,032 11748 [INFO ] - VERBOSE: Exporting function 'Set-EnvironmentVariable'.
2018-04-22 13:57:43,033 11748 [INFO ] - VERBOSE: Exporting function 'Set-PowerShellExitCode'.
2018-04-22 13:57:43,033 11748 [INFO ] - VERBOSE: Exporting function 'Start-ChocolateyProcessAsAdmin'.
2018-04-22 13:57:43,033 11748 [INFO ] - VERBOSE: Exporting function 'Test-ProcessAdminRights'.
2018-04-22 13:57:43,034 11748 [INFO ] - VERBOSE: Exporting function 'Uninstall-BinFile'.
2018-04-22 13:57:43,034 11748 [INFO ] - VERBOSE: Exporting function 'Uninstall-ChocolateyEnvironmentVariable'.
2018-04-22 13:57:43,035 11748 [INFO ] - VERBOSE: Exporting function 'Uninstall-ChocolateyPackage'.
2018-04-22 13:57:43,035 11748 [INFO ] - VERBOSE: Exporting function 'Uninstall-ChocolateyZipPackage'.
2018-04-22 13:57:43,035 11748 [INFO ] - VERBOSE: Exporting function 'Update-SessionEnvironment'.
2018-04-22 13:57:43,036 11748 [INFO ] - VERBOSE: Exporting function 'Write-ChocolateyFailure'.
2018-04-22 13:57:43,036 11748 [INFO ] - VERBOSE: Exporting function 'Write-ChocolateySuccess'.
2018-04-22 13:57:43,037 11748 [INFO ] - VERBOSE: Exporting function 'Write-FileUpdateLog'.
2018-04-22 13:57:43,037 11748 [INFO ] - VERBOSE: Exporting function 'Write-FunctionCallLogMessage'.
2018-04-22 13:57:43,038 11748 [INFO ] - VERBOSE: Exporting alias 'Get-ProcessorBits'.
2018-04-22 13:57:43,038 11748 [INFO ] - VERBOSE: Exporting alias 'Get-OSBitness'.
2018-04-22 13:57:43,039 11748 [INFO ] - VERBOSE: Exporting alias 'Get-InstallRegistryKey'.
2018-04-22 13:57:43,039 11748 [INFO ] - VERBOSE: Exporting alias 'Generate-BinFile'.
2018-04-22 13:57:43,039 11748 [INFO ] - VERBOSE: Exporting alias 'Add-BinFile'.
2018-04-22 13:57:43,040 11748 [INFO ] - VERBOSE: Exporting alias 'Start-ChocolateyProcess'.
2018-04-22 13:57:43,040 11748 [INFO ] - VERBOSE: Exporting alias 'Invoke-ChocolateyProcess'.
2018-04-22 13:57:43,041 11748 [INFO ] - VERBOSE: Exporting alias 'Remove-BinFile'.
2018-04-22 13:57:43,041 11748 [INFO ] - VERBOSE: Exporting alias 'refreshenv'.
2018-04-22 13:57:43,042 11748 [DEBUG] - Loading community extensions
2018-04-22 13:57:43,045 11748 [DEBUG] - Importing 'C:\ProgramData\chocolatey\extensions\chocolatey-core\chocolatey-core.psm1'
2018-04-22 13:57:43,045 11748 [INFO ] - VERBOSE: Loading module from path 'C:\ProgramData\chocolatey\extensions\chocolatey-core\chocolatey-core.psm1'.
2018-04-22 13:57:43,085 11748 [INFO ] - VERBOSE: Exporting function 'Get-UninstallRegistryKey'.
2018-04-22 13:57:43,085 11748 [INFO ] - VERBOSE: Exporting function 'Get-AppInstallLocation'.
2018-04-22 13:57:43,086 11748 [INFO ] - VERBOSE: Exporting function 'Get-AvailableDriveLetter'.
2018-04-22 13:57:43,086 11748 [INFO ] - VERBOSE: Exporting function 'Get-EffectiveProxy'.
2018-04-22 13:57:43,087 11748 [INFO ] - VERBOSE: Exporting function 'Get-PackageCacheLocation'.
2018-04-22 13:57:43,088 11748 [INFO ] - VERBOSE: Exporting function 'Get-PackageParameters'.
2018-04-22 13:57:43,088 11748 [INFO ] - VERBOSE: Exporting function 'Get-WebContent'.
2018-04-22 13:57:43,089 11748 [INFO ] - VERBOSE: Exporting function 'Register-Application'.
2018-04-22 13:57:43,089 11748 [INFO ] - VERBOSE: Importing function 'Get-AppInstallLocation'.
2018-04-22 13:57:43,090 11748 [INFO ] - VERBOSE: Importing function 'Get-AvailableDriveLetter'.
2018-04-22 13:57:43,090 11748 [INFO ] - VERBOSE: Importing function 'Get-EffectiveProxy'.
2018-04-22 13:57:43,091 11748 [INFO ] - VERBOSE: Importing function 'Get-PackageCacheLocation'.
2018-04-22 13:57:43,091 11748 [INFO ] - VERBOSE: Importing function 'Get-PackageParameters'.
2018-04-22 13:57:43,091 11748 [INFO ] - VERBOSE: Importing function 'Get-UninstallRegistryKey'.
2018-04-22 13:57:43,092 11748 [INFO ] - VERBOSE: Importing function 'Get-WebContent'.
2018-04-22 13:57:43,092 11748 [INFO ] - VERBOSE: Importing function 'Register-Application'.
2018-04-22 13:57:43,093 11748 [DEBUG] - Importing 'C:\ProgramData\chocolatey\extensions\chocolatey-windowsupdate\chocolatey-windowsupdate.psm1'
2018-04-22 13:57:43,094 11748 [INFO ] - VERBOSE: Loading module from path 'C:\ProgramData\chocolatey\extensions\chocolatey-windowsupdate\chocolatey-windowsupdate.psm1'.
2018-04-22 13:57:43,101 11748 [INFO ] - VERBOSE: Exporting function 'Install-WindowsUpdate'.
2018-04-22 13:57:43,102 11748 [INFO ] - VERBOSE: Exporting function 'Test-WindowsUpdate'.
2018-04-22 13:57:43,102 11748 [INFO ] - VERBOSE: Importing function 'Install-WindowsUpdate'.
2018-04-22 13:57:43,103 11748 [INFO ] - VERBOSE: Importing function 'Test-WindowsUpdate'.
2018-04-22 13:57:43,104 11748 [INFO ] - VERBOSE: Exporting function 'Format-FileSize'.
2018-04-22 13:57:43,104 11748 [INFO ] - VERBOSE: Exporting function 'Get-ChecksumValid'.
2018-04-22 13:57:43,105 11748 [INFO ] - VERBOSE: Exporting function 'Get-ChocolateyUnzip'.
2018-04-22 13:57:43,105 11748 [INFO ] - VERBOSE: Exporting function 'Get-ChocolateyWebFile'.
2018-04-22 13:57:43,105 11748 [INFO ] - VERBOSE: Exporting function 'Get-EnvironmentVariable'.
2018-04-22 13:57:43,106 11748 [INFO ] - VERBOSE: Exporting function 'Get-EnvironmentVariableNames'.
2018-04-22 13:57:43,106 11748 [INFO ] - VERBOSE: Exporting function 'Get-FtpFile'.
2018-04-22 13:57:43,107 11748 [INFO ] - VERBOSE: Exporting function 'Get-OSArchitectureWidth'.
2018-04-22 13:57:43,107 11748 [INFO ] - VERBOSE: Exporting function 'Get-PackageParameters'.
2018-04-22 13:57:43,107 11748 [INFO ] - VERBOSE: Exporting function 'Get-PackageParametersBuiltIn'.
2018-04-22 13:57:43,108 11748 [INFO ] - VERBOSE: Exporting function 'Get-ToolsLocation'.
2018-04-22 13:57:43,108 11748 [INFO ] - VERBOSE: Exporting function 'Get-UACEnabled'.
2018-04-22 13:57:43,108 11748 [INFO ] - VERBOSE: Exporting function 'Get-UninstallRegistryKey'.
2018-04-22 13:57:43,109 11748 [INFO ] - VERBOSE: Exporting function 'Get-VirusCheckValid'.
2018-04-22 13:57:43,109 11748 [INFO ] - VERBOSE: Exporting function 'Get-WebFile'.
2018-04-22 13:57:43,110 11748 [INFO ] - VERBOSE: Exporting function 'Get-WebFileName'.
2018-04-22 13:57:43,111 11748 [INFO ] - VERBOSE: Exporting function 'Get-WebHeaders'.
2018-04-22 13:57:43,111 11748 [INFO ] - VERBOSE: Exporting function 'Install-BinFile'.
2018-04-22 13:57:43,112 11748 [INFO ] - VERBOSE: Exporting function 'Install-ChocolateyDesktopLink'.
2018-04-22 13:57:43,112 11748 [INFO ] - VERBOSE: Exporting function 'Install-ChocolateyEnvironmentVariable'.
2018-04-22 13:57:43,112 11748 [INFO ] - VERBOSE: Exporting function 'Install-ChocolateyExplorerMenuItem'.
2018-04-22 13:57:43,113 11748 [INFO ] - VERBOSE: Exporting function 'Install-ChocolateyFileAssociation'.
2018-04-22 13:57:43,113 11748 [INFO ] - VERBOSE: Exporting function 'Install-ChocolateyInstallPackage'.
2018-04-22 13:57:43,114 11748 [INFO ] - VERBOSE: Exporting function 'Install-ChocolateyPackage'.
2018-04-22 13:57:43,114 11748 [INFO ] - VERBOSE: Exporting function 'Install-ChocolateyPath'.
2018-04-22 13:57:43,114 11748 [INFO ] - VERBOSE: Exporting function 'Install-ChocolateyPinnedTaskBarItem'.
2018-04-22 13:57:43,115 11748 [INFO ] - VERBOSE: Exporting function 'Install-ChocolateyPowershellCommand'.
2018-04-22 13:57:43,115 11748 [INFO ] - VERBOSE: Exporting function 'Install-ChocolateyShortcut'.
2018-04-22 13:57:43,116 11748 [INFO ] - VERBOSE: Exporting function 'Install-ChocolateyVsixPackage'.
2018-04-22 13:57:43,116 11748 [INFO ] - VERBOSE: Exporting function 'Install-ChocolateyZipPackage'.
2018-04-22 13:57:43,116 11748 [INFO ] - VERBOSE: Exporting function 'Install-Vsix'.
2018-04-22 13:57:43,117 11748 [INFO ] - VERBOSE: Exporting function 'Set-EnvironmentVariable'.
2018-04-22 13:57:43,117 11748 [INFO ] - VERBOSE: Exporting function 'Set-PowerShellExitCode'.
2018-04-22 13:57:43,118 11748 [INFO ] - VERBOSE: Exporting function 'Start-ChocolateyProcessAsAdmin'.
2018-04-22 13:57:43,118 11748 [INFO ] - VERBOSE: Exporting function 'Test-ProcessAdminRights'.
2018-04-22 13:57:43,118 11748 [INFO ] - VERBOSE: Exporting function 'Uninstall-BinFile'.
2018-04-22 13:57:43,119 11748 [INFO ] - VERBOSE: Exporting function 'Uninstall-ChocolateyEnvironmentVariable'.
2018-04-22 13:57:43,119 11748 [INFO ] - VERBOSE: Exporting function 'Uninstall-ChocolateyPackage'.
2018-04-22 13:57:43,120 11748 [INFO ] - VERBOSE: Exporting function 'Uninstall-ChocolateyZipPackage'.
2018-04-22 13:57:43,120 11748 [INFO ] - VERBOSE: Exporting function 'Update-SessionEnvironment'.
2018-04-22 13:57:43,121 11748 [INFO ] - VERBOSE: Exporting function 'Write-ChocolateyFailure'.
2018-04-22 13:57:43,121 11748 [INFO ] - VERBOSE: Exporting function 'Write-ChocolateySuccess'.
2018-04-22 13:57:43,122 11748 [INFO ] - VERBOSE: Exporting function 'Write-FileUpdateLog'.
2018-04-22 13:57:43,122 11748 [INFO ] - VERBOSE: Exporting function 'Write-FunctionCallLogMessage'.
2018-04-22 13:57:43,123 11748 [INFO ] - VERBOSE: Exporting function 'Get-AppInstallLocation'.
2018-04-22 13:57:43,123 11748 [INFO ] - VERBOSE: Exporting function 'Get-AvailableDriveLetter'.
2018-04-22 13:57:43,123 11748 [INFO ] - VERBOSE: Exporting function 'Get-EffectiveProxy'.
2018-04-22 13:57:43,124 11748 [INFO ] - VERBOSE: Exporting function 'Get-PackageCacheLocation'.
2018-04-22 13:57:43,124 11748 [INFO ] - VERBOSE: Exporting function 'Get-WebContent'.
2018-04-22 13:57:43,125 11748 [INFO ] - VERBOSE: Exporting function 'Register-Application'.
2018-04-22 13:57:43,125 11748 [INFO ] - VERBOSE: Exporting function 'Install-WindowsUpdate'.
2018-04-22 13:57:43,125 11748 [INFO ] - VERBOSE: Exporting function 'Test-WindowsUpdate'.
2018-04-22 13:57:43,126 11748 [INFO ] - VERBOSE: Exporting alias 'Get-ProcessorBits'.
2018-04-22 13:57:43,126 11748 [INFO ] - VERBOSE: Exporting alias 'Get-OSBitness'.
2018-04-22 13:57:43,127 11748 [INFO ] - VERBOSE: Exporting alias 'Get-InstallRegistryKey'.
2018-04-22 13:57:43,127 11748 [INFO ] - VERBOSE: Exporting alias 'Generate-BinFile'.
2018-04-22 13:57:43,127 11748 [INFO ] - VERBOSE: Exporting alias 'Add-BinFile'.
2018-04-22 13:57:43,128 11748 [INFO ] - VERBOSE: Exporting alias 'Start-ChocolateyProcess'.
2018-04-22 13:57:43,128 11748 [INFO ] - VERBOSE: Exporting alias 'Invoke-ChocolateyProcess'.
2018-04-22 13:57:43,129 11748 [INFO ] - VERBOSE: Exporting alias 'Remove-BinFile'.
2018-04-22 13:57:43,129 11748 [INFO ] - VERBOSE: Exporting alias 'refreshenv'.
2018-04-22 13:57:43,129 11748 [INFO ] - VERBOSE: Importing function 'Format-FileSize'.
2018-04-22 13:57:43,130 11748 [INFO ] - VERBOSE: Importing function 'Get-AppInstallLocation'.
2018-04-22 13:57:43,130 11748 [INFO ] - VERBOSE: Importing function 'Get-AvailableDriveLetter'.
2018-04-22 13:57:43,131 11748 [INFO ] - VERBOSE: Importing function 'Get-ChecksumValid'.
2018-04-22 13:57:43,131 11748 [INFO ] - VERBOSE: Importing function 'Get-ChocolateyUnzip'.
2018-04-22 13:57:43,132 11748 [INFO ] - VERBOSE: Importing function 'Get-ChocolateyWebFile'.
2018-04-22 13:57:43,132 11748 [INFO ] - VERBOSE: Importing function 'Get-EffectiveProxy'.
2018-04-22 13:57:43,132 11748 [INFO ] - VERBOSE: Importing function 'Get-EnvironmentVariable'.
2018-04-22 13:57:43,133 11748 [INFO ] - VERBOSE: Importing function 'Get-EnvironmentVariableNames'.
2018-04-22 13:57:43,133 11748 [INFO ] - VERBOSE: Importing function 'Get-FtpFile'.
2018-04-22 13:57:43,133 11748 [INFO ] - VERBOSE: Importing function 'Get-OSArchitectureWidth'.
2018-04-22 13:57:43,134 11748 [INFO ] - VERBOSE: Importing function 'Get-PackageCacheLocation'.
2018-04-22 13:57:43,134 11748 [INFO ] - VERBOSE: Importing function 'Get-PackageParameters'.
2018-04-22 13:57:43,135 11748 [INFO ] - VERBOSE: Importing function 'Get-PackageParametersBuiltIn'.
2018-04-22 13:57:43,135 11748 [INFO ] - VERBOSE: Importing function 'Get-ToolsLocation'.
2018-04-22 13:57:43,136 11748 [INFO ] - VERBOSE: Importing function 'Get-UACEnabled'.
2018-04-22 13:57:43,136 11748 [INFO ] - VERBOSE: Importing function 'Get-UninstallRegistryKey'.
2018-04-22 13:57:43,137 11748 [INFO ] - VERBOSE: Importing function 'Get-VirusCheckValid'.
2018-04-22 13:57:43,137 11748 [INFO ] - VERBOSE: Importing function 'Get-WebContent'.
2018-04-22 13:57:43,138 11748 [INFO ] - VERBOSE: Importing function 'Get-WebFile'.
2018-04-22 13:57:43,138 11748 [INFO ] - VERBOSE: Importing function 'Get-WebFileName'.
2018-04-22 13:57:43,138 11748 [INFO ] - VERBOSE: Importing function 'Get-WebHeaders'.
2018-04-22 13:57:43,139 11748 [INFO ] - VERBOSE: Importing function 'Install-BinFile'.
2018-04-22 13:57:43,139 11748 [INFO ] - VERBOSE: Importing function 'Install-ChocolateyDesktopLink'.
2018-04-22 13:57:43,140 11748 [INFO ] - VERBOSE: Importing function 'Install-ChocolateyEnvironmentVariable'.
2018-04-22 13:57:43,140 11748 [INFO ] - VERBOSE: Importing function 'Install-ChocolateyExplorerMenuItem'.
2018-04-22 13:57:43,140 11748 [INFO ] - VERBOSE: Importing function 'Install-ChocolateyFileAssociation'.
2018-04-22 13:57:43,141 11748 [INFO ] - VERBOSE: Importing function 'Install-ChocolateyInstallPackage'.
2018-04-22 13:57:43,141 11748 [INFO ] - VERBOSE: Importing function 'Install-ChocolateyPackage'.
2018-04-22 13:57:43,142 11748 [INFO ] - VERBOSE: Importing function 'Install-ChocolateyPath'.
2018-04-22 13:57:43,142 11748 [INFO ] - VERBOSE: Importing function 'Install-ChocolateyPinnedTaskBarItem'.
2018-04-22 13:57:43,142 11748 [INFO ] - VERBOSE: Importing function 'Install-ChocolateyPowershellCommand'.
2018-04-22 13:57:43,143 11748 [INFO ] - VERBOSE: Importing function 'Install-ChocolateyShortcut'.
2018-04-22 13:57:43,143 11748 [INFO ] - VERBOSE: Importing function 'Install-ChocolateyVsixPackage'.
2018-04-22 13:57:43,144 11748 [INFO ] - VERBOSE: Importing function 'Install-ChocolateyZipPackage'.
2018-04-22 13:57:43,144 11748 [INFO ] - VERBOSE: Importing function 'Install-Vsix'.
2018-04-22 13:57:43,144 11748 [INFO ] - VERBOSE: Importing function 'Install-WindowsUpdate'.
2018-04-22 13:57:43,145 11748 [INFO ] - VERBOSE: Importing function 'Register-Application'.
2018-04-22 13:57:43,145 11748 [INFO ] - VERBOSE: Importing function 'Set-EnvironmentVariable'.
2018-04-22 13:57:43,146 11748 [INFO ] - VERBOSE: Importing function 'Set-PowerShellExitCode'.
2018-04-22 13:57:43,146 11748 [INFO ] - VERBOSE: Importing function 'Start-ChocolateyProcessAsAdmin'.
2018-04-22 13:57:43,146 11748 [INFO ] - VERBOSE: Importing function 'Test-ProcessAdminRights'.
2018-04-22 13:57:43,147 11748 [INFO ] - VERBOSE: Importing function 'Test-WindowsUpdate'.
2018-04-22 13:57:43,147 11748 [INFO ] - VERBOSE: Importing function 'Uninstall-BinFile'.
2018-04-22 13:57:43,148 11748 [INFO ] - VERBOSE: Importing function 'Uninstall-ChocolateyEnvironmentVariable'.
2018-04-22 13:57:43,148 11748 [INFO ] - VERBOSE: Importing function 'Uninstall-ChocolateyPackage'.
2018-04-22 13:57:43,148 11748 [INFO ] - VERBOSE: Importing function 'Uninstall-ChocolateyZipPackage'.
2018-04-22 13:57:43,149 11748 [INFO ] - VERBOSE: Importing function 'Update-SessionEnvironment'.
2018-04-22 13:57:43,149 11748 [INFO ] - VERBOSE: Importing function 'Write-ChocolateyFailure'.
2018-04-22 13:57:43,150 11748 [INFO ] - VERBOSE: Importing function 'Write-ChocolateySuccess'.
2018-04-22 13:57:43,150 11748 [INFO ] - VERBOSE: Importing function 'Write-FileUpdateLog'.
2018-04-22 13:57:43,150 11748 [INFO ] - VERBOSE: Importing function 'Write-FunctionCallLogMessage'.
2018-04-22 13:57:43,151 11748 [INFO ] - VERBOSE: Importing alias 'Add-BinFile'.
2018-04-22 13:57:43,151 11748 [INFO ] - VERBOSE: Importing alias 'Generate-BinFile'.
2018-04-22 13:57:43,152 11748 [INFO ] - VERBOSE: Importing alias 'Get-InstallRegistryKey'.
2018-04-22 13:57:43,152 11748 [INFO ] - VERBOSE: Importing alias 'Get-OSBitness'.
2018-04-22 13:57:43,152 11748 [INFO ] - VERBOSE: Importing alias 'Get-ProcessorBits'.
2018-04-22 13:57:43,153 11748 [INFO ] - VERBOSE: Importing alias 'Invoke-ChocolateyProcess'.
2018-04-22 13:57:43,154 11748 [INFO ] - VERBOSE: Importing alias 'refreshenv'.
2018-04-22 13:57:43,154 11748 [INFO ] - VERBOSE: Importing alias 'Remove-BinFile'.
2018-04-22 13:57:43,154 11748 [INFO ] - VERBOSE: Importing alias 'Start-ChocolateyProcess'.
2018-04-22 13:57:43,156 11748 [DEBUG] - Running 'ChocolateyScriptRunner' for ruby v2.5.1.1 with packageScript 'C:\ProgramData\chocolatey\lib\ruby\tools\chocolateyInstall.ps1', packageFolder:'C:\ProgramData\chocolatey\lib\ruby', installArguments: 'INSTALLDIR=C:\Frameworks\NodeJS', packageParameters: '/ThreadSafe /InstallDir:C:\Frameworks\PHP',
2018-04-22 13:57:43,158 11748 [DEBUG] - Running 'C:\ProgramData\chocolatey\lib\ruby\tools\chocolateyInstall.ps1'
2018-04-22 13:57:43,160 11748 [DEBUG] - Running Get-PackageParameters 
2018-04-22 13:57:43,161 11748 [DEBUG] - Parsing $env:ChocolateyPackageParameters and $env:ChocolateyPackageParametersSensitive for parameters
2018-04-22 13:57:43,163 11748 [DEBUG] - Adding package param 'ThreadSafe'='True'
2018-04-22 13:57:43,164 11748 [DEBUG] - Adding package param 'InstallDir'='C:\Frameworks\PHP'
2018-04-22 13:57:43,166 11748 [INFO ] - Ruby is going to be installed in 'C:\Frameworks\PHP'
2018-04-22 13:57:43,173 11748 [DEBUG] - Running Install-ChocolateyInstallPackage -silentArgs '/verysilent /dir="C:\Frameworks\PHP" /tasks="assocfiles,noridkinstall,modpath"' -file 'C:\ProgramData\chocolatey\lib\ruby\tools\rubyinstaller-devkit-2.5.1-1-x86_x32.exe' -file64 'C:\ProgramData\chocolatey\lib\ruby\tools\rubyinstaller-devkit-2.5.1-1-x64_x64.exe' -fileType 'exe' -validExitCodes '0' -packageName 'ruby' 
2018-04-22 13:57:43,174 11748 [DEBUG] - Running Get-ProcessorBits -compare '32' 
2018-04-22 13:57:43,175 11748 [INFO ] - Installing 64-bit ruby...
2018-04-22 13:57:43,178 11748 [WARN ] - WARNING: Pro / Business supports a single, ubiquitous install directory option.
 Stop the hassle of determining how to pass install directory overrides
 to install arguments for each package / installer type.
 Check out Pro / Business - https://chocolatey.org/compare"
2018-04-22 13:57:43,182 11748 [DEBUG] - Ensuring 'C:\Frameworks' exists
2018-04-22 13:57:43,184 11748 [DEBUG] - Error ensuring directories exist -  Exception calling "GetDirectoryName" with "1" argument(s): "The path is not of a legal form."
2018-04-22 13:57:43,185 11748 [DEBUG] - Running Start-ChocolateyProcessAsAdmin -validExitCodes '0' -workingDirectory 'C:\ProgramData\chocolatey\lib\ruby\tools' -statements '/verysilent /dir="C:\Frameworks\PHP" /tasks="assocfiles,noridkinstall,modpath" INSTALLDIR=C:\Frameworks\NodeJS' -exeToRun 'C:\ProgramData\chocolatey\lib\ruby\tools\rubyinstaller-devkit-2.5.1-1-x64_x64.exe' 
2018-04-22 13:57:43,185 11748 [DEBUG] - Test-ProcessAdminRights: returning True
2018-04-22 13:57:43,186 11748 [DEBUG] - Elevating permissions and running ["C:\ProgramData\chocolatey\lib\ruby\tools\rubyinstaller-devkit-2.5.1-1-x64_x64.exe" /verysilent /dir="C:\Frameworks\PHP" /tasks="assocfiles,noridkinstall,modpath" INSTALLDIR=C:\Frameworks\NodeJS]. This may take a while, depending on the statements.
2018-04-22 13:59:43,106 9796 [DEBUG] - XmlConfiguration is now operational
2018-04-22 13:59:43,143 9796 [INFO ] - ============================================================
2018-04-22 13:59:43,280 9796 [INFO ] - Chocolatey v0.10.10
2018-04-22 13:59:43,288 9796 [DEBUG] - Chocolatey is running on Windows v 10.0.16299.0

Note #1443 here: 2018-04-22 13:57:43,185 11748 [DEBUG] - Running Start-ChocolateyProcessAsAdmin -validExitCodes '0' -workingDirectory 'C:\ProgramData\chocolatey\lib\ruby\tools' -statements '/verysilent /dir="C:\Frameworks\PHP" /tasks="assocfiles,noridkinstall,modpath" INSTALLDIR=C:\Frameworks\NodeJS' -exeToRun 'C:\ProgramData\chocolatey\lib\ruby\tools\rubyinstaller-devkit-2.5.1-1-x64_x64.exe'

Accompanying cmd output:

You have ruby v2.5.0.2 installed. Version 2.5.1.1 is available based on your source(s).
Progress: Downloading ruby 2.5.1.1... 100%

ruby v2.5.1.1 [Approved]
ruby package files upgrade completed. Performing other installation steps.
Ruby is going to be installed in 'C:\Frameworks\PHP'
Installing 64-bit ruby...
WARNING: Pro / Business supports a single, ubiquitous install directory option.
 Stop the hassle of determining how to pass install directory overrides
 to install arguments for each package / installer type.
 Check out Pro / Business - https://chocolatey.org/compare"
Exiting chocolatey abnormally. Please manually clean up anything that
 was not finished.

C:\WINDOWS\system32>choco upgrade all -y
Chocolatey v0.10.10
[Pending] Removing incomplete install for 'ruby'
Upgrading the following packages:
all
By upgrading you accept licenses for the packages.
7zip v18.1 is the latest version available based on your source(s).
7zip.install v18.1 is the latest version available based on your source(s).
7zip.portable v18.1 is the latest version available based on your source(s).

[...]

resilio-sync-home v2.5.12.1191 is the latest version available based on your source(s).
rsync v5.5.0.20160518 is the latest version available based on your source(s).

You have sandboxie v5.20 installed. Version 5.24 is available based on your source(s).

Note the lack of ruby between rsync and sandboxie and the line "Removing incomplete install for 'ruby'"

bcurran3 commented 6 years ago

There definitely seems to be a problem with ..\chocolatey\lib\packagename being removed on aborted installs and thus the package becomes lost/forgotten. I've been experiencing this for the last 2-3 builds. It's not just a CTRL+C thing, it can be an upgrade failed because the system needed a reboot first, etc. etc. Seems to be an issue of just putting the original (old) package files back when an upgrade fails.

I recently mentioned it here: https://groups.google.com/forum/#!topic/chocolatey/zsMuLUSzSwE and about four months ago here: https://chocolatey.org/packages/choco-persistent-packages#comment-3692438597

Glad it's not just me! :)

Glad/Sad this isn't just a Pro thing - it'll get fixed faster! :)

Let me know if I can provide any info.

ferventcoder commented 6 years ago

@dinfinity unfortunately that is why Control+C is definitely not recommended. It can cause issue like this.

ferventcoder commented 6 years ago

So this seems to affect dependencies more than it does anything else. I can see that in the source code.

dinfinity commented 6 years ago

@ferventcoder: Well, what am I supposed to do if I see Chocolatey installing Ruby into my PHP directory? Is there a proper abort keystroke I can use?

bcurran3 commented 6 years ago

@dinfinity you can control-c and then check to see if you have missing package files, or better yet let it finish installing, then uninstall, then install again with using the parameters to install to the location of your choice.

dinfinity commented 5 years ago

This is still a problem (0.10.11). It is a pain in the ass. Due to other chocolatey bugs ( https://github.com/chocolatey/choco/issues/797#issuecomment-447967866 ) I sometimes need to abort during a choco upgrade all, to prevent all kinds of upgrades to be installed into the same target directory. The package that is then currently being upgraded (even if it is seconds into the upgrade process) is almost guaranteed to be regarded as uninstalled afterwards.

An upgrade should be transactional and not forget which packages I want on my system. That is pretty much the opposite of what a package manager should be doing.

bcurran3 commented 5 years ago

So this seems to affect dependencies more than it does anything else. I can see that in the source code.

This problem is NOT just related to dependencies, this is related to any package that is aborted during its upgrade process. After moving the old package files to chocolatey\lib-bkp and the upgrade "abortion," the original package files never get put back to chocolatey\lib and Chocolatey then looses all management of the package.

I'm not positive, but I think this can be fixed via the Chocolatey PS helper files. I've added some references other people have suggested for handling cntrl-c and clean up based on it in https://github.com/chocolatey/choco/issues/619. HTH.

This is easily reproducible by newly installing an old version of any package with embedded binaries followed by an upgrade which is aborted. Do a choco list -l and no version of the package will be known to choco as installed. The exception to this, of course, is licensed Chocolatey users with Package Synchronizer which will re-find the program and add the package files. Chocolatey FOSS users don't have Package Synchronizer and the management of the package by Chocolatey will be lost. So this must be tested via the FOSS version of Chocolatey.

pauby commented 2 months ago

Note that #1443 was fixed in v1.2.0.

Duplicate of #619