Deploying .dmg application to Macintosh machines

Hello,

My organization has several dozen Macintosh machines that use a vulnerable version of Git for version control. I have the newest version and would like to copy the dmg file to each machine, mount it, install the updated application and finally do some cleanup. What would be the most efficient way to accomplish this? I have not had any luck finding any decent sites with command line switches for Mac OS X. Does anyone have experience deploying third party Macintosh Applications through Bigfix or have a site to recommend to help accomplish this? Thanks.

Hello,

Are you referencing the ā€œgit-2.8.1-intel-universal-mavericks.dmgā€?

The contents of the dmg is a git-2.8.1-intel-universal-mavericks.pkg, which is a package you could pull out and distribute to make it a bit simpler. For example, we install packages with this action script:

 prefetch Awesome.pkg sha1:9dc729ecef0d9ce74b5782564440634cf8007dc4 size:9578 http://webserver.at.my.org/Packages/Awesome.pkg
 wait installer -pkg "__Download/PALS1.4.pkg" -target /

However, since you asked about DMGsā€¦ You could use the wizard to deploy the software, it should work without modifications. If you want to action script it yourself, I use the following to deploy DMG with pkgs inside:

prefetch git.dmg sha1:ffbf6dbf9f72624e9ad1111f3e00380431c55643 size:25136256 http://jaist.dl.sourceforge.net/project/git-osx-installer/git-2.8.1-intel-universal-mavericks.dmg sha256:c2912895a1e2018d9be4c646765d511f7c82e0114275505dbd13d1ac70c62023

delete "/tmp/git.dmg"
move "__Download/git.dmg" "/tmp/git.dmg"

wait /usr/bin/hdiutil attach -quiet -nobrowse -mountpoint "/tmp/GIT" "/tmp/git.dmg"

continue if {exists file "/tmp/GIT/git-2.8.1-intel-universal-mavericks.pkg"}

 wait installer -pkg "/tmp/GIT/git-2.8.1-intel-universal-mavericks.pkg" -target /

 wait /usr/bin/hdiutil detach -force "/tmp/GIT"

 delete "/tmp/git.dmg"

Hope that helps.
Rusty

Hi Rusty,

Yes that is the package in question. Thanks for your help! I will give it a try and report back later today or first thing tomorrow.

Rusty,

I attempted to test the following code you suggested :

prefetch git.dmg sha1:ffbf6dbf9f72624e9ad1111f3e00380431c55643 size:25136256 http://jaist.dl.sourceforge.net/project/git-osx-installer/git-2.8.1-intel-universal-mavericks.dmg sha256:c2912895a1e2018d9be4c646765d511f7c82e0114275505dbd13d1ac70c62023

delete "/tmp/git.dmg"
move "__Download/git.dmg" "/tmp/git.dmg"

wait /usr/bin/hdiutil attach -quiet -nobrowse -mountpoint "/tmp/GIT" "/tmp/git.dmg"

continue if {exists file "/tmp/GIT/git-2.8.1-intel-universal-mavericks.pkg"}

 wait installer -pkg "/tmp/GIT/git-2.8.1-intel-universal-mavericks.pkg" -target /

 wait /usr/bin/hdiutil detach -force "/tmp/GIT"

 delete "/tmp/git.dmg"

The action script runs successfully but on the test machine the version of git is still the same. Any suggestions I should look for?

I think I may have found the issue. I think the old version needs to be removed first. When i pushed to a machine without git to test the script it completed successfully without issue.

Hello Rusty, I donā€™t have the .pkg or .mpkg files under my installer folder, most of the files are .appā€¦

How I will install the .dmg package in the system, as copying .app files under application folder is not working. Kindly support.

Hi Varun,

For dmg files with .apps inside of them, we use action script like this:

delete "/tmp/GoogleChrome.dmg" 
move "__Download/GoogleChrome.dmg" "/tmp/GoogleChrome.dmg" 

wait /usr/bin/hdiutil attach -quiet -nobrowse -mountpoint "/tmp/GOOGLE" "/tmp/GoogleChrome.dmg" 

continue if {exists folder "/tmp/GOOGLE/Google Chrome.app"} 

if {exists folder "/Applications/Google Chrome.app"} 
    wait /bin/rm -rfd "/Applications/Google Chrome.app" 
endif wait /bin/cp -Rfp "/tmp/GOOGLE/Google Chrome.app" "/Applications" 

wait /usr/bin/hdiutil detach -force "/tmp/GOOGLE" 

wait /usr/sbin/chown -R root:admin "/Applications/Google Chrome.app" 
wait /bin/chmod -R ug+rw "/Applications/Google Chrome.app" 
wait /bin/chmod -R o+r "/Applications/Google Chrome.app" 

delete "/tmp/GoogleChrome.dmg"
1 Like

Hello Rustyā€¦ I have just modified my current action scriptā€¦ need your viewā€¦

prefetch Hirendmg.tmp sha1:c373b84d7331220fbdebe7884bee60e86f3bbfa8 size:21167217 http://HemasServer:52311/Uploads/c373b84d7331220fbdebe7884bee60e86f3bbfa8/Hirendmg.tmp sha256:1bdd259c0f33d3a1d1a98a1a368b7e3b7182b64a3b1ac622bbfd92e5684ba8db

extract Hirendmg.tmp

delete "/tmp/Hiren.dmg"
move ā€œ__Download/Hiren.dmgā€ ā€œ/tmp/Hiren.dmgā€

wait /usr/bin/hdiutil attach -quiet -nobrowse -mountpoint ā€œ/tmp/BESMNTPT0397674485521351ā€ ā€œ/tmp/Hiren.dmgā€

continue if {exists folder ā€œ/tmp/BESMNTPT0397674485521351/Hirenlite.appā€}

if {exists folder ā€œ/Applications/Hirenlite.appā€}
wait /bin/rm -rfd "/Applications/Hirenlite.app"
endif wait /bin/cp -Rfp ā€œ/tmp/BESMNTPT0397674485521351/Hirenlite.appā€ ā€œ/Applicationsā€

wait /usr/bin/hdiutil detach -force ā€œ/tmp/BESMNTPT0397674485521351ā€

wait /usr/sbin/chown -R root:admin "/Applications/Hirenlite.app"
wait /bin/chmod -R ug+rw "/Applications/Hirenlite.app"
wait /bin/chmod -R o+r ā€œ/Applications/Hirenlite.appā€

delete ā€œ/tmp/Hiren.dmgā€

Hi Varun,

Looks correct, except youā€™ve got the 'wait /bin/cpā€¦" on the same line as the endif. Place a carriage return right after ā€˜endifā€™ and you should have it!

Hello Rusty, Just tried this, but unfortunately it is not working for meā€¦although the action is completed with the exit code 1.

prefetch Hirendmg.tmp sha1:c373b84d7331220fbdebe7884bee60e86f3bbfa8 size:21167217 http://HemasServer:52311/Uploads/c373b84d7331220fbdebe7884bee60e86f3bbfa8/Hirendmg.tmp sha256:1bdd259c0f33d3a1d1a98a1a368b7e3b7182b64a3b1ac622bbfd92e5684ba8db

extract Hirendmg.tmp

delete "/tmp/Hiren.dmg"
move ā€œ__Download/Hiren.dmgā€ ā€œ/tmp/Hiren.dmgā€

wait /usr/bin/hdiutil attach -quiet -nobrowse -mountpoint ā€œ/tmp/BESMNTPT0397674485521351ā€ ā€œ/tmp/Hiren.dmgā€

continue if {exists folder ā€œ/tmp/BESMNTPT0397674485521351/Hirenlite.appā€}

if {exists folder ā€œ/Applications/Hirenlite.appā€}
wait /bin/rm -rfd "/Applications/Hirenlite.app"
endif

wait /bin/cp -Rfp ā€œ/tmp/BESMNTPT0397674485521351/Hirenlite.appā€ ā€œ/Applicationsā€

wait /usr/bin/hdiutil detach -force ā€œ/tmp/BESMNTPT0397674485521351ā€

wait /usr/sbin/chown -R root:admin "/Applications/Hirenlite.app"
wait /bin/chmod -R ug+rw "/Applications/Hirenlite.app"
wait /bin/chmod -R o+r ā€œ/Applications/Hirenlite.appā€

delete ā€œ/tmp/Hiren.dmgā€

Varun,
Which line did it fail on? Does the disk image ā€œHiren.dmgā€ contain the ā€œHirenlite.appā€ with those exact names?

Hi Rusty, all lines are completed successfully, with the error code 1.

Besides under Hiren.dmg, when I double click on it, itā€™s prompt a another windows where it is asking for ā€œDouble click on below icon to installā€ and the icon name is hirenlite.appā€¦

When I double click on hirenlite.app, a new windows appears and asking to ā€œcontinueā€ to install the software. (This step I am doing manually to check the exact file name and application behavior)

Other Info : DMG File name : Hiren.dmg - When I double click on itā€¦ there are some Folder & files are reflecting under Computer (Go>Computer) which areā€¦

  1. .dropDMBackground, 2) .feseventsd , 3) HirenLite.app
    e.g.
    MyMACBook-Test > Hiren Lite Installer
    +.dropDMBackground
    +.feseventsd
    +HirenLite.app

It sounds like the dmg has an app to install the software, not just the software itself? Can I download this dmg from somewhere online to see the contents? Does the Hiren Lite software have any mass deployment documentation?

Yes, You are right.

Sharing the content information for your reference.

You may need to repackage the app install with something like JAMF Composer.app. Iā€™d suggest contacting the company and asking them if there is an alternative method to distribute the software.

Hi, Now the application team has suggested to run the HirenLite Launcher which is unix executable fileā€¦

Do you please suggest any silent installation switches to run this fileā€¦

File Path Changed now i.e. - HireLite.app/contents/MacOS/HirenLite Launcher

Hard to know what switches to use, but I would start by replacing the line:

wait /bin/cp -Rfp ā€œ/tmp/BESMNTPT0397674485521351/Hirenlite.appā€ ā€œ/Applicationsā€

with a call to the binary:

wait ā€œ/tmp/BESMNTPT0397674485521351/Hirenlite.app/Contents/MacOS/HirenLite Launcherā€

You could also try this manually by using SSH to get to the machine, curl to get the dmg, then following the steps in the ActionScript to reproduce the task.