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

Proposed: Chocolatey uninstall extension #214

Closed
dtgm opened this issue May 18, 2016 · 11 comments
Closed

Proposed: Chocolatey uninstall extension #214

dtgm opened this issue May 18, 2016 · 11 comments

Comments

@dtgm
Copy link
Contributor

dtgm commented May 18, 2016

f7fe281

Proposed .
package id chocolatey-uninstall.extension
function Get-UninstallRegistryKey

More functions could be included, but initially I am working at resolving issue chocolatey/choco#739, originally logged at dtgm/chocolatey-packages#92

Summarized again here: If a program writes binary data into a registry key, but is not using correct type, Get-ItemProperty fails. I have only encountered a few programs having this issue; the problem exists in >=netbeans-8.0 and other programs by netbeans org. Unfortunately, the presence of these programs will cause this routine used by choco to fail unless the problem registry key is removed.

To keep software from accidentally breaking choco uninstall scripts, the plan is Get-UninstallRegistryKey aims to replace a portion of the current chocolateyUninstall.ps1 template https://github.com/chocolatey/choco/blob/7ef16d6003dd3c689156af20d3ce329c85d1cd76/src/chocolatey/infrastructure.app/templates/ChocolateyUninstallTemplate.cs#L57-L63 and would be required to be used in all packages to prevent any package using the old method from breaking.

The solution within the Get-UninstallRegistryKey could be incorporated into my uninstall scripts and the template generated by choco new. But it seems like it would add too much code so it seems proper to include as an extension instead. Please advise on naming of function or package id since this solution would end up being present in 1,000+ packages.

@dtgm
Copy link
Contributor Author

dtgm commented May 18, 2016

Related discussion about preferred naming of extensions and functions #128

@gep13
Copy link
Member

gep13 commented May 18, 2016

@dtgm I think this would be a good addition, and would happily accept a PR for this :-)

In terms of naming, I think what you have suggested, i.e. choco-uninstall.extension makes sense. To me, this says exactly what it does. It is an extension, for chocolatey, that deals within uninstallation. Within this extension, one or more helper methods can be created to help with the process of uninstallation.

@dtgm
Copy link
Contributor Author

dtgm commented May 18, 2016

It's already up. Take a look. f7fe281

I named it chocolatey-uninstall.extension to follow your lead, but I see you haven't pushed your extension yet so we could change to using choco- like choco-uninstall.extension (less typing)

@gep13
Copy link
Member

gep13 commented May 18, 2016

@dtgm yeah, I need to finish off that extension, got distracted with other stuff. Can't actually remember where that is at. Need to look at it again soon.

@dtgm
Copy link
Contributor Author

dtgm commented May 18, 2016

@gep13
Copy link
Member

gep13 commented May 18, 2016

@dtgm Sorry, didn't mean physically where the files are, more, what I still need to do with it :-)

In terms of naming, I think chocolatey-uninstall.extension makes sense.

This would mean that we would have:

chocolatey.extension
chocolatey-fosshub.extension
chocolatey-uninstall.extension

So we would have some consistency.

@dtgm
Copy link
Contributor Author

dtgm commented May 18, 2016

chocolatey.extension ? Are those built-in helpers?

@gep13
Copy link
Member

gep13 commented May 18, 2016

That is the official extension that ships as part of the Professional license. It brings in the features to chocolatey that you get once you buy a license.

@ferventcoder
Copy link
Contributor

Left notes on the commit - the file name is too deep. It will work but it's way too redundant.

@dtgm
Copy link
Contributor Author

dtgm commented May 18, 2016

Total affected packages needing to transition to using this extension is probably at least 728 as of 2016-04-23 (plus new packages added in last month)

At least 102 were using the template provided by choco new

@gep13
Copy link
Member

gep13 commented Oct 7, 2016

I think we can go ahead and close this one.

@gep13 gep13 closed this as completed Oct 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants