Closed felipecrs closed 3 years ago
I was not able to test it, though.
Also, there is an issue with the uninstallation:
❯ choco uninstall flutter ⚡ 10:28:18
Chocolatey v0.10.15
Uninstalling the following packages:
flutter
flutter v1.22.2
ERROR: The term '' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
flutter uninstall not successful.
Error while running 'C:\ProgramData\chocolatey\lib\flutter\tools\chocolateyuninstall.ps1'.
See log for details.
flutter not uninstalled. An error occurred during uninstall:
flutter uninstall not successful.
Chocolatey uninstalled 0/1 packages. 1 packages failed.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
Failures
- flutter (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\flutter\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.
I tried to fix the uninstallation issue with https://stackoverflow.com/a/39012021/12156188.
@Starz0r any tips on how to test?
@felipecrs If you want to test you can "compile" the package, then use choco install .\package.nupkg
to test locally, but I recommend a Windows Server 2012 virtual machine.
As for the uninstallation issue I opted for a different solution of just not attempting to removing the variable from the PATH as it's very finicky. Chocolatey in the future is supposedly going to support a native method of removing variables from PATH, but for now, this is what I'm going to opt for, so I don't end up disastrously deleting the entire PATH variable by accident.
Regardless, thank you for attempting this.
Fixes #2.