Best way to bundle a script and install.app

alaiuppa
New Contributor

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)

1 ACCEPTED SOLUTION

Look
Valued Contributor III

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 solution in original post

5 REPLIES 5

jared_f
Valued Contributor

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

alaiuppa
New Contributor

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.

Look
Valued Contributor III

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.

alaiuppa
New Contributor

@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.

Look
Valued Contributor III

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.