-
Notifications
You must be signed in to change notification settings - Fork 903
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
Please persist package installation parameters for uninstall scripts #1479
Comments
@jnm2 remembered arguments are only provided to upgrades. So we'd need somewhere to store those package parameters for a package outside of that - then we'd need to make sure it is encrypted as it could contain passwords. |
Agreed, but it's probably not user friendly to install something to a location outside the packaging folders if you don't have a way to tracking how to uninstall it. Typically folks use https://github.com/chocolatey/choco/issues/1303#issuecomment-303804561 goes over packaging patterns for zip installations. That will end up in docs. |
Since I want to follow the standard of adding the installation directory to the machine path by default rather than the user path, there's no guarantee that
Thus this request.
😭 good point. CryptProtectData?
If you were installing this exe utility, what would your preference be for the default installation path and addition to the machine/user/none path? |
You do know we already store the switches and things passed?
|
You might explain somewhere what "this exe utility" is exactly. |
Typically for an exe utility, I just have it be in the package and let choco generate a shim into the bin folder. |
Just saw this. It's a good point. SysInternals package is a good example of the one that does that, but it uses |
So you technically should be good just running |
Still need to write the readme before I can package. 😳 Shims don't work because it thinks the shim is the shell and executes it elevated which causes infinite recursion. I could try to make it work, but in principle this utility is incredibly light-weight on purpose. Going through your current shims kills that value proposition because your shims initialize the CLR (last I checked). |
Yikes! |
This utility sounds very cool - why not just call it sudo? |
I'm open to suggestions. But it's quite something when you type
Cause Windows' term is 'elevation'? Maybe I should. I'll probably have to talk to a different existing package owner. |
Where's the docs for #358? Title sounds like my issue is an exact duplicate for it. |
Just as a note, have you seen this tool? http://code.kliu.org/misc/elevate/ |
I don't recall that one, thanks! |
Not sure if it's the same author/version, but I use this all the time and it's already available in the Chocolatey community repository: https://chocolatey.org/packages/elevate |
Huh, apparently the contents of the package changed since I last saw it? https://chocolatey.org/packages/elevate#comment-3439057341 |
Having access to package params in the uninstaller will really help with the retroarch package. Knowing when I can and should clean up out-of-tools shims and desktop icon would be very nice for users with the params I'm adding to the package. |
Adds the ability for implementations of uninstall_run to reset the config in ChocolateyPackageService via the resetConfigAction. This will be required to prevent an issue similar to chocolatey#1443 for uninstall, once useRememberedArgumentsForUninstall is added in.
This renames the set_package_config_for_upgrade to a more generic name, and adds in another parameter to prepare for setting remembered args for uninstall as well as upgrade
Similar to the UseRememberedArgumentsForUpgrade feature, this will be used to toggle if the remembered arguments are used during uninstall.
This adds the ability for the remembered argument to be reused for uninstalls. It can be controlled via the userememberedargs and ignorerememberedargs arguments, or via the previously added feature.
This renames the set_package_config_for_upgrade to a more generic name, and adds in another parameter to prepare for setting remembered args for uninstall as well as upgrade. It also updates the logging and comments to make them generic for both upgrades and uninstalls.
Similar to the UseRememberedArgumentsForUpgrade feature, this will be used to toggle if the remembered arguments are used during uninstall.
This adds the ability for the remembered argument to be reused for uninstalls. It can be controlled via the userememberedargs and ignorerememberedargs arguments, or via the previously added feature.
This adds the ability for the remembered argument to be reused for uninstalls. It can be controlled via the userememberedargs and ignorerememberedargs arguments, or via the previously added feature.
This brings out the functionality from the set_package_config_for_upgrade method to a more generic name, and adds in another parameter to prepare for setting remembered args for uninstall as well as upgrade. It also updates the logging and comments to make them generic for both upgrades and uninstalls. An alias/forwarding method is added for backwards compatibility.
Similar to the UseRememberedArgumentsForUpgrade feature, this will be used to toggle if the remembered arguments are used during uninstall.
This adds the ability for the remembered argument to be reused for uninstalls. It can be controlled via the userememberedargs and ignorerememberedargs arguments, or via the previously added feature.
This would be really handy for packages like tor-browser which just unpack files to some directory and that also support |
You can persist the information to disk on install and read it back on uninstall. I do this for PowerShell module packages I maintain. |
Yeah, you could so some workarounds, but that's not standarized and won't work for e.g. currently installed software. |
This brings out the functionality from the set_package_config_for_upgrade method to a more generic name, and adds in another parameter to prepare for setting remembered args for uninstall as well as upgrade. It also updates the logging and comments to make them generic for both upgrades and uninstalls. An alias/forwarding method is added for backwards compatibility.
Similar to the UseRememberedArgumentsForUpgrade feature, this will be used to toggle if the remembered arguments are used during uninstall.
This adds the ability for the remembered argument to be reused for uninstalls. It can be controlled via the userememberedargs and ignorerememberedargs arguments, or via the previously added feature.
This brings out the functionality from the set_package_config_for_upgrade method to a more generic name, and adds in another parameter to prepare for setting remembered args for uninstall as well as upgrade. It also updates the logging and comments to make them generic for both upgrades and uninstalls. An alias/forwarding method is added for backwards compatibility.
Similar to the UseRememberedArgumentsForUpgrade feature, this will be used to toggle if the remembered arguments are used during uninstall.
This adds the ability for the remembered argument to be reused for uninstalls. It can be controlled via the userememberedargs and ignorerememberedargs arguments, or via the previously added feature.
This brings out the functionality from the set_package_config_for_upgrade method to a more generic name, and adds in another parameter to prepare for setting remembered args for uninstall as well as upgrade. It also updates the logging and comments to make them generic for both upgrades and uninstalls. An alias/forwarding method is added for backwards compatibility.
Similar to the UseRememberedArgumentsForUpgrade feature, this will be used to toggle if the remembered arguments are used during uninstall.
This adds the ability for the remembered argument to be reused for uninstalls. It can be controlled via the userememberedargs and ignorerememberedargs arguments, or via the previously added feature.
Based on the changes in the associated PR's for this issue, I am going to have to bump this issue from the 2.3.0 release, and instead look at this again in the 2.4.0. The suggested changes to the INuGetService mean that this would essentially be a breaking change, that would need a corresponding change in the Chocolatey Licensed Extension, which we haven't planned to do at the minute. Instead of holding up the release of 2.3.0, we will look to do the work in this issue in a later release. Apologies for any inconvenience that this causes. |
Imagine you're not relying on an MSI; you're just bin-deploying to a default (overridable) location and adding an entry to %path% for the machine (overridable to 'user' or 'none').
(Even if this utility worked when shimmed, there's still the question of the configurable installation location.)
When the user types
choco uninstall thepackage
, how shouldchocolateyUninstall.ps1
find the correct installation folder to delete and the correct path variable (machine/user/none) to modify?I would have expected
Get-PackageParameters
to be persisted by Chocolatey and provided to the uninstall script. It makes sense to allow them to be individually overridden by passing--params
tochoco uninstall
, but it doesn't make sense for them to start null and thus require the user to duplicate the exact parameters used previously if the user wants a successful uninstall. That's not very user-friendly.Also, I don't want to have to author an MSI just to have a decently reliable package uninstaller. (I notice that the only other package I can find that allows a user/machine switch only uninstalls the machine path.)
Is there a reason we can't make this just start working out of the box? I'd expect this to apply to uninstalls for sure; probably upgrades as well. Seems like the obvious place to store the
--params
string is the same place that keeps a record that the package is installed.The text was updated successfully, but these errors were encountered: