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
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?
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
So I figured out what I needed to do in this, thank you @dmueller for you outstanding help on this.
- I put the .app file in /Library/Caches/Logitech
- Added the .app to a new Composer build
- 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
- Saved the Composer build as a .pkg
- 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.