zunderscore / chocolatey-packages

Chocolatey package build scripts
MIT License
1 stars 1 forks source link

Uninstalling `cascadiacode` and `cascadiacodepl` packages error 1. #4

Closed ptanmay143 closed 4 years ago

ptanmay143 commented 4 years ago

choco uninstall cascadiacode cascadiacodepl exits with error code 1 leading to the uninstallation being unsuccessful.

Here is the output:

Chocolatey v0.10.15
Uninstalling the following packages:
cascadiacode;cascadiacodepl

cascadiacode v2005.15
Uninstalling legacy Cascadia Code font...
WARNING: File Path 'C:\Windows\Fonts\Cascadia.ttf' does not exist!
ERROR: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Error uninstalling legacy Cascadia Code font
cascadiacode uninstall not successful.
Error while running 'C:\ProgramData\chocolatey\lib\cascadiacode\tools\chocolateyuninstall.ps1'.
See log for details.
cascadiacode not uninstalled. An error occurred during uninstall:
cascadiacode uninstall not successful.

cascadiacodepl v2005.15
Uninstalling legacy Cascadia Code PL font...
WARNING: File Path 'C:\Windows\Fonts\CascadiaPL.ttf' does not exist!
ERROR: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Error uninstalling legacy Cascadia Code PL font
cascadiacodepl uninstall not successful.
Error while running 'C:\ProgramData\chocolatey\lib\cascadiacodepl\tools\chocolateyuninstall.ps1'.
See log for details.
cascadiacodepl not uninstalled. An error occurred during uninstall:
cascadiacodepl uninstall not successful.

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

Failures
- cascadiacodepl (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\cascadiacodepl\tools\chocolateyuninstall.ps1'.
See log for details.
- cascadiacode (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\cascadiacode\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.

Info: Process exited with code 1

I believe this has to do something with the legacy font not being present when uninstalling. From the install scripts and uninstall scripts, I have yet to understand what this legacy font means. If this a filename error, please guide me on how to fix this. I will also be happy to send a PR to fix this for all users of this package.

ptanmay143 commented 4 years ago

Commenting out the ErrorActionPreference in the chocolateyuninstall.ps1 file resulted in a removal of the font from the Windows Font library and the fonts folder. I would consider this a clean uninstallation too.