Installing DMG that requires manual interaction

adamberns
New Contributor III

I am working on installing the DMG from https://download01.logi.com/web/ftp/pub/techsupport/cameras/Conference%20cam/FWUpdateRallyCamera_1.2.4.dmg. using Jamf Pro

My question is simple, to run the installer I need to actually run a command line that calls something in the .app. Specifically I need to run the .app with an option --silentinstall.

I am just stuck on how to do that, even with composer. I cannot find a "run this command" type setting

I looked at: https://www.jamf.com/jamf-nation/discussions/25530/help-with-scripting-install-a-package-within-a-dmg but I just don't get it.

More history on this:

If I double click on the package it opens up the camerasettings.app that I then run. It creates a log file at ~librarylogslogitechdfu with a subfile of the install log.

If I take the DMG and push it through JAMF pro, it shows that the file has been installed. However, if I look for the log file, it is not created (nor is the firmware updated on the device).

If I add the .app from the DMG into composer, there is a script that runs, I can then run the camerasettings.app --silentinstall from the terminal and it works just fine.

I looked at the

1 ACCEPTED SOLUTION

adamberns
New Contributor III

So I figured out what I needed to do in this, thank you @dmueller for you outstanding help on this.

  1. I put the .app file in /Library/Caches/Logitech
  2. Added the .app to a new Composer build
  3. Added the following lines as a postinstall (thank you for the help on this!)
#!/bin/bash /Library/Caches/Logitech/LogiFirmwareUpdateRallyCamera.app/Contents/MacOS/LogiFirmwareUpdateRallyCamera --silentupdate /Library/Caches/Logitech/LogiFirmwareUpdateRallyCamera.app/Contents/MacOS/LogiFirmwareUpdateRallyCamera --versioninfo > /Library/Caches/Logitech/Rally-Status.txt echo "Finished" >> /Library/Caches/Logitech/Rally-Status.txt
  1. Saved the Composer build as a .pkg
  2. In Jamf Pro made a new Policy that installs the package.

I discovered during testing if I do a command+I key during a package install it shows me where the files are. I guess in composer it puts the files where they were dragged from. There is no way to change the destination. I could add another line to delete the .app from Caches/Logitech but I don't think that is needed.

I was thinking that I could call those lines from a script within Jamf, but that is not the case.

View solution in original post

4 REPLIES 4

claudiogardini
Contributor

Try creating a pkg which drops the app in a temporary location (eg. /private/tmp/) then have a postinstall Script which triggers the Installation and removes the App. Something like this:

#!/bin/bash

# Run Installer
/private/tmp/LogiFirmwareUpdateRallyCamera.app --silentinstall

# Cleanup
rm -rf /private/tmp/LogiFirmwareUpdateRallyCamera.app

adamberns
New Contributor III

so here is what I have done so far, but I am really stumped.
Let me be a little more clear on my question.
I just need to install the .app. the only way I can figure out how to get it into Jamf Pro is via a PKG. I.E. there is no simple copy file to location and then run script (which I have done in other tools).

So using Composer I build a new PKG with just the LogiFirmwareUpdateRallyCamera.app in it.
I put the app file at /Library/Caches/Logitech
I drag the app file from that location to the build window in Composer
I add a pre script that just writes to a log file to verify it is running
I have a second script that calls /Library/Caches/Logitech/LogiFirmwareUpdateRallyCamera.app/Contents/MacOS/LogiFirmwareUpdateRallyCamera --silentupdate If I run the PKG manually everything works.
Then if I upload the PKG into JAMF it does not work. I am guessing because the path /Library/Caches/Logitech/LogiFirmwareUpdateRallyCamera.app/Contents/MacOS/ doesn't actually exist because JAMF puts the file somewhere into /Library/Application Support/JAMF

So then I tried putting the file into the JAMF cache /Library/Application Support/JAMF/Waiting Room

Then in the script call the same commands, with no luck.

So how do I take a PKG or DMG Extract it, run the installer with command line, OR upload the .app file as is, deploy it to a location then run it with a script?

dmueller
Contributor

A possible suggestion, since you can mount and run the command from the DMG file. You could copy the DMG file into Composer and convert to source. This will leave you with a Composer item with an app bundle inside. A pretty clean start. You can copy the DMG to /private/tmp and then drag this into the newly created source object. Then remove the app bundle. This will give you a starting point to mount the DMG and run your command without having to install the app bundle.

Using the above setup, you can then create a postinstall to quietly mount the DMG, run your command, detach from the DMG, and then clean up.

Example postinstall

#!/bin/bash
# Quietly attach to the dmg file
/usr/bin/hdiutil attach -nobrowse -mountpoint /tmp/logi /tmp/FWUpdateRallyCamera_1.2.4.dmg

# Run the command
/tmp/logi/LogiFirmwareUpdateRallyCamera.app/Contents/MacOS/LogiFirmwareUpdateRallyCamera --silentupdate

# detach
/usr/bin/hdiutil detach /tmp/logi
rm -fr /tmp/FWUpdateRallyCamera_1.2.4.dmg

adamberns
New Contributor III

So I figured out what I needed to do in this, thank you @dmueller for you outstanding help on this.

  1. I put the .app file in /Library/Caches/Logitech
  2. Added the .app to a new Composer build
  3. Added the following lines as a postinstall (thank you for the help on this!)
#!/bin/bash /Library/Caches/Logitech/LogiFirmwareUpdateRallyCamera.app/Contents/MacOS/LogiFirmwareUpdateRallyCamera --silentupdate /Library/Caches/Logitech/LogiFirmwareUpdateRallyCamera.app/Contents/MacOS/LogiFirmwareUpdateRallyCamera --versioninfo > /Library/Caches/Logitech/Rally-Status.txt echo "Finished" >> /Library/Caches/Logitech/Rally-Status.txt
  1. Saved the Composer build as a .pkg
  2. In Jamf Pro made a new Policy that installs the package.

I discovered during testing if I do a command+I key during a package install it shows me where the files are. I guess in composer it puts the files where they were dragged from. There is no way to change the destination. I could add another line to delete the .app from Caches/Logitech but I don't think that is needed.

I was thinking that I could call those lines from a script within Jamf, but that is not the case.