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

Make staged_path work in installer stanzas #7843

Merged
merged 1 commit into from
Dec 17, 2015
Merged

Make staged_path work in installer stanzas #7843

merged 1 commit into from
Dec 17, 2015

Conversation

ponychicken
Copy link
Contributor

Ok, so this is a working cask, but I'm also looking for some guidance on how to express things a bit more nicely => see line comments

:args => ['--mode=silent', "--deploymentFile=/usr/local/Caskroom/photoshop/15.0.0/Adobe Photoshop CC 2014/Deployment/#{Utils.install_locale}_Deployment.xml"]

# The hash of the specific installer can be found in the deployment.xml
uninstall :script => "open /Library/Application Support/Adobe/Uninstall/#{Utils.hash}.app"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You seem to be misunderstanding this option. You're not meant to write a script with it, but point it to an existing one. Opening a .app isn't acceptable. All automised options must be accomplished without calling a GUI.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, so running the following should uninstall it without gui:

/Applications/Utilities/Adobe Application Manager/core/Adobe Application Manager.app/Contents/MacOS/PDApp --mode=silent --action=uninstall --deploymentFile=Deployment.xml

I assume that after the install the dmg will be unmounted? If yes, where would be a good place to store this xml file?

@rolandwalker
Copy link
Contributor

Hi!

This is neat. The reason staged_path didn't work for you, when you interpolated it into a string, is that string interpolation happens at load time when the Cask is read in. staged_path is empty at that time. You will see staged_path work correctly inside of a do block (which is a callback that is invoked much later):

caveats do
  puts "staged_path #{staged_path}"
end

We need to fix that so that so that #{staged_path} can be visible in the string. Hardcoding /usr/local/Caskroom/photoshop/15.0.0/… won't do.

We also don't have a way to specify variants such as localizations, though it is desirable, and discussed in #5592. For now, people just submit some of the more popular localizations under a different name in the versions repo.

The contents of the DMG will remain available under staged_path, so you will be able to refer to that XML file in uninstall.

Since we don't do variants (yet), there isn't much value in the Utils module here, as those items can't change and only get used once.

Thanks a lot for this. We can get it to work (including some backend changes) if you are patient.

@ponychicken
Copy link
Contributor Author

Great, thanks for the answers. I've updated the uninstall for now, so that it runs a non-gui program. It is possible to wrap the script statement in a callback as well?

Regarding the util, I put it there since there are a few strings that are repeating, and once this is merged it will be easier to adapt this cask for the other adobe apps if it's a bit modular.

@ponychicken
Copy link
Contributor Author

Ok, here's a new commit, adding support for staged_path on the installer stanza. To be honest, I have no clue of ruby, but it seems to work.

@ponychicken
Copy link
Contributor Author

hey @vitorgalvao , could you have a look at the last commit I pushed?
I saw that this problem with staged_path happens in other places as well and it blocks this PR.

@vitorgalvao
Copy link
Member

@ponychicken lib/cask/dsl.rb should now be lib/hbc/dsl.rb (likely the reasons there’s a conflict).

I agree the Utils module should be removed. I understand why you’ve added it, but it really isn’t doing much at the moment, apart from adding complexity. The hardcoded path is wrong, as the default path for the caskroom is /opt/homebrew-cask/Caskroom, not /usr/local/Caskroom, but naturally, hard-coding a path is suboptimal.

Regarding the dsl.rb changes, they don’t seem to work. We should really take care of that first, and then fix the cask.

@fanquake fanquake added the cask label Jan 18, 2015
@vitorgalvao vitorgalvao changed the title Adding Photoshop CC Make staged_path work in installer stanzas Jul 26, 2015
@vitorgalvao vitorgalvao added enhancement core Issue with Homebrew itself rather than with a specific cask. and removed cask labels Jul 26, 2015
@jawshooah jawshooah merged commit 10c48cb into Homebrew:master Dec 17, 2015
@miccal miccal removed core Issue with Homebrew itself rather than with a specific cask. enhancement labels Dec 23, 2016
@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.

6 participants