OS X Multiple installers in dmg file

(imported topic written by rzm10291)

Hello,

I have a few applications I’d like to install through BigFix that have multiple installer pkg files. I tried to package two pkg files into one DMG and using the Mac OS X Software deployment wizard, but the task is failing. I can see that it gets as far as mounting the dmg in the /tmp folder, but I can only guess that it doesn’t know what to do with two installers.

Is there anyway to install more than one .pkg file from a dmg through BigFix? If not, I can separate out all pkgs into different tasks/fixlets.

Also, if there is a way to do multiple installs from one dmg file, what order would the installs happen in? Alphabetical? Some installers have to be run first, so I’d need to name them appropriately.

(imported comment written by rzm10291)

Ok, so I took a look at a different update supplied by the nice folks at BigFix and borrowed the code to do this.

Since I know whats in the dmg and which order they should be installed, I can create the correct syntax for it. Here is what I’ve got and is working:

download http://server.com

continue if { (size of it = 7406 and sha1 of it = “anysha”) of file “bigF90C.tmp” of folder “__Download”}

extract bigF90C.tmp

wait sh -c “rm ‘/tmp/BigFixTest1.dmg’”

move “{posix path of file “BigFixTest1.dmg” of folder “__Download” of client folder of current site}” “/tmp/BigFixTest1.dmg”

wait hdiutil attach -quiet -private -mountpoint “/tmp/BESMNTPT3402455595271649” “/tmp/BigFixTest1.dmg”

wait rm -rf “{posix path of client folder of current site & “/__Download/BigFix Test 01.pkg”}”

wait rm -rf “{posix path of client folder of current site & “/__Download/BigFix Test 02.pkg”}”

wait cp -r “/tmp/BESMNTPT3402455595271649/BigFix Test 01.pkg” “{posix path of client folder of current site & “/__Download/BigFix Test 01.pkg”}”

wait cp -r “/tmp/BESMNTPT3402455595271649/BigFix Test 02.pkg” “{posix path of client folder of current site & “/__Download/BigFix Test 02.pkg”}”

wait /bin/sh -c "hdiutil detach -force mount | grep /tmp/BESMNTPT3402455595271649 | cut -f 1 -d \ | cut -f 3 -d / | head -1"

wait sh -c “rm ‘/tmp/BigFixTest1.dmg’”

wait installer -pkg “{posix path of client folder of current site & “/__Download/BigFix Test 01.pkg”}” -target / -lang en

wait installer -pkg “{posix path of client folder of current site & “/__Download/BigFix Test 02.pkg”}” -target / -lang en

Edited:

removed the server and hash of the dmg.

(imported comment written by MattBoyd)

Yeah the action script generated by the wizard uses relevance to find the name of the .pkg file that is at the mount point. If there are two packages in the image, my hunch is that your action failed with a “Singular expression refers to non-unique object” error. Sometimes the BigFix client logs will help you identify issues like these. On the Mac, the logs should be in /Library/Application Support/BigFix/Bes Agent/__besdata/__Global/Logs

(imported comment written by rzm10291)

This is what the log says:

Command failed (Relevance substitution failed) wait installer -pkg “{(if (exists folder whose (name of it ends with “.mpkg”) of folder it) then (it & “/” & name whose (it ends with “.mpkg”) of folders of folder it) else (it & “/” & name whose (it ends with “.pkg”) of folders of folder it)) of (”/tmp/" & “BESMNTPT9211642586226847”) }" -target / (fixlet 21013)

As far as best practice for Mac software deployment, should I write the actions by hand or just let the wizard do the work (when it works)? I see that if I have multiple pkgs to install I will have to write it by hand, and I have not seen any issues with the wizards so far. The big difference is declaring the name of the pkg files instead of wildcards.

Also, I think I remember reading that the wait command will wait till the install is done before moving on to the next BigFix Action Command. Is that correct too? It’s required for some of the installers that build on themselves.

Thanks!

(imported comment written by MattBoyd)

Hey Rusty,

I’m not positive, but I believe the relevance failed because of the reason in my previous post. I guess the error was not as descriptive as I would have hoped for. Regardless, at least you can confirm that it was an error with the relevance.

From a Windows software perspective, using the wizards is a huge time saver. It makes uploading packages to the BES server very easy. For applications that have relatively simple installers, the software wizards work great. Even for more complex installers that require special action script commands I almost always use the software wizard as a starting point or template, and then edit the task afterward to add the stuff that is unique to that software package.

You are correct, the wait command should wait for the installer command to finish.

(imported comment written by SystemAdmin)

Rusty,

What tool did you use to put the pkg files into one DMG file? We’ve got *.mpkg.zip files we’d like to try use with the wizard as the wizard only seems to work well with DMG files.

John