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

Uninstall-ChocolateyZipPackage failing with Path error #1550

Closed
ggarra13 opened this issue Apr 24, 2018 · 2 comments
Closed

Uninstall-ChocolateyZipPackage failing with Path error #1550

ggarra13 opened this issue Apr 24, 2018 · 2 comments

Comments

@ggarra13
Copy link

ggarra13 commented Apr 24, 2018

What You Are Seeing?

Uninstall-ChocolateyZipPackage is failing with:

ERROR: Cannot bind argument to parameter 'Path' because it is null.

What is Expected?

The command should work as documented.

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

I upgraded to chocolatey 0.10.10.

Output Log

Chocolatey v0.10.10
Chocolatey is running on Windows v 6.3.9600.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" uninstall --debug --verbose mrviewer
Received arguments: uninstall --debug --verbose mrviewer
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.org/api/v2/' 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='uninstall'|
CacheLocation='C:\Users\Gonzalo\AppData\Local\Temp\chocolatey'|
ContainsLegacyPackageInstalls='True'|
CommandExecutionTimeoutSeconds='2700'|WebRequestTimeoutSeconds='30'|
Sources='https://chocolatey.org/api/v2/'|SourceType='normal'|
Debug='True'|Verbose='True'|Trace='False'|Force='False'|Noop='False'|
HelpRequested='False'|UnsuccessfulParsing='False'|RegularOutput='True'|
QuietOutput='False'|PromptForConfirmation='False'|
AcceptLicense='False'|
AllowUnofficialBuild='False'|Input='mrviewer'|AllVersions='False'|
SkipPackageInstallProvider='False'|PackageNames='mrviewer'|
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='6.3.9600.0'|
Information.PlatformName='Windows 8.1'|
Information.ChocolateyVersion='0.10.10.0'|
Information.ChocolateyProductVersion='0.10.10'|
Information.FullName='choco, Version=0.10.10.0, Culture=neutral, PublicKeyToken=79d02ea9cad655eb'|

Information.Is64BitOperatingSystem='True'|
Information.Is64BitProcess='True'|Information.IsInteractive='True'|
Information.UserName='Gonzalo'|
Information.UserDomainName='gga-desktop1'|
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:ChocolateyUninstallCommand - Normal Run Mode _
Uninstalling the following packages:
mrviewer
Running list with the following filter = ''
--- Start of List ---
autohotkey.portable 1.1.24.04
checksum 0.1.0
chocolatey 0.10.10
chocolatey-core.extension 1.3.3
mrviewer 4.1.0
notepadplusplus.install 7.5.6
--- End of List ---
Backing up existing mrviewer prior to operation.
Moving 'C:\ProgramData\chocolatey\lib\mrviewer'
 to 'C:\ProgramData\chocolatey\lib-bkp\mrviewer'
Attempting to create directory "C:\ProgramData\chocolatey\lib\mrviewer".
Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\mrviewer\mrViewer-v4.1.0-Windows-64.zip.txt"
 to "C:\ProgramData\chocolatey\lib\mrviewer\mrViewer-v4.1.0-Windows-64.zip.txt".
Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\mrviewer\mrviewer.nupkg"
 to "C:\ProgramData\chocolatey\lib\mrviewer\mrviewer.nupkg".
Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\mrviewer\mrviewer.nuspec"
 to "C:\ProgramData\chocolatey\lib\mrviewer\mrviewer.nuspec".
Attempting to create directory "C:\ProgramData\chocolatey\lib\mrviewer\tools".
Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\mrviewer\tools\chocolateyinstall.ps1"
 to "C:\ProgramData\chocolatey\lib\mrviewer\tools\chocolateyinstall.ps1".
Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\mrviewer\tools\chocolateyuninstall.ps1"
 to "C:\ProgramData\chocolatey\lib\mrviewer\tools\chocolateyuninstall.ps1".
Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\mrviewer\tools\chocolateyuninstall.ps1~"
 to "C:\ProgramData\chocolatey\lib\mrviewer\tools\chocolateyuninstall.ps1~".
Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\mrviewer\tools\LICENSE.txt"
 to "C:\ProgramData\chocolatey\lib\mrviewer\tools\LICENSE.txt".
Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\mrviewer\tools\VERIFICATION.txt"
 to "C:\ProgramData\chocolatey\lib\mrviewer\tools\VERIFICATION.txt".
Capturing package files in 'C:\ProgramData\chocolatey\lib\mrviewer'
 Found 'C:\ProgramData\chocolatey\lib\mrviewer\mrViewer-v4.1.0-Windows-64.zip.txt'
  with checksum '73650BE9387D63A49613126D6DD7F4A5'
 Found 'C:\ProgramData\chocolatey\lib\mrviewer\mrviewer.nupkg'
  with checksum 'FCDDCA46F06B58797085DF623C0D2B5F'
 Found 'C:\ProgramData\chocolatey\lib\mrviewer\mrviewer.nuspec'
  with checksum 'D4842482649600A7ED7A5DD5F2B98CFC'
 Found 'C:\ProgramData\chocolatey\lib\mrviewer\tools\chocolateyinstall.ps1'
  with checksum '37002889AC92EEF7092AF80A91206EE5'
 Found 'C:\ProgramData\chocolatey\lib\mrviewer\tools\chocolateyuninstall.ps1'
  with checksum 'D114F19D4FA93F6EB079CE7D08F2B7EA'
 Found 'C:\ProgramData\chocolatey\lib\mrviewer\tools\chocolateyuninstall.ps1~'
  with checksum '280455020C7EB164C87EC77A09C05BEE'
 Found 'C:\ProgramData\chocolatey\lib\mrviewer\tools\LICENSE.txt'
  with checksum 'B234EE4D69F5FCE4486A80FDAF4A4263'
 Found 'C:\ProgramData\chocolatey\lib\mrviewer\tools\VERIFICATION.txt'
  with checksum '667B5EA22F95B10C063DE4326507CF38'
Attempting to copy "C:\ProgramData\chocolatey\lib\mrviewer\tools\chocolateyuninstall.ps1"
 to "C:\ProgramData\chocolatey\lib\mrviewer\tools\chocolateyuninstall.ps1.4.1.0".
[NuGet] Uninstalling 'mrviewer 4.1.0'.

mrviewer v4.1.0
Setting installer args for mrviewer
Setting package parameters for mrviewer
Contents of 'C:\ProgramData\chocolatey\lib\mrviewer\tools\chocolateyuninstall.ps1':



$ErrorActionPreference = 'Stop';

$softVersion = '4.1.0'

$osBitness = Get-ProcessorBits

$packageName = 'mrViewer'
$softwareName = 'mrViewer*'
$installerType = 'ZIP'
$toolsDir   = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"

$fileLocation = "${packageName}-v${softVersion}-Windows-${osBitness}.zip"


$validExitCodes = @(0, 3010, 1605, 1614, 1641)
if ($installerType -ne 'MSI') {
  $validExitCodes = @(0)
}


If ( $osBitness -Match "32" )
{
        $programFiles = $env:ProgramFiles
}
Else
{
        $programFiles = $env:ProgramW6432
}


Uninstall-ChocolateyZipPackage -PackageName "$packageName" -ZipFileName "$fileLocation"

$DesktopPath = [Environment]::GetFolderPath("CommonDesktopDirectory")

$StartMenu = [Environment]::GetFolderPath("CommonStartMenu")
$StartPath = Join-Path "${StartMenu}" "Programs"

Remove-Item -Path  "${DesktopPath}/${packageName}-${osBitness} v${softVersion}.lnk"
Remove-Item -Path "${StartPath}/${packageName}-${osBitness} v${softVersion}.lnk"

$target = Join-Path "$programFiles" "${packageName}-v${softVersion}-Windows-${osBitness}/bin"


$PathToRemove = $target
foreach ($path in [Environment]::GetEnvironmentVariable("PATH","Machine").split(';'))
{
  If ($Path)
  {
    If (($path -ine "$PathToRemove") -AND ($path -ine "$PathToRemove\"))
    {
      [string[]]$Newpath += "$path"
    }
  }
}
$AssembledNewPath = ($newpath -join(';')).trimend(';')

[Environment]::SetEnvironmentVariable("PATH",$AssembledNewPath,"Machine")

$target = Join-Path "$programFiles" "${packageName}-v${softVersion}-Windows-${osBitness}"

Remove-Item -Recurse -Force -Path "$target"

Calling built-in PowerShell host with ['[System.Threading.Thread]::CurrentThread.CurrentCulture = '';[System.Threading.
hread]::CurrentThread.CurrentUICulture = ''; & import-module -name 'C:\ProgramData\chocolatey\helpers\chocolateyInstall
r.psm1'; & 'C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1' -packageScript 'C:\ProgramData\chocolatey\lib
mrviewer\tools\chocolateyuninstall.ps1' -installArguments '' -packageParameters ''']
Redirecting System.Management.Automation.resources, Version=3.0.0.0, Culture=es-ES, PublicKeyToken=31bf3856ad364e35, re
uested by ''
Host version is 4.0, PowerShell Version is '4.0' 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 mrviewer v4.1.0 with packageScript 'C:\ProgramData\chocolatey\lib\mrviewer\tools\c
ocolateyuninstall.ps1', packageFolder:'C:\ProgramData\chocolatey\lib\mrviewer', installArguments: '', packageParameters
 '',
Running 'C:\ProgramData\chocolatey\lib\mrviewer\tools\chocolateyuninstall.ps1'
Running Get-ProcessorBits
Running Uninstall-ChocolateyZipPackage -packageName 'mrViewer' -zipFileName 'mrViewer-v4.1.0-Windows-64.zip'
ERROR: Cannot bind argument to parameter 'Path' because it is null.
 at Uninstall-ChocolateyZipPackage, C:\ProgramData\chocolatey\helpers\functions\UnInstall-ChocolateyZipPackage.ps1: lin
 71
at <ScriptBlock>, C:\ProgramData\chocolatey\lib\mrviewer\tools\chocolateyuninstall.ps1: line 34
at <ScriptBlock>, C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1: line 48
at <ScriptBlock>, <No file>: line 1
Built-in PowerShell host called with ['[System.Threading.Thread]::CurrentThread.CurrentCulture = '';[System.Threading.T
read]::CurrentThread.CurrentUICulture = ''; & import-module -name 'C:\ProgramData\chocolatey\helpers\chocolateyInstalle
.psm1'; & 'C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1' -packageScript 'C:\ProgramData\chocolatey\lib\
rviewer\tools\chocolateyuninstall.ps1' -installArguments '' -packageParameters '''] exited with '-1'.
Calling command ['"C:\Windows\System32\shutdown.exe" /a']
Command ['"C:\Windows\System32\shutdown.exe" /a'] exited with '1116'
mrviewer uninstall not successful.
Error while running 'C:\ProgramData\chocolatey\lib\mrviewer\tools\chocolateyuninstall.ps1'.
 See log for details.
mrviewer not uninstalled. An error occurred during uninstall:
 mrviewer uninstall not successful.
Environment Vars (like PATH) have changed. Close/reopen your shell to
 see the changes (or in powershell/cmd.exe just type `refreshenv`).
Logging of values is not turned on by default because it
 could potentially expose sensitive data. If you understand the risk,
 please see `choco feature -h` for information to turn it on.
The following values have been added/changed (may contain sensitive data):
  * PATHEXT='[REDACTED]' (User)

Chocolatey uninstalled 0/1 packages. 1 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Failures
 - mrviewer (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\mrviewer\tools\chocolateyuninstall.ps1'.
 See log for details.

If a package uninstall is failing and/or you've already uninstalled the
 software outside of Chocolatey, you can attempt to run the command
 with `-n` to skip running a chocolateyUninstall script, additionally
 adding `--skip-autouninstaller` to skip an attempt to automatically
 remove system-installed software. This will only remove the packaging
 files and not things like software installed to Programs and Features.

If a package is failing because it is a dependency of another package
 or packages, then you may first need to consider if it needs removed
 as it is typically installed as a dependency for a reason. If you
 decide that you still want to remove it, head into
 `$env:ChocolateyInstall\lib` and find the package folder you want
 removed. Then delete the folder for the package. This option should
 only be used as a last resort.

Sending message 'PostRunMessage' out if there are subscribers...
Exiting with -1
PS D:\code\applications\mrViewer\chocolatey\mrViewer>

This is the same bug as #1546

@ggarra13
Copy link
Author

ggarra13 commented Apr 24, 2018

The bug is the following in Uninstall-ChocolateyZipPackage:

$zipContentFile=(join-path $packagelibPath $zipFileName) + "Install.txt"

if(-Not (Test-Path -Path $zipFileContentPath)) {
$zipContentFile=(Join-Path $packagelibPath -ChildPath $zipFileName) + ".txt"
}

$zipFileContentPath is unknown and empty. It should be $zipContentFile from above.

@rashidmazhar
Copy link

rashidmazhar commented May 28, 2018

I am also facing the same error while uninstalling the Zip package which is simply unpacked in C:\ directory and just a desktop link.
Following is my uninstallation PS Script.

$process = Get-Process sts -ErrorAction SilentlyContinue
if ($process) {
Stop-Process $process
Write-Output "Process stopped, waiting for 5 sec."
Start-Sleep -s 5
}

$packageName = 'sts'
UnInstall-ChocolateyZipPackage $packageName 'sts'
Uninstall-DesktopLinkAndPinnedTaskBarItem "sts"

ERROR: Cannot bind argument to parameter 'Path' because it is null.
sts uninstall not successful.
Error while running 'C:\ProgramData\chocolatey\lib\sts\tools\chocolateyuninstall.ps1'.
See log for details.
sts not uninstalled. An error occurred during uninstall:
sts uninstall not successful.

Chocolatey uninstalled 0/1 packages. 1 packages failed.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Failures

  • sts (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\sts\tools\chocolateyuninstall.ps1'.
    See log for details.

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

Successfully merging a pull request may close this issue.

3 participants