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

Services (i.e. workflows) installation doesn’t work #2264

Closed
niksy opened this issue Jan 1, 2014 · 9 comments
Closed

Services (i.e. workflows) installation doesn’t work #2264

niksy opened this issue Jan 1, 2014 · 9 comments

Comments

@niksy
Copy link
Contributor

niksy commented Jan 1, 2014

Similar to #2206, simply symlinking Automator created service (with .workflow extension) doesn’t work. Symlinked service is shown inside Services menu, but activating it doesn’t do anything.

It will work only if you explictly confirm that you want to install service (by activating workflow file and pressing "Install").

Maybe create something similar to pull request #2216 (@miguelfrde)?

@miguelfrde
Copy link
Contributor

Hey @niksy, is there any cask that has this problem? The service casks I tried (wordservice, calcservice), both with extension .service worked fine. Do you know any cask that has .workflow extension? Or any service from which I can make a cask and try it?

@rolandwalker
Copy link
Contributor

We should look at whether it is possible to address this and other related issues using Apple's CLI admin tools such as lsregister.

@niksy
Copy link
Contributor Author

niksy commented Jan 1, 2014

@miguelfrde I was trying with some of my custom services created with Automator. I’ve searched this repo for some services with .workflow extension but haven’t found one.

@miguelfrde
Copy link
Contributor

@niksy I've been thinking about this and I came up with an idea (inspired by #2258), which may solve this problem (at least it works for widgets).

The idea is to hard link .wdgt, .workflow directories (maybe .service too) instead of symlinking them. The problem is that (as far as I know) the default OSX ln, doesn't let you create hard links to directories, that's why coreutils will be needed (gln, instead of ln).

This adds one dependency to homebrew-cask (coreutils).

@rolandwalker I'm not familiar with lsregister , but I'll look into it and other Apple CLI tools and see if I can find a better solution.

@rolandwalker
Copy link
Contributor

@miguelfrde directory hard links sounds worth pursuing. They have a bad reputation on Unix filesystems but are supposed to be are safe on HFS.

This is not really a reference, just some context for anyone who is interested: http://unix.stackexchange.com/questions/22394/why-hard-links-not-allowed-to-directories-in-unix-linux#comment30555_22406.

Re: dependencies, there was an IRC discussion about #1992 in which @phinze requested that any dependency be deferred to Cask install time. In other words, #1992 is the wrong way to do dependency, because it patches brew-cask.rb.

@niksy
Copy link
Contributor Author

niksy commented Jan 3, 2014

@miguelfrde

One way to go is to maybe simulate clicks on shown windows via AppleScript.
Something like:

tell application "System Events"
    click button "Install" of window "Service Installer" of application process "Automator" of application "System Events"
end tell

This can go as part of osascript command.

Now, this is highly error prone, since we’re targeting window and button by their name, and it is possible that OS X will request Accessibility access for AppleScript which can confuse users not familiar with this.

@vitorgalvao
Copy link
Member

@niksy Not only is it error prone, I very much doubt @phinze would aprove (last quote and first sentence of following paragraph).

@rolandwalker
Copy link
Contributor

@miguelfrde directory hardlinks also solve some other issues such as (closed) #1722 (I tested). Probably #1351 also (did not test).

However, directory hardlinks are quite an odd beast, so one ought to proceed slowly. Obviously they are robust at the filesystem level in OS X as they have been used for years for Time Machine. But Unix-lineage software such as Ruby might assume they don't exist. Starting with File.new("/hard/linked/directory").stat.nlink, much testing would be needed.

@vitorgalvao
Copy link
Member

Linking is a mess, and has proven to not be the best solution. That should be changed, and we’ll be working towards that.

@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

No branches or pull requests

4 participants