Skip to content

Instantly share code, notes, and snippets.

@jberezanski
Created April 17, 2014 20:23
Show Gist options
  • Save jberezanski/11009387 to your computer and use it in GitHub Desktop.
Save jberezanski/11009387 to your computer and use it in GitHub Desktop.
chocolatey bug - Package depending on newer Chocolatey is installed using existing Chocolatey
**********************
Windows PowerShell Transcript Start
Start time: 20140416201911
Username : S9T-JB\jberezanski
Machine : S9T-JB (Microsoft Windows NT 6.1.7601 Service Pack 1)
**********************
Transcript started, output file is .\choco-update2.log
PS C:\> C:\Chocolatey\chocolateyinstall\chocolatey.ps1 install elevate.native -debug
DEBUG: Running 'Chocolatey-Install' for elevate.native with source: '', version: '', installerArguments:''
DEBUG: Running 'Chocolatey-NuGet' for elevate.native with source:''. Force? False
Chocolatey (v0.9.8.20) is installing elevate.native and dependencies. By installing you accept the license for elevate.native and each dependency you are installing.
DEBUG: Installing packages to "C:\Chocolatey\lib".
DEBUG: Running 'Run-NuGet' for elevate.native with source: '', version:''
DEBUG: ___ NuGet ____
DEBUG: Running 'Get-ConfigValue' with configValue:'useNuGetForSources'
DEBUG: Running 'Get-UserConfigValue' with configValue:'useNuGetForSources'
DEBUG: After checking the user config the value of 'useNuGetForSources' is ''
DEBUG: Value not found in the user config file - checking the global config
DEBUG: Running 'Get-GlobalConfigValue' with configValue:'useNuGetForSources'
DEBUG: After checking the global config the value of 'useNuGetForSources' is 'false'
DEBUG: Running 'Get-UserConfigValue' with configValue:'sources'
DEBUG: Running 'Get-GlobalConfigValue' with configValue:'sources'
DEBUG: Using global sources
DEBUG: Using '-Source "http://chocolatey.org/api/v2/" -Source "https://go.microsoft.com/fwlink/?LinkID=230477" ' as the
source arguments
DEBUG: Calling 'C:\Chocolatey\chocolateyinstall\nuget.exe' install elevate.native -Outputdirectory "C:\Chocolatey\lib"
-Source "http://chocolatey.org/api/v2/" -Source "https://go.microsoft.com/fwlink/?LinkID=230477" -NonInteractive
DEBUG: Attempting to resolve dependency 'chocolatey (≥ 0.9.8.21)'.
Successfully installed 'chocolatey 0.9.8.23'.
Successfully installed 'elevate.native 1.3.0'.
DEBUG: Evaluating NuGet output for line: Attempting to resolve dependency 'chocolatey (≥ 0.9.8.21)'.
DEBUG: Evaluating NuGet output for line: Successfully installed 'chocolatey 0.9.8.23'.
______ chocolatey v0.9.8.23 ______
DEBUG: Running 'Delete-ExistingErrorLog' for chocolatey
DEBUG: Looking for failure log at 'C:\Users\JBEREZ~1\AppData\Local\Temp\2\chocolatey\chocolatey\failure.log'
DEBUG: Running 'Run-ChocolateyPS1' for chocolatey with packageFolder:'C:\Chocolatey\lib\chocolatey.0.9.8.23', action:
'install'
DEBUG: __ PowerShell install (chocolateyinstall.ps1) __
DEBUG: Looking for chocolateyinstall.ps1 in folder 'C:\Chocolatey\lib\chocolatey.0.9.8.23'. If chocolateyinstall.ps1
is found, it will be run.
DEBUG: Action file is 'chocolateyInstall.ps1'
DEBUG: Running 'C:\Chocolatey\lib\chocolatey.0.9.8.23\tools\chocolateyInstall.ps1'
Creating ChocolateyInstall as a User Environment variable and setting it to 'C:\Chocolatey'
We are setting up the Chocolatey repository for NuGet packages that should be at the machine level. Think executables/application packages, not library packages.
That is what Chocolatey NuGet goodness is for. The repository is set up at 'C:\Chocolatey'.
The packages themselves go to 'C:\Chocolatey\lib' (i.e. C:\Chocolatey\lib\yourPackageName).
A batch file for the command line goes to 'C:\Chocolatey\bin' and points to an executable in 'C:\Chocolatey\lib\yourPackageName'.
Creating Chocolatey NuGet folders if they do not already exist.
Copying the contents of 'C:\Chocolatey\lib\chocolatey.0.9.8.23\tools\chocolateyInstall' to 'C:\Chocolatey'.
Creating 'C:\Chocolatey\bin\chocolatey.bat' so you can call 'chocolatey'.
Creating 'C:\Chocolatey\bin\choco.bat' so you can call 'choco'.
Creating 'C:\Chocolatey\bin\cinst.bat' so you can call 'choco install' from a shortcut of 'cinst'.
Creating 'C:\Chocolatey\bin\cup.bat' so you can call 'choco update' from a shortcut of 'cup'.
Creating 'C:\Chocolatey\bin\cuninst.bat' so you can call 'choco uninstall' from a shortcut of 'cuninst'.
Creating 'C:\Chocolatey\bin\clist.bat' so you can call 'choco list' from a shortcut of 'clist'.
Creating 'C:\Chocolatey\bin\cver.bat' so you can call 'choco version' from a shortcut of 'cver'.
Creating 'C:\Chocolatey\bin\cpack.bat' so you can call 'choco pack' from a shortcut of 'cpack'.
Creating 'C:\Chocolatey\bin\cpush.bat' so you can call 'choco push' from a shortcut of 'cpush'.
User PATH already contains either 'C:\Chocolatey\bin' or '%DIR%..\bin'
Chocolatey is now ready.
You can call chocolatey from anywhere, command line or powershell by typing chocolatey.
Run chocolatey /? for a list of functions.
You may need to shut down and restart powershell and/or consoles first prior to using chocolatey.
If you are upgrading chocolatey from an older version (prior to 0.9.8.15) and don't use a custom chocolatey path, please find and delete the C:\NuGet folder after verifying that C:\Chocolatey has the same contents (minus chocolateyinstall of course).
DEBUG: Running 'Get-ChocolateyBins' for C:\Chocolatey\lib\chocolatey.0.9.8.23
DEBUG: __ Executable Links (*.exe) __
DEBUG: Looking for executables in folder: C:\Chocolatey\lib\chocolatey.0.9.8.23
Adding batch files for any executables found to a location on PATH. In other words the executable will be available
from ANY command line/powershell prompt.
DEBUG: There are no executables (that are not ignored) in the package.
DEBUG: Evaluating NuGet output for line: Successfully installed 'elevate.native 1.3.0'.
______ elevate.native v1.3.0 ______
DEBUG: Running 'Delete-ExistingErrorLog' for elevate.native
DEBUG: Looking for failure log at 'C:\Users\JBEREZ~1\AppData\Local\Temp\2\chocolatey\elevate.native\failure.log'
DEBUG: Running 'Run-ChocolateyPS1' for elevate.native with packageFolder:'C:\Chocolatey\lib\elevate.native.1.3.0',
action: 'install'
DEBUG: __ PowerShell install (chocolateyinstall.ps1) __
DEBUG: Looking for chocolateyinstall.ps1 in folder 'C:\Chocolatey\lib\elevate.native.1.3.0'. If chocolateyinstall.ps1
is found, it will be run.
DEBUG: Action file is 'chocolateyInstall.ps1'
DEBUG: Running 'C:\Chocolatey\lib\elevate.native.1.3.0\tools\chocolateyInstall.ps1'
DEBUG: Running 'Install-ChocolateyZipPackage' for elevate.native with
url:'http://code.kliu.org/misc/elevate/elevate-1.3.0-redist.7z', unzipLocation:
'C:\Chocolatey\lib\elevate.native.1.3.0\tools', url64bit: 'http://code.kliu.org/misc/elevate/elevate-1.3.0-redist.7z'
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 04/16/2014 20:20 elevate.native
DEBUG: Running 'Get-ChocolateyWebFile' for elevate.native with
url:'http://code.kliu.org/misc/elevate/elevate-1.3.0-redist.7z',
fileFullPath:'C:\Users\JBEREZ~1\AppData\Local\Temp\2\chocolatey\elevate.native\elevate.nativeInstall.zip',and
url64bit:'http://code.kliu.org/misc/elevate/elevate-1.3.0-redist.7z'
DEBUG: Processor width is 64.
Downloading elevate.native (http://code.kliu.org/misc/elevate/elevate-1.3.0-redist.7z) to C:\Users\JBEREZ~1\AppData\Local\Temp\2\chocolatey\elevate.native\elevate.nativeInstall.zip
DEBUG: Running 'Get-WebFile' for
C:\Users\JBEREZ~1\AppData\Local\Temp\2\chocolatey\elevate.native\elevate.nativeInstall.zip with
url:'http://code.kliu.org/misc/elevate/elevate-1.3.0-redist.7z', userAgent: 'chocolatey command line'
DEBUG: Setting the UserAgent to 'chocolatey command line'
DEBUG: Running 'Get-ChocolateyUnzip' with
fileFullPath:'C:\Users\JBEREZ~1\AppData\Local\Temp\2\chocolatey\elevate.native\elevate.nativeInstall.zip'',destination:
C:\Chocolatey\lib\elevate.native.1.3.0\tools
Extracting C:\Users\JBEREZ~1\AppData\Local\Temp\2\chocolatey\elevate.native\elevate.nativeInstall.zip to C:\Chocolatey\lib\elevate.native.1.3.0\tools...
C:\Chocolatey\lib\elevate.native.1.3.0\tools
elevate.native has finished succesfully! The chocolatey gods have answered your request!
Move-Item : The process cannot access the file because it is being used by another process.
At C:\Chocolatey\chocolateyinstall\helpers\functions\Write-ChocolateyFailure.ps1:14 char:16
+ Move-Item <<<< $successLog $oldSuccessLog -Force
+ CategoryInfo : WriteError: (C:\Users\JBEREZ...ive\success.log:FileInfo) [Move-Item], IOException
+ FullyQualifiedErrorId : MoveFileInfoItemIOError,Microsoft.PowerShell.Commands.MoveItemCommand
Write-Error : elevate.native did not finish successfully. Boo to the chocolatey gods!
-----------------------
[ERROR] The term 'Get-ProcessorBits' is not recognized as the name of a cmdlet, function, script file, or operable prog
ram. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
-----------------------
At C:\Chocolatey\chocolateyinstall\helpers\functions\Write-ChocolateyFailure.ps1:29 char:13
+ Write-Error <<<< $errorMessage
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Write-Error
The term 'Get-ProcessorBits' is not recognized as the name of a cmdlet, function, script file, or operable program. Che
ck the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Chocolatey\lib\elevate.native.1.3.0\tools\chocolateyInstall.ps1:4 char:18
+ Get-ProcessorBits <<<<
+ CategoryInfo : ObjectNotFound: (Get-ProcessorBits:String) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : CommandNotFoundException
PS C:\> gi C:\Chocolatey\chocolateyinstall\helpers\functions\Get-ProcessorBits.ps1
Directory: C:\Chocolatey\chocolateyinstall\helpers\functions
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 4/16/2014 8:20 PM 1200 Get-ProcessorBits.ps1
PS C:\> C:\Chocolatey\chocolateyinstall\chocolatey.ps1 install elevate.native -force
DEBUG: Running 'Append-InstallLog' with chocoInstallLog:''
DEBUG: Arguments: $command =
'install'|$packageNames='elevate.native'|$source=''|$version=''|$allVersions=False|$InstallArguments=''|$overrideArgume
nts=False|$force=True|$prerelease=False|$localonly=False|$verbosity=False|$debug=False|$name=''|$ignoreDependencies=Fal
se|$forceX86=False|$packageParameters=''|PowerShellVersion=2.0
DEBUG: Invoke-ChocolateyFunction is calling: $ChocoFunction='Chocolatey-Install'|@paramlist='@paramlist'
DEBUG: Running 'Chocolatey-Install' for 'elevate.native' with source: '', version: '', installerArguments:''
DEBUG: Running 'Chocolatey-NuGet' for elevate.native with source:''. Force? True
Chocolatey (v0.9.8.23) is installing 'elevate.native' and dependencies. By installing you accept the license for 'elevate.native' and each dependency you are installing.
DEBUG: Installing packages to "C:\Chocolatey\lib".
DEBUG: Running 'Run-NuGet' for elevate.native with source: '', version:''
DEBUG: ___ NuGet ____
DEBUG: Running 'Get-ConfigValue' with configValue:'useNuGetForSources'
DEBUG: Running 'Get-UserConfigValue' with configValue:'useNuGetForSources'
DEBUG: After checking the user config the value of 'useNuGetForSources' is ''
DEBUG: Value not found in the user config file - checking the global config
DEBUG: Running 'Get-GlobalConfigValue' with configValue:'useNuGetForSources'
DEBUG: After checking the global config the value of 'useNuGetForSources' is 'false'
DEBUG: Running 'Get-UserConfigValue' with configValue:'sources'
DEBUG: Running 'Get-GlobalConfigValue' with configValue:'sources'
DEBUG: Using global sources
DEBUG: Using '-Source "https://chocolatey.org/api/v2/" ' as the source arguments
DEBUG: Calling 'C:\Chocolatey\chocolateyinstall\nuget.exe' install elevate.native -Outputdirectory "C:\Chocolatey\lib"
-Source "https://chocolatey.org/api/v2/" -NonInteractive -NoCache
DEBUG: Attempting to resolve dependency 'chocolatey (≥ 0.9.8.21)'.
'elevate.native 1.3.0' already installed.
DEBUG: Evaluating NuGet output for line: Attempting to resolve dependency 'chocolatey (≥ 0.9.8.21)'.
DEBUG: Evaluating NuGet output for line: 'elevate.native 1.3.0' already installed.
DEBUG: NuGet installed elevate.native. If we are ignoring dependencies (False) then we will clean this up.
______ elevate.native v1.3.0 ______
DEBUG: Running 'Delete-ExistingErrorLog' for elevate.native
DEBUG: Looking for failure log at 'C:\Users\JBEREZ~1\AppData\Local\Temp\2\chocolatey\elevate.native\failure.log'
DEBUG: Found the failure log. Deleting it...
DEBUG: Running 'Run-ChocolateyPS1' for elevate.native with packageFolder:'C:\Chocolatey\lib\elevate.native.1.3.0',
action: 'install'
DEBUG: __ PowerShell install (chocolateyinstall.ps1) __
DEBUG: Looking for chocolateyinstall.ps1 in folder 'C:\Chocolatey\lib\elevate.native.1.3.0'. If chocolateyinstall.ps1
is found, it will be run.
DEBUG: Action file is 'chocolateyInstall.ps1'
DEBUG: Running 'C:\Chocolatey\lib\elevate.native.1.3.0\tools\chocolateyInstall.ps1'
DEBUG: Running 'Install-ChocolateyZipPackage' for elevate.native with
url:'http://code.kliu.org/misc/elevate/elevate-1.3.0-redist.7z', unzipLocation:
'C:\Chocolatey\lib\elevate.native.1.3.0\tools', url64bit: 'http://code.kliu.org/misc/elevate/elevate-1.3.0-redist.7z'
DEBUG: Running 'Get-ChocolateyWebFile' for elevate.native with
url:'http://code.kliu.org/misc/elevate/elevate-1.3.0-redist.7z',
fileFullPath:'C:\Users\JBEREZ~1\AppData\Local\Temp\2\chocolatey\elevate.native\elevate.nativeInstall.zip',and
url64bit:'http://code.kliu.org/misc/elevate/elevate-1.3.0-redist.7z'
DEBUG: Processor width is 64.
Downloading elevate.native (http://code.kliu.org/misc/elevate/elevate-1.3.0-redist.7z) to C:\Users\JBEREZ~1\AppData\Local\Temp\2\chocolatey\elevate.native\elevate.nativeInstall.zip
DEBUG: Running 'Get-WebFile' for
C:\Users\JBEREZ~1\AppData\Local\Temp\2\chocolatey\elevate.native\elevate.nativeInstall.zip with
url:'http://code.kliu.org/misc/elevate/elevate-1.3.0-redist.7z', userAgent: 'chocolatey command line'
DEBUG: Setting the UserAgent to 'chocolatey command line'
DEBUG: Running 'Get-ChocolateyUnzip' with
fileFullPath:'C:\Users\JBEREZ~1\AppData\Local\Temp\2\chocolatey\elevate.native\elevate.nativeInstall.zip'',destination:
C:\Chocolatey\lib\elevate.native.1.3.0\tools
Extracting C:\Users\JBEREZ~1\AppData\Local\Temp\2\chocolatey\elevate.native\elevate.nativeInstall.zip to C:\Chocolatey\lib\elevate.native.1.3.0\tools...
C:\Chocolatey\lib\elevate.native.1.3.0\tools
elevate.native has finished succesfully! The chocolatey gods have answered your request!
Move-Item : The process cannot access the file because it is being used by another process.
At C:\Chocolatey\chocolateyinstall\helpers\functions\Write-ChocolateyFailure.ps1:14 char:16
+ Move-Item <<<< $successLog $oldSuccessLog -Force
+ CategoryInfo : WriteError: (C:\Users\JBEREZ...ive\success.log:FileInfo) [Move-Item], IOException
+ FullyQualifiedErrorId : MoveFileInfoItemIOError,Microsoft.PowerShell.Commands.MoveItemCommand
Write-Error : elevate.native did not finish successfully. Boo to the chocolatey gods!
-----------------------
[ERROR] The term 'Get-ProcessorBits' is not recognized as the name of a cmdlet, function, script file, or operable prog
ram. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
-----------------------
At C:\Chocolatey\chocolateyinstall\helpers\functions\Write-ChocolateyFailure.ps1:29 char:13
+ Write-Error <<<< $errorMessage
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Write-Error
DEBUG: Running 'Move-BadInstall' for elevate.native version: '1.3.0',
packageFolder:'C:\Chocolatey\lib\elevate.native.1.3.0'
DEBUG: Moving bad package 'elevate.native v1.3.0' to 'C:\Chocolatey\lib-bad'.
Write-Error : Package 'elevate.native v1.3.0' did not install successfully: The term 'Get-ProcessorBits' is not recogni
zed as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path w
as included, verify that the path is correct and try again.
At C:\Chocolatey\chocolateyinstall\functions\Chocolatey-NuGet.ps1:90 char:28
+ Write-Error <<<< "Package `'$installedPackageName v$installedPackageVersion`' did not install succes
sfully: $($_.Exception.Message)"
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Write-Error
DEBUG: Evaluating NuGet output for line:
Finished installing 'elevate.native' and dependencies - if errors not shown in console, none detected. Check log for errors if unsure.
PS C:\> Get-Module
ModuleType Name ExportedCommands
---------- ---- ----------------
Script chocolateyInstaller {Get-ChocolateyUnzip, Install-ChocolateyZipPackage, Write-Debug, Write-H...
Script chocolateysetup Initialize-Chocolatey
PS C:\> Get-Module | Remove-Module
PS C:\> C:\Chocolatey\chocolateyinstall\chocolatey.ps1 install elevate.native -force
Chocolatey (v0.9.8.23) is installing 'elevate.native' and dependencies. By installing you accept the license for 'elevate.native' and each dependency you are installing.
______ elevate.native v1.3.0 ______
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 04/16/2014 20:23 elevate.native
Downloading elevate.native 64 bit (http://code.kliu.org/misc/elevate/elevate-1.3.0-redist.7z) to C:\Users\jberezanski\AppData\Local\Temp\chocolatey\elevate.native\elevate.nativeInstall.zip
Extracting C:\Users\jberezanski\AppData\Local\Temp\chocolatey\elevate.native\elevate.nativeInstall.zip to C:\Chocolatey\lib\elevate.native.1.3.0\tools...
C:\Chocolatey\lib\elevate.native.1.3.0\tools
elevate.native has finished successfully! The chocolatey gods have answered your request!
Adding C:\Chocolatey\bin\elevate.bat and pointing to '%DIR%..\lib\elevate.native.1.3.0\tools\bin.x86-64\elevate.exe'.
Adding C:\Chocolatey\bin\elevate and pointing to '%DIR%..\lib\elevate.native.1.3.0\tools\bin.x86-64\elevate.exe'.
Finished installing 'elevate.native' and dependencies - if errors not shown in console, none detected. Check log for errors if unsure.
PS C:\> Stop-Transcript
**********************
Windows PowerShell Transcript End
End time: 20140416202345
**********************
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment