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-ChocolateyPackage ignores -File value when -FileType is MSI #229

Open
JonnMsft opened this issue Apr 8, 2015 · 10 comments
Open

Comments

@JonnMsft
Copy link

JonnMsft commented Apr 8, 2015

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

@ferventcoder
Copy link
Member

Thanks for reporting this. I think this needs to be fixed.

@JonnMsft
Copy link
Author

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.

@ferventcoder
Copy link
Member

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.

@JonnMsft
Copy link
Author

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.

@gep13
Copy link
Member

gep13 commented May 11, 2015

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.

@ferventcoder
Copy link
Member

This is chocolatey-archive/chocolatey#286

@ferventcoder
Copy link
Member

@JonnMsft The workaround is to pass it as the first argument in the args.

@ferventcoder
Copy link
Member

@pauby
Copy link
Member

pauby commented Dec 19, 2023

@gep13 can you confirm if this issue is still a problem in the PowerShell helper?

@pauby pauby changed the title Uninstall-ChocolateyPackage.ps1 ignores -File value when -FileType is MSI Uninstall-ChocolateyPackage ignores -File value when -FileType is MSI Sep 25, 2024
@corbob corbob modified the milestones: Future, 3.0.0 Oct 29, 2024
@corbob
Copy link
Member

corbob commented Oct 29, 2024

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#.

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

No branches or pull requests

5 participants