Skip to main content
Solved

Best way to bundle a script and install.app


Forum|alt.badge.img+4

Hey there,

So I have a piece of software packaged up nice as a dmg in our standard image. However for whatever reason it fails to install correctly.

Link for those interested

I've tested out a solution involving a script to adjust the permissions relating to the installer, and then run it and that seems to work fine.

Would there be a way to put the script and install.app into a .dmg or .pkg so that I can have this be a part of our standard image?

I realize that is what Composer is for, I just dont see the option to set it up as such. All I see is that I can use pre-installed software (Which is the original package manifest that does not work)

Best answer by Look

Not quite, you need to put the Installer.app somewhere specific and then drag it from there into Composer, i.e. /var/tmp or perhaps /Library/SomeFolder (if you think you might like to use it again)
You then reference directly in this location in the script i.e.
chmod a+x /var/tmp/installer.app/Contents/MacOS/AppName Installer Depending on the size and circumstances you might want to remove the deployed file when your done as part of the script.

View original
Did this topic help you find an answer to your question?

5 replies

Forum|alt.badge.img+14
  • Valued Contributor
  • 375 replies
  • November 9, 2016

I mentioned how to add a script to a captured install here


Forum|alt.badge.img+4
  • Author
  • Contributor
  • 11 replies
  • November 9, 2016

The issue I believe is with it being a captured install, ideally I want to have a package that runs my script which would then run the installer in a manner that does not cause it to break.


Forum|alt.badge.img+16
  • Valued Contributor
  • 1002 replies
  • November 9, 2016

Option One:
Place the installer.app where you want to run it from.
Open Composer.
Drag the installer into the lefthand bar it will create a package containing just that installer where you placed it.
Check the permissions with the tool in the bottom right.
Add a postinstall script to the package that calls the installer however you want.
Build it as a PKG (it has to be like this to run scripts).
Put in Casper.

Option Two
Exactly the same as above, but move the script into Casper, just push the app down in a DMG, then run the script after it in the same policy.


Forum|alt.badge.img+4
  • Author
  • Contributor
  • 11 replies
  • November 9, 2016

@Look

Thanks for the reply! I managed to roll through all of that, just to be sure I'm barking up the right tree,

I took the installer.app and dragged it from my desktop over to composer.

As far as the post install script is, it needs to run Chmod on the installer.app and some components.

So in order to find said components and installer.app, would I use the pathToPackage=$1 in order to locate my installer.app since it would now be in the package?

As in the path would be chmod a+x $1/installer.app/Contents/MacOS/AppName Installer

I think with just making sure I've got a semblance of the right thing coming along.


Forum|alt.badge.img+16
  • Valued Contributor
  • 1002 replies
  • Answer
  • November 9, 2016

Not quite, you need to put the Installer.app somewhere specific and then drag it from there into Composer, i.e. /var/tmp or perhaps /Library/SomeFolder (if you think you might like to use it again)
You then reference directly in this location in the script i.e.
chmod a+x /var/tmp/installer.app/Contents/MacOS/AppName Installer Depending on the size and circumstances you might want to remove the deployed file when your done as part of the script.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings