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

Add Backblaze cask #5811

Merged
merged 1 commit into from
Aug 18, 2014
Merged

Add Backblaze cask #5811

merged 1 commit into from
Aug 18, 2014

Conversation

chrischernoff
Copy link
Contributor

This cask works as-is by downloading a DMG and caveating the user that they need to run /opt/homebrew-cask/Caskroom/backblaze/latest/Backblaze\ Installer.app.

I personally find the caveat clunky and after a little digging, found a binary inside Blackblaze Installer.app at /opt/homebrew-cask/Caskroom/backblaze/latest/Backblaze\ Installer.app/Contents/MacOS/bzdoinstall that just opens the installer app for you. You still have to execute the install manually, but at least you don't have to go find and launch the installer app in the Finder.

It appears that currently the only way to execute an installer is if it is a .pkg file. Are there any plans to support executing binaries if the result of installation is not an actual binary, but rather the installation of an app or merely the opening of an installer app?

@rolandwalker
Copy link
Contributor

Thanks for the digging!

Does running bzdoinstall open any GUI elements? If not, then we currently use a combination of caskroom_only and after_install to run such a script. One example is adobe-air.rb.

That's sort of a hack, so we added support for a new stanza install_script in #4951. The install_script stanza will become documented and cleared to use on 8 Sep. We are giving all the changes in listed in #4688 some time to percolate out to users.

@chrischernoff
Copy link
Contributor Author

It does open a GUI, so I tried using install_script and it opened the installer interface correctly! I guess we can let this PR sit until Sep 8 in that regard.

I also tried to setup the uninstall process. There is a binary in /opt/homebrew-cask/Caskroom/backblaze/latest/Backblaze\ Uninstaller.app/Contents/MacOS/applet that triggers the corresponding uninstaller app GUI and executing the binary manually as my user works fine.

I set up an uninstall :script action to point to that applet binary as follows:

uninstall :script => { :executable => 'Backblaze\ Uninstaller.app/Contents/MacOS/applet' }

However it gives an error when the uninstall command tries to run it:

[homebrew-cask](backblaze) ★ brew cask uninstall backblaze
==> Running uninstall process for backblaze; your password may be necessary
==> sudo: /opt/homebrew-cask/Caskroom/backblaze/latest/Backblaze\ Uninstaller.app/Contents/MacOS/applet: command not found
Error: Command failed to execute!

==> Failed command:
["/usr/bin/sudo", "-E", "--", "#<Pathname:/opt/homebrew-cask/Caskroom/backblaze/latest/Backblaze\\ Uninstaller.app/Contents/MacOS/applet>"]

==> Output of failed command:
sudo: /opt/homebrew-cask/Caskroom/backblaze/latest/Backblaze\ Uninstaller.app/Contents/MacOS/applet: command not found


==> Exit status of failed command:
#<Process::Status: pid 61833 exit 1>

Any idea what's going wrong? I noticed for some reason in the Failed Command printout there is an extra backslash after the word Backblaze that is not present in the other lines of the report. Perhaps that is why it cannot find it? Is the uninstall command escaping characters or something?

@rolandwalker
Copy link
Contributor

What's going wrong there is that the backslash should not be used within single quotes.

However (I may not have communicated this well) automatically invoking a GUI is considered a bad thing for Casks. That's why we use a caveats section and allow the user to run the GUI manually.

Sometimes, when digging around as you have done, we find some scriptable elements and are able to convert the GUI installer to command-line only. Once I find the executable as you have done, I always check to see if it is a bash script, and if not, attempt to decompile it with osadecompile, because sometimes it is nothing more than a compiled Applescript.

@chrischernoff
Copy link
Contributor Author

I see. I just find it inconvenient to have to manually navigate to the Caskroom and run an app, particularly if the installation coincided with numerous other apps. Are there any plans to have all caveats displayed at the conclusion of all brew cask activity, rather than contextually with their cask's installation? So to say, if I ran my setup script and installed 30 apps but 5 of them have caveats, I'm thinking it would at least be more convenient to see all of the caveats in a short list at the end of the installation process rather than interspersed in all of the console output.

@rolandwalker
Copy link
Contributor

Are there any plans to have all caveats displayed at the conclusion of all brew cask activity

I have wanted the same thing at times. #5806 is a step toward giving us that ability, which ought to be an option. After we add support for a config file and clean up the argument processing code, I hope we can go nuts with such options.

After all, some people are using Homebrew-cask to provision VMs, others for their personal machines. We should allow configuration for these very different use cases. I'm not even opposed to a persistent setting to automatically invoke manual installers — so long as it is not the default.

Also, after we merge #3066, we could do an accurate brew cask caveats installed to re-print caveats for all installed Casks.

@rolandwalker
Copy link
Contributor

There is still a stray backslash in manual_installer 'Backblaze\ Installer.app'.

If you could remove that and squash your commits, this Cask is good to go.

@chrischernoff
Copy link
Contributor Author

Done!

@rolandwalker
Copy link
Contributor

Many thanks for the contribution.

rolandwalker added a commit that referenced this pull request Aug 18, 2014
@rolandwalker rolandwalker merged commit c45331a into Homebrew:master Aug 18, 2014
@chrischernoff
Copy link
Contributor Author

I look forward to some of the potential improvements discussed in this thread! 😄

@chrischernoff chrischernoff deleted the backblaze branch August 18, 2014 22:32
@Homebrew Homebrew locked and limited conversation to collaborators May 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants