{"action":"created","issue":{"url":"https://api.github.com/repos/caskroom/homebrew-cask/issues/10137","labels_url":"https://api.github.com/repos/caskroom/homebrew-cask/issues/10137/labels{/name}","comments_url":"https://api.github.com/repos/caskroom/homebrew-cask/issues/10137/comments","events_url":"https://api.github.com/repos/caskroom/homebrew-cask/issues/10137/events","html_url":"https://github.com/caskroom/homebrew-cask/pull/10137","id":63262482,"number":10137,"title":"Support for applyChoiceChangesXML w/ OSXFUSE example","user":{"login":"retrography","id":5309061,"avatar_url":"https://avatars.githubusercontent.com/u/5309061?v=3","gravatar_id":"","url":"https://api.github.com/users/retrography","html_url":"https://github.com/retrography","followers_url":"https://api.github.com/users/retrography/followers","following_url":"https://api.github.com/users/retrography/following{/other_user}","gists_url":"https://api.github.com/users/retrography/gists{/gist_id}","starred_url":"https://api.github.com/users/retrography/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/retrography/subscriptions","organizations_url":"https://api.github.com/users/retrography/orgs","repos_url":"https://api.github.com/users/retrography/repos","events_url":"https://api.github.com/users/retrography/events{/privacy}","received_events_url":"https://api.github.com/users/retrography/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/caskroom/homebrew-cask/labels/cask","name":"cask","color":"bfe5bf"},{"url":"https://api.github.com/repos/caskroom/homebrew-cask/labels/core","name":"core","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-03-20T16:48:51Z","updated_at":"2015-03-28T21:58:26Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/caskroom/homebrew-cask/pulls/10137","html_url":"https://github.com/caskroom/homebrew-cask/pull/10137","diff_url":"https://github.com/caskroom/homebrew-cask/pull/10137.diff","patch_url":"https://github.com/caskroom/homebrew-cask/pull/10137.patch"},"body":"I have added basic support for Apple Installer's `-applyChoiceChangesXML` switch. For now creation of the necessary `plist` file needs to be achieved manually during the preflight. The address of the file can be passed along with the other options in the options hash to `pkg`.\r\n\r\nI have also modified the OSXFUSE Cask to show how this works. For some obscure reason MacFuse compatibility layer is not selected by default in OSXFUSE installer package, and this makes the OSXFUSE Cask relatively useless as is, given that still a good half of the Fuse drivers require the compatibility layer. I have included a changes xml file that turns MacFuse compatibility layer into a default option for Apple Installer .\r\n\r\nUnfortunately Cask does not support the `:option` stanza yet, so it seems to me that there is no way to let the end user select the different installation options manually at the time of installation. \r\n\r\nI have ideas on how to develop the `:option` stanza in conjunction with a more integrated implementation of Apple Installer's change xml, but I am definitely not well-versed enough in Homebrew and Cask projects to be able to make architectural changes."},"comment":{"url":"https://api.github.com/repos/caskroom/homebrew-cask/issues/comments/87318139","html_url":"https://github.com/caskroom/homebrew-cask/pull/10137#issuecomment-87318139","issue_url":"https://api.github.com/repos/caskroom/homebrew-cask/issues/10137","id":87318139,"user":{"login":"retrography","id":5309061,"avatar_url":"https://avatars.githubusercontent.com/u/5309061?v=3","gravatar_id":"","url":"https://api.github.com/users/retrography","html_url":"https://github.com/retrography","followers_url":"https://api.github.com/users/retrography/followers","following_url":"https://api.github.com/users/retrography/following{/other_user}","gists_url":"https://api.github.com/users/retrography/gists{/gist_id}","starred_url":"https://api.github.com/users/retrography/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/retrography/subscriptions","organizations_url":"https://api.github.com/users/retrography/orgs","repos_url":"https://api.github.com/users/retrography/repos","events_url":"https://api.github.com/users/retrography/events{/privacy}","received_events_url":"https://api.github.com/users/retrography/received_events","type":"User","site_admin":false},"created_at":"2015-03-28T21:58:25Z","updated_at":"2015-03-28T21:58:25Z","body":"Actually, that's my preferred solution, and it should be easily doable using Ruby's default XML library. Installer's grammar is pretty simple and does not require that many parameters to be sent. See[here](https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man8/installer.8.html). I favor a format like this, where the cask maker will only have to mention which choices to enable or disable:\r\n\r\n```ruby\r\npkg \"Install OSXFUSE #{version[0..-3]}.pkg\",\r\n  :choices => {\r\n    \"#{MacOS.release}$OSXFUSEMacFUSE\" => true\r\n  }\r\n```\r\nI can generate a template for ChoicesXML using `-showChoiceChangesXML` switch and then apply the needed modifications.\r\n\r\nBut the more important point is that these installer choices are actually install options and must be set by the user at the installation time and not by the cask maker. As such, they have to be passed to the user via some kind of stanza similar to `:option` in homebrew.\r\n\r\nIt is pretty easy to find out which options are available to the user by running the `installer`'s `-showChoicesXML` (see output [here](https://gist.github.com/retrography/fbf159698bb5a4f6ab55)). Choices that have `choiceIsVisible` and `choiceIsEnabled` can be set by the usr. There is an internal `choiceIdentifier` for each choice, but also a `choiceTitle`, a `choiceDescription` and a `choiceSizeInKilobytes` that can be shows to the user. User, in return, has to use to switch to toggle the state of each choice. \r\n\r\nI am willing and probably able to develop the backend where choices are transformed into proper ChangesXMLs, but I know very little about the general structure of the brew and cask projects and I am not sure how one can go about implementing the `:option` stanza. My brief look at the `option.rb` file in homebrew project didn't really help. \r\n\r\nLet me know how we can go about this. I can probably put a bit of time this week and create the backend."}}