-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
Add uninstall_depends_on_default_install_location
caveat
#8210
Conversation
uninstall_depends_on_default_install_location
caveat
Welcome to the core! I have gifted you a purple label. I don't worry about the length per se, but I do fret about the term "install". It's probably correct here, but I am trying to separate the "install" and "activate" concepts, and something is nagging at me. Conceptually, this is coupled to uninstall_preflight do
warn_unless_exists '/Applications/Blast2GO'
end or even # warns if delete isn't satisfied
uninstall :delete_warn => '/Applications/Blast2GO' and by the way, one of the reasons I wanted to move to Ruby 2.0 was to try some nutty things along the lines of uninstall :delete => '/Applications/Blast2GO'.but_warn Edit: |
Thank you!
That was actually part of the decision to make it a |
I see. Yet Returning to interface, installer :manual => '/Applications/Blast2GO',
:recommend_defaults => true |
I definitely like that solution best. I’ll likely need help with that, though. I’ll try to take a look at it soon to see; I believe I know where to look, but I’m not yet sure as to how to implement it. |
Good. There's another advantage: Currently the The install/uninstall implementation is entirely contained in |
How can I help you move forward here? Should I update the DSL and put a comment where the new logic should live? |
I haven’t forgotten about this, but I haven’t looked into it like I should mainly on account of the holidays (have a visiting friend) and I’ll need to sit down a bit with the issue, since it’s somewhat new territory. However, since the feature is non-critical and it should be contained in those two relatively small files, I do want to try and take a stab at it. I appreciate your offer for help and I’ll likely need it; I’m just waiting a few more days to settle down and see how far I can get. |
No hurry of course, just wanted to make sure I'm not blocking. Grab me on IRC any time. |
No longer relevant due to #13201. |
This adds a
uninstall_depends_on_default_install_location
caveat, as well as changing three casks to use it. Thought descriptive, it is a verbose name, so ideas to make it shorter without losing clarity are very welcome.This comes in the context of
battle-net.rb
andvuze.rb
. Those casks use an installer viainstaller :manual
that allows the user to pick an install location. To uninstall these, we need to delete files, but we cannot know where they are if the user picked an installation directory other than the default one. For that we currently use a caveat, but I bet there are many more casks that could benefit from it and do not yet have it, hence creating something specific should be beneficial.should simply output
If you pick an installation directory other than {default_install_path} when installing this cask, you will need to uninstall it manually
, with{default_install_path}
defaulting to/Applications
if no argument is given. Maybe there aren’t cases where/Applications
isn’t the default, but it doesn’t hurt to have the option there.In a way, a better solution would be to automatically detect where an application is by their application bundle, but that would not work in cases like
blast2go.rb
since it would still leave its directory (and possibly sibling files) intact. It would still be nice to be able to do this on the casks that need nothing more, but that is for another issue.Naturally, this needs review from the more experienced Ruby developers among you.