Skip to content

Instantly share code, notes, and snippets.

@BradKnowles
Created March 27, 2015 03:15
Show Gist options
  • Save BradKnowles/27aab9583fe60d494e7e to your computer and use it in GitHub Desktop.
Save BradKnowles/27aab9583fe60d494e7e to your computer and use it in GitHub Desktop.
Chocolatey Firefox Error and Potential Fix
2015-03-26 23:08:47,039 [INFO ] - ============================================================
2015-03-26 23:08:47,054 [INFO ] - Chocolatey v0.9.9.2
2015-03-26 23:08:47,054 [DEBUG] - Chocolatey is running on Windows v 6.1.7601.65536
2015-03-26 23:08:47,054 [DEBUG] - Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".
2015-03-26 23:08:47,054 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\choco.exe.old".
2015-03-26 23:08:47,070 [DEBUG] - Command line: "C:\ProgramData\chocolatey\choco.exe" install firefox -d
2015-03-26 23:08:47,070 [DEBUG] - Received arguments: install firefox -d
2015-03-26 23:08:47,101 [DEBUG] -
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.
2015-03-26 23:08:47,117 [DEBUG] - Configuration: CommandName='install'|CacheLocation='C:\Users\dev\AppData\Local\Temp'|
ContainsLegacyPackageInstalls='True'|
CommandExecutionTimeoutSeconds='2700'|
Sources='https://chocolatey.org/api/v2/'|Debug='True'|Verbose='False'|
Force='False'|Noop='False'|HelpRequested='False'|RegularOutput='True'|
PromptForConfirmation='True'|AcceptLicense='False'|
AllowUnofficialBuild='False'|Input='firefox'|AllVersions='False'|
SkipPackageInstallProvider='False'|PackageNames='firefox'|
Prerelease='False'|ForceX86='False'|OverrideArguments='False'|
NotSilent='False'|IgnoreDependencies='False'|
AllowMultipleVersions='False'|ForceDependencies='False'|
Information.PlatformType='Windows'|
Information.PlatformVersion='6.1.7601.65536'|
Information.PlatformName='Windows 7'|
Information.ChocolateyVersion='0.9.9.2'|
Information.ChocolateyProductVersion='0.9.9.2'|
Information.FullName='choco, Version=0.9.9.2, Culture=neutral, PublicKeyToken=79d02ea9cad655eb'|
Information.Is64Bit='False'|Information.IsInteractive='True'|
Information.IsUserAdministrator='True'|
Information.IsProcessElevated='True'|Features.AutoUninstaller='False'|
Features.CheckSumFiles='True'|ListCommand.LocalOnly='False'|
ListCommand.IncludeRegistryPrograms='False'|
UpgradeCommand.FailOnUnfound='False'|
NewCommand.AutomaticPackage='False'|SourceCommand.Command='unknown'|
FeatureCommand.Command='unknown'|PushCommand.TimeoutInSeconds='0'|
PinCommand.Command='unknown'|
2015-03-26 23:08:47,133 [DEBUG] - _ Chocolatey:ChocolateyInstallCommand - Normal Run Mode _
2015-03-26 23:08:47,133 [INFO ] - Installing the following packages:
2015-03-26 23:08:47,148 [INFO ] - firefox
2015-03-26 23:08:47,148 [INFO ] - By installing you accept licenses for the packages.
2015-03-26 23:08:48,554 [INFO ] - Installing 'Firefox 36.0.1'.
2015-03-26 23:08:48,554 [DEBUG] - Added file 'chocolateyInstall.ps1' to folder 'Firefox\tools'.
2015-03-26 23:08:48,554 [DEBUG] - Added file 'Firefox.nupkg' to folder 'Firefox'.
2015-03-26 23:08:48,570 [INFO ] - Successfully installed 'Firefox 36.0.1'.
2015-03-26 23:08:48,570 [INFO ] -
Firefox v36.0.1
2015-03-26 23:08:48,586 [DEBUG] - Contents of 'C:\ProgramData\chocolatey\lib\Firefox\tools\chocolateyInstall.ps1':
2015-03-26 23:08:48,586 [DEBUG] - # ---------------- Function definitions ------------------
function GetUninstallPath () {
$regUninstallDir = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\'
$regUninstallDirWow64 = 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\'
$uninstallPaths = $(Get-ChildItem $regUninstallDir).Name
if (Test-Path $regUninstallDirWow64) {
$uninstallPaths += $(Get-ChildItem $regUninstallDirWow64).Name
}
$uninstallPath = $uninstallPaths -match "Mozilla Firefox [\d\.]+ \([^\s]+ [a-zA-Z\-]+\)" | Select -First 1
return $uninstallPath
}
function GetLocale($installArguments) {
$availableLocales = Get-Content "$env:TEMP\chocolatey\Firefox\availableLocales.html"
# --- Get locale from installArgs if specified
$argumentMap = ConvertFrom-StringData $installArguments
$localeFromInstallArgs = $argumentMap.Item('l')
# ---
# --- Get already installed locale if available
$uninstallPath = GetUninstallPath($null)
$alreadyInstalledLocale = $uninstallPath -replace ".+\s([a-zA-Z\-]+)\)", '$1'
# ---
# --- Other locales
$systemLocaleAndCountry = (Get-Culture).Name
$systemLocaleTwoLetter = (Get-Culture).TwoLetterISOLanguageName
$fallbackLocale = 'en-US'
# ---
$locales = $localeFromInstallArgs, $alreadyInstalledLocale, $systemLocaleAndCountry, $systemLocaleTwoLetter, $fallbackLocale
foreach ($locale in $locales) {
$localeMatch = $availableLocales -match "os=win&lang=$locale`"" | Select -First 1
if ($localeMatch -and $locale -ne $null) {
break
}
}
return $locale
}
function AlreadyInstalled($version) {
$uninstallEntry = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Mozilla Firefox ${version}*"
$uninstallEntryWow64 = "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Mozilla Firefox ${version}*"
if ((Test-Path $uninstallEntry) -or (Test-Path $uninstallEntryWow64)) {
return $true
} else {
return $false
}
}
# ----------------------------------
$packageName = 'Firefox'
$fileType = 'exe'
$version = '36.0.1'
$urlFile = 'https://www.mozilla.org/en-US/firefox/all/'
$filePath = "$env:TEMP\chocolatey\$packageName"
try {
$alreadyInstalled = AlreadyInstalled($version)
if ($alreadyInstalled) {
Write-Host "Firefox $version is already installed."
} else {
if (-not (Test-Path $filePath)) {
New-Item -ItemType directory -Path $filePath
}
Get-ChocolateyWebFile 'locales list for Firefox' "$env:TEMP\chocolatey\$packageName\availableLocales.html" $urlFile
$locale = GetLocale($installArguments)
$url = "http://download.mozilla.org/?product=firefox-$version&os=win&lang=$locale"
Install-ChocolateyPackage $packageName $fileType '-ms' $url
}
} catch {
Write-ChocolateyFailure $packageName $($_.Exception.Message)
throw
}
2015-03-26 23:08:48,648 [INFO ] - Found 'chocolateyInstall.ps1':
2015-03-26 23:08:48,648 [INFO ] -
# ---------------- Function definitions ------------------
function GetUninstallPath () {{{{
$regUninstallDir = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\'
$regUninstallDirWow64 = 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\'
$uninstallPaths = $(Get-ChildItem $regUninstallDir).Name
if (Test-Path $regUninstallDirWow64) {{{{
$uninstallPaths += $(Get-ChildItem $regUninstallDirWow64).Name
}}}}
$uninstallPath = $uninstallPaths -match "Mozilla Firefox [\d\.]+ \([^\s]+ [a-zA-Z\-]+\)" | Select -First 1
return $uninstallPath
}}}}
function GetLocale($installArguments) {{{{
$availableLocales = Get-Content "$env:TEMP\chocolatey\Firefox\availableLocales.html"
# --- Get locale from installArgs if specified
$argumentMap = ConvertFrom-StringData $installArguments
$localeFromInstallArgs = $argumentMap.Item('l')
# ---
# --- Get already installed locale if available
$uninstallPath = GetUninstallPath($null)
$alreadyInstalledLocale = $uninstallPath -replace ".+\s([a-zA-Z\-]+)\)", '$1'
# ---
# --- Other locales
$systemLocaleAndCountry = (Get-Culture).Name
$systemLocaleTwoLetter = (Get-Culture).TwoLetterISOLanguageName
$fallbackLocale = 'en-US'
# ---
$locales = $localeFromInstallArgs, $alreadyInstalledLocale, $systemLocaleAndCountry, $systemLocaleTwoLetter, $fallbackLocale
foreach ($locale in $locales) {{{{
$localeMatch = $availableLocales -match "os=win&lang=$locale`"" | Select -First 1
if ($localeMatch -and $locale -ne $null) {{{{
break
}}}}
}}}}
return $locale
}}}}
function AlreadyInstalled($version) {{{{
$uninstallEntry = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Mozilla Firefox ${{{{version}}}}*"
$uninstallEntryWow64 = "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Mozilla Firefox ${{{{version}}}}*"
if ((Test-Path $uninstallEntry) -or (Test-Path $uninstallEntryWow64)) {{{{
return $true
}}}} else {{{{
return $false
}}}}
}}}}
# ----------------------------------
$packageName = 'Firefox'
$fileType = 'exe'
$version = '36.0.1'
$urlFile = 'https://www.mozilla.org/en-US/firefox/all/'
$filePath = "$env:TEMP\chocolatey\$packageName"
try {{{{
$alreadyInstalled = AlreadyInstalled($version)
if ($alreadyInstalled) {{{{
Write-Host "Firefox $version is already installed."
}}}} else {{{{
if (-not (Test-Path $filePath)) {{{{
New-Item -ItemType directory -Path $filePath
}}}}
Get-ChocolateyWebFile 'locales list for Firefox' "$env:TEMP\chocolatey\$packageName\availableLocales.html" $urlFile
$locale = GetLocale($installArguments)
$url = "http://download.mozilla.org/?product=firefox-$version&os=win&lang=$locale"
Install-ChocolateyPackage $packageName $fileType '-ms' $url
}}}}
}}}} catch {{{{
Write-ChocolateyFailure $packageName $($_.Exception.Message)
throw
}}}}
2015-03-26 23:08:48,742 [INFO ] -
Do you want to run the script?
NOTE: If you choose not to run the script, the installation will
fail.
Skip is an advanced option and most likely will never be wanted.
2015-03-26 23:08:48,742 [INFO ] - 1) yes
2015-03-26 23:08:48,742 [INFO ] - 2) no [Default - Press Enter]
2015-03-26 23:08:48,742 [INFO ] - 3) skip
2015-03-26 23:08:50,648 [DEBUG] - Calling command ['"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -NoLogo -ExecutionPolicy Bypass -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = '';[System.Threading.Thread]::CurrentThread.CurrentUICulture = ''; & import-module -name 'C:\ProgramData\chocolatey\helpers\chocolateyInstaller.psm1'; & 'C:\ProgramData\chocolatey\lib\Firefox\tools\chocolateyInstall.ps1'"']
2015-03-26 23:08:51,445 [DEBUG] - DEBUG: Posh version is 2.0
2015-03-26 23:08:51,570 [DEBUG] - DEBUG: Loading community extensions
2015-03-26 23:08:51,726 [DEBUG] - DEBUG: Running 'Get-ChocolateyWebFile' for locales list for Firefox with
2015-03-26 23:08:51,726 [INFO ] - url:'https://www.mozilla.org/en-US/firefox/all/',
2015-03-26 23:08:51,742 [INFO ] - fileFullPath:'C:\Users\dev\AppData\Local\Temp\chocolatey\Firefox\availableLocal
2015-03-26 23:08:51,742 [INFO ] - es.html', url64bit:'', checksum: '', checksumType: '', checksum64: '',
2015-03-26 23:08:51,742 [INFO ] - checksumType64: ''
2015-03-26 23:08:51,742 [DEBUG] - DEBUG: Running 'Get-ProcessorBits'
2015-03-26 23:08:51,758 [DEBUG] - DEBUG: CPU is 32 bit
2015-03-26 23:08:51,758 [DEBUG] - DEBUG: Running 'Get-WebHeaders' with
2015-03-26 23:08:51,758 [INFO ] - url:'https://www.mozilla.org/en-US/firefox/all/', userAgent: 'chocolatey
2015-03-26 23:08:51,758 [INFO ] - command line'
2015-03-26 23:08:51,851 [DEBUG] - DEBUG: Setting the UserAgent to 'chocolatey command line'
2015-03-26 23:08:51,851 [DEBUG] - DEBUG: Request Headers:
2015-03-26 23:08:51,867 [DEBUG] - DEBUG: 'Accept':'*/*'
2015-03-26 23:08:51,867 [DEBUG] - DEBUG: 'User-Agent':'chocolatey command line'
2015-03-26 23:08:52,461 [DEBUG] - DEBUG: Response Headers:
2015-03-26 23:08:52,461 [DEBUG] - DEBUG: 'X-Backend-Server':'bedrock1.webapp.phx1.mozilla.com'
2015-03-26 23:08:52,461 [DEBUG] - DEBUG: 'Vary':'Accept-Encoding'
2015-03-26 23:08:52,476 [DEBUG] - DEBUG: 'Keep-Alive':'timeout=5, max=902'
2015-03-26 23:08:52,476 [DEBUG] - DEBUG: 'Transfer-Encoding':'chunked'
2015-03-26 23:08:52,476 [DEBUG] - DEBUG: 'X-Robots-Tag':'noodp'
2015-03-26 23:08:52,476 [DEBUG] - DEBUG: 'X-Frame-Options':'DENY'
2015-03-26 23:08:52,492 [DEBUG] - DEBUG: 'X-Clacks-Overhead':'GNU Terry Pratchett'
2015-03-26 23:08:52,492 [DEBUG] - DEBUG: 'Connection':'Keep-Alive'
2015-03-26 23:08:52,492 [DEBUG] - DEBUG: 'X-Cache-Info':'cached'
2015-03-26 23:08:52,492 [DEBUG] - DEBUG: 'Cache-Control':'max-age=600'
2015-03-26 23:08:52,492 [DEBUG] - DEBUG: 'Content-Type':'text/html; charset=utf-8'
2015-03-26 23:08:52,508 [DEBUG] - DEBUG: 'Date':'Fri, 27 Mar 2015 03:05:57 GMT'
2015-03-26 23:08:52,508 [DEBUG] - DEBUG: 'Expires':'Fri, 27 Mar 2015 03:15:58 GMT'
2015-03-26 23:08:52,508 [DEBUG] - DEBUG: 'Server':'Apache'
2015-03-26 23:08:52,820 [INFO ] - Downloading locales list for Firefox 32 bit
2015-03-26 23:08:52,820 [INFO ] - from 'https://www.mozilla.org/en-US/firefox/all/'
2015-03-26 23:08:52,820 [DEBUG] - DEBUG: Running 'Get-WebFile' for
2015-03-26 23:08:52,820 [INFO ] - C:\Users\dev\AppData\Local\Temp\chocolatey\Firefox\availableLocales.html with
2015-03-26 23:08:52,836 [INFO ] - url:'https://www.mozilla.org/en-US/firefox/all/', userAgent: 'chocolatey
2015-03-26 23:08:52,836 [INFO ] - command line'
2015-03-26 23:08:52,836 [DEBUG] - DEBUG: Setting the UserAgent to 'chocolatey command line'
2015-03-26 23:08:55,242 [DEBUG] - DEBUG: Checking that
2015-03-26 23:08:55,242 [INFO ] - 'C:\Users\dev\AppData\Local\Temp\chocolatey\Firefox\availableLocales.html' is
2015-03-26 23:08:55,242 [INFO ] - the size we expect it to be.
2015-03-26 23:08:55,242 [DEBUG] - DEBUG: Verifying package provided checksum of '' for
2015-03-26 23:08:55,242 [INFO ] - 'C:\Users\dev\AppData\Local\Temp\chocolatey\Firefox\availableLocales.html'.
2015-03-26 23:08:55,258 [DEBUG] - DEBUG: Running 'Get-ChecksumValid' with
2015-03-26 23:08:55,258 [INFO ] - file:'C:\Users\dev\AppData\Local\Temp\chocolatey\Firefox\availableLocales.html'
2015-03-26 23:08:55,258 [INFO ] - , checksum: '', checksumType: ''
2015-03-26 23:08:55,336 [WARN ] - WARNING: Write-ChocolateyFailure is deprecated. If you are the package
2015-03-26 23:08:55,336 [INFO ] - maintainer, please use 'throw $_.Exception' instead.
2015-03-26 23:08:55,367 [ERROR] - Cannot bind argument to parameter 'StringData' because it is null.
2015-03-26 23:08:55,367 [ERROR] - At C:\ProgramData\chocolatey\helpers\functions\Write-ChocolateyFailure.ps1:24 c
2015-03-26 23:08:55,367 [ERROR] - har:8
2015-03-26 23:08:55,367 [ERROR] - + throw <<<< "$failureMessage"
2015-03-26 23:08:55,367 [ERROR] - + CategoryInfo : OperationStopped: (Cannot bind arg...use it is n
2015-03-26 23:08:55,383 [ERROR] - ull.:String) [], RuntimeException
2015-03-26 23:08:55,383 [ERROR] - + FullyQualifiedErrorId : Cannot bind argument to parameter 'StringData' b
2015-03-26 23:08:55,383 [ERROR] - ecause it is null.
2015-03-26 23:08:55,508 [DEBUG] - Command ['"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -NoLogo -ExecutionPolicy Bypass -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = '';[System.Threading.Thread]::CurrentThread.CurrentUICulture = ''; & import-module -name 'C:\ProgramData\chocolatey\helpers\chocolateyInstaller.psm1'; & 'C:\ProgramData\chocolatey\lib\Firefox\tools\chocolateyInstall.ps1'"'] exited with '1'
2015-03-26 23:08:55,523 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\Firefox.36.0.1\.sxs".
2015-03-26 23:08:55,523 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\Firefox.36.0.1\.pin".
2015-03-26 23:08:55,523 [DEBUG] - Attempting to delete directory "C:\ProgramData\chocolatey\lib-bad\Firefox".
2015-03-26 23:08:55,523 [ERROR] - firefox install not successful.
2015-03-26 23:08:55,539 [ERROR] - Error while running 'C:\ProgramData\chocolatey\lib\Firefox\tools\chocolateyInstall.ps1'.
See log for details.
2015-03-26 23:08:55,539 [DEBUG] - Moving 'C:\ProgramData\chocolatey\lib\Firefox'
to 'C:\ProgramData\chocolatey\lib-bad\Firefox'
2015-03-26 23:08:57,539 [WARN ] -
Chocolatey installed 0/1 package(s). 1 package(s) failed.
See the log for details.
2015-03-26 23:08:57,539 [ERROR] - Failures:
2015-03-26 23:08:57,539 [ERROR] - - firefox
2015-03-26 23:08:57,539 [DEBUG] - Exiting with 1
function GetLocale($installArguments) {
$availableLocales = Get-Content "$env:TEMP\chocolatey\Firefox\availableLocales.html"
# --- Get locale from installArgs if specified
$installArguments = if ($installArguments -ne $null) { $installArguments } else { "" }
$argumentMap = ConvertFrom-StringData $installArguments
$localeFromInstallArgs = $argumentMap.Item('l')
# ---
# --- Get already installed locale if available
$uninstallPath = GetUninstallPath($null)
$alreadyInstalledLocale = $uninstallPath -replace ".+\s([a-zA-Z\-]+)\)", '$1'
# ---
# --- Other locales
$systemLocaleAndCountry = (Get-Culture).Name
$systemLocaleTwoLetter = (Get-Culture).TwoLetterISOLanguageName
$fallbackLocale = 'en-US'
# ---
$locales = $localeFromInstallArgs, $alreadyInstalledLocale, $systemLocaleAndCountry, $systemLocaleTwoLetter, $fallbackLocale
foreach ($locale in $locales) {
$localeMatch = $availableLocales -match "os=win&amp;lang=$locale`"" | Select -First 1
if ($localeMatch -and $locale -ne $null) {
break
}
}
return $locale
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment