-
Notifications
You must be signed in to change notification settings - Fork 902
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-ChocolateyPackage ignores -File value when -FileType is MSI #229
Comments
Thanks for reporting this. I think this needs to be fixed. |
Thanks. This does put me in a bit of a pickle though, I want to keep back-compat in my package. I don't know how many packages will have this issue. |
I am guessing it is quite a few - also autouninstaller is meant to remove the need for this, if the only reason you would have that uninstall script is to uninstall program. However autouninstaller is still considered a preview. |
I'm willing to try out autouninstaller in a v1.005 package, if that is supported. Not sure exactly how to do that (this is my first Chocolatey package). As for Uninstall-ChocolateyPackage.ps1, it's up to you whether to deprecate this or how to handle it. |
The auto-uninstaller is a feature that you can turn on within the Chocolatey Client. See here: https://github.com/chocolatey/choco/wiki/CommandsFeature For more information. |
@JonnMsft The workaround is to pass it as the first argument in the args. |
@gep13 can you confirm if this issue is still a problem in the PowerShell helper? |
We have looked at this, and will add this to 3.0.0 as part of #3477 where we plan to convert the PowerShell functions to C#. |
I'm pretty sure that line 65
$msiArgs = "/x"
should be something more like
$msiArgs = "/x $file"
Otherwise clients have to do something like
$env:chocolateyInstallOverride = "true"
$env:chocolateyInstallArguments = "$path /quiet"
Write-Debug "The current version of Chocolatey appears to contain a bug in Uninstall-ChocolateyPackage,"
Write-Debug "where the -File parameter value is ignored when -FileType is MSI."
Write-Debug "I bypass this by setting"
Write-Debug '$env:chocolateyInstallOverride = "true"'
Write-Debug '$env:chocolateyInstallArguments = "$path /quiet"'
Write-Debug "CType\chocolateyUninstall.ps1: running Uninstall-ChocolateyPackage -PackageName CType -FileType MSI
The text was updated successfully, but these errors were encountered: