Description
Introduction:
Since the inception of Homebrew-Cask, we mostly (some have slipped through on occasion, and some are still present, even) haven’t allowed casks to call GUIs when installing and uninstalling, in the name of automation.
However, in some cases it actually prevents desirable automation: not auto-opening installer manual:
targets and not using tool-provided uninstallers come to mind.
I postulate most users would actually prefer these GUI actions to be called automatically in most cases, the most notable exception being when reinstalling a system (since a bunch of casks are installed).
It also seems more in line with the goal of #13201 of making our automation as close to the manual installation as possible.
Proposal:
Change policy and start allowing GUIs to be called, but only allow GUIs as the last resort.
When calling a GUI is necessary for an action, allow the user to pick if a GUI will be called or the action will be interrupted. Make not allowing GUIs the default, for backwards compatibility.
Implement --allow-gui
as a flag to be given at runtime or in HOMEBREW_CASK_OPTS
. It means “If this action needs a GUI, run it; if not, output a warning on how to proceed manually” (i.e. the same instructions we have now).
Rename installer manual:
to installer gui:
.
Add uninstall gui:
. It runs in addition to the other flags, and before them (otherwise it could very well be removed by them).
When we call install
/uninstall
and the corresponding installer gui:
or uninstall gui:
exists, check if --allow-gui
is set and act accordingly.
When opening GUIs, do so with open -W
. This way the command will be blocked until it finishes, preventing a barrage of GUIs left open when installing multiple apps and allowing for &&
and other subsequent commands.
brew cask info
should inform if install
/uninstall
needs a GUI.
Checklist:
- Add
--allow-gui
flag. - Rename (and update implementation of)
installer manual:
. - Implement
uninstall gui:
. - Update implementation of
info
. - Update documentation.
- Add tests.
- Replace
installer manual:
withinstaller gui:
in casks. - Add
uninstall gui:
toadobe-creative-cloud
. - Add
uninstall gui:
tolittle-snitch
. - Add
uninstall gui:
toteamviewer
. - Add
uninstall gui:
toteamviewer-host
.
Pinging @caskroom/maintainers, but any user is welcome to chime in.