{"action":"created","issue":{"url":"https://api.github.com/repos/caskroom/homebrew-cask/issues/12095","labels_url":"https://api.github.com/repos/caskroom/homebrew-cask/issues/12095/labels{/name}","comments_url":"https://api.github.com/repos/caskroom/homebrew-cask/issues/12095/comments","events_url":"https://api.github.com/repos/caskroom/homebrew-cask/issues/12095/events","html_url":"https://github.com/caskroom/homebrew-cask/pull/12095","id":90784291,"number":12095,"title":"Change app symlinks to point to Contents","user":{"login":"rhendric","id":1570964,"avatar_url":"https://avatars.githubusercontent.com/u/1570964?v=3","gravatar_id":"","url":"https://api.github.com/users/rhendric","html_url":"https://github.com/rhendric","followers_url":"https://api.github.com/users/rhendric/followers","following_url":"https://api.github.com/users/rhendric/following{/other_user}","gists_url":"https://api.github.com/users/rhendric/gists{/gist_id}","starred_url":"https://api.github.com/users/rhendric/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhendric/subscriptions","organizations_url":"https://api.github.com/users/rhendric/orgs","repos_url":"https://api.github.com/users/rhendric/repos","events_url":"https://api.github.com/users/rhendric/events{/privacy}","received_events_url":"https://api.github.com/users/rhendric/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/caskroom/homebrew-cask/labels/core","name":"core","color":"d4c5f9"},{"url":"https://api.github.com/repos/caskroom/homebrew-cask/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/caskroom/homebrew-cask/labels/waiting-dev-feedback","name":"waiting-dev-feedback","color":"fef2c0"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-06-24T21:29:56Z","updated_at":"2015-07-11T17:35:33Z","closed_at":"2015-07-11T09:45:07Z","pull_request":{"url":"https://api.github.com/repos/caskroom/homebrew-cask/pulls/12095","html_url":"https://github.com/caskroom/homebrew-cask/pull/12095","diff_url":"https://github.com/caskroom/homebrew-cask/pull/12095.diff","patch_url":"https://github.com/caskroom/homebrew-cask/pull/12095.patch"},"body":"I'm expecting this to be a little controversial. I'm not 100% convinced it's a great idea myself, but boy, do I want a solution to the below problem.\r\n\r\nProblem: When adding a symlinked application to the Dock, OS X appears to follow the symlink and actually add the target application bundle to the `com.apple.dock.plist`, not the source link. As a consequence, when brew-cask upgrades the application to a new version, the Dock icon still launches the old version (or fails if the old version isn't on the system anymore).\r\n\r\nSolution: This commit changes the behavior of app linking to create an `AppName.app` *folder* containing an `AppName.app/Contents` symlink, instead of an `AppName.app` symlink. This gets the Dock to consistently point to the link-containing `AppName.app`, even when the `Contents` symlink within is upgraded by brew-cask.\r\n\r\nI wrote this with the intent of being backwards-compatible; in particular, installing over either an `AppName.app` link or an `AppName.app/Contents` link is allowed, while an `AppName.app` containing a non-symlink `Contents` will (still) not be clobbered."},"comment":{"url":"https://api.github.com/repos/caskroom/homebrew-cask/issues/comments/120646959","html_url":"https://github.com/caskroom/homebrew-cask/pull/12095#issuecomment-120646959","issue_url":"https://api.github.com/repos/caskroom/homebrew-cask/issues/12095","id":120646959,"user":{"login":"scribblemaniac","id":3461051,"avatar_url":"https://avatars.githubusercontent.com/u/3461051?v=3","gravatar_id":"","url":"https://api.github.com/users/scribblemaniac","html_url":"https://github.com/scribblemaniac","followers_url":"https://api.github.com/users/scribblemaniac/followers","following_url":"https://api.github.com/users/scribblemaniac/following{/other_user}","gists_url":"https://api.github.com/users/scribblemaniac/gists{/gist_id}","starred_url":"https://api.github.com/users/scribblemaniac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scribblemaniac/subscriptions","organizations_url":"https://api.github.com/users/scribblemaniac/orgs","repos_url":"https://api.github.com/users/scribblemaniac/repos","events_url":"https://api.github.com/users/scribblemaniac/events{/privacy}","received_events_url":"https://api.github.com/users/scribblemaniac/received_events","type":"User","site_admin":false},"created_at":"2015-07-11T17:35:33Z","updated_at":"2015-07-11T17:35:33Z","body":"> First time I remember seeing anyone with the issue.\r\n\r\nI'll throw in my two cents here. I have also experienced the issue mentioned above, however since we don't officially support updating, I don't believe it should be expected of us to fix this issue right now. I'm not knowledgeable enough here to weigh in on the pros and cons of this particular solution but this problem definitely needs to be considered for cask upgrade.\r\n\r\nI have two potential alternate solutions I should mention, but like I said earlier, I don't know very much about this kind of stuff:\r\n\r\n1. Modify the `com.apple.dock.plist`. The primary issue with this is that it would only solve the issue for the current user because you wouldn't have access to the Library folders of the other users.\r\n2. Add the symlink to the dock. This is the simplest and best solution for now in my mind. If you drag the app symlink to the dock, it follows it to the actually application location as stated above. If you repeat this action however, it appears that you end up with one icon for the actual application and one to the symlink. You can then just remove the non-symlink icon. I haven't tested whether this will solve this issue, but I don't see any reason why it wouldn't work."}}