Posted on 01-25-2021 01:28 PM
Hi ,
I want to test a application in jamf using parameters.I am completely new to Jamf and scripting.
sudo /Users/p/Downloads/ABCD Installer 8.app/Contents/MacOS/ABC Installer --quiet --update No --analytics No
The above code works in terminal.
How do I test same in Jamf ?
How do I get to know the application path in Jamf ?
and what should be the script ?
is it going to be 1 line scirpt ?
Solved! Go to Solution.
Posted on 01-25-2021 02:50 PM
I commented on your other post that I wasn't sure what you were trying to attempt, but I see now what you want to do.
The best way, in my opinion, would be to do this using a PKG file with a postinstall script. But if you're new to Mac management (unclear from your post) that might be a little bit much. I would suggest, if you can, picking up this book from @arminBriegel about packaging in macOS. It will help you a lot.
You could use Composer to create the package. I would suggest reviewing the Composer user guide for how to do this. You're going to want to add a postinstall script to the package that runs your command.
I would have Composer install the .app
file into /private/tmp
and then your script could be as simple as:
#!/bin/zsh
/private/tmp/ABCD Installer 8.app/Contents/MacOS/ABC Installer --quiet --update No --analytics No
Another option would be to create a package in Composer that simply drops the .app
file into /private/tmp
, add that to a policy, and then place /private/tmp/ABCD Installer 8.app/Contents/MacOS/ABC Installer --quiet --update No --analytics No
into the Execute Command
field of the Files and Processes
tab of a policy.
Hope that helps point you in the right direction.
Posted on 01-25-2021 02:50 PM
I commented on your other post that I wasn't sure what you were trying to attempt, but I see now what you want to do.
The best way, in my opinion, would be to do this using a PKG file with a postinstall script. But if you're new to Mac management (unclear from your post) that might be a little bit much. I would suggest, if you can, picking up this book from @arminBriegel about packaging in macOS. It will help you a lot.
You could use Composer to create the package. I would suggest reviewing the Composer user guide for how to do this. You're going to want to add a postinstall script to the package that runs your command.
I would have Composer install the .app
file into /private/tmp
and then your script could be as simple as:
#!/bin/zsh
/private/tmp/ABCD Installer 8.app/Contents/MacOS/ABC Installer --quiet --update No --analytics No
Another option would be to create a package in Composer that simply drops the .app
file into /private/tmp
, add that to a policy, and then place /private/tmp/ABCD Installer 8.app/Contents/MacOS/ABC Installer --quiet --update No --analytics No
into the Execute Command
field of the Files and Processes
tab of a policy.
Hope that helps point you in the right direction.
Posted on 01-27-2021 02:24 AM
Thank you for your response. Yes, I am very new with jamf and scripts and its the first time I am trying to achieve something.
However is there any alternative to /private/tmp ? Since it a /tmp is a writable directory and its a abit unsafe from security point of view. All I want to achieve is disable some UI elements from application by passing parameters.
Posted on 01-27-2021 06:16 AM
The standard practice is to delete installers from /tmp after you've run them, so they only exist for a limited time, which reduces the security exposure
Posted on 01-27-2021 06:27 AM
@stevewood and @sdagley are right on target. This is typically what a lot of folks do with customized installers. You get them to work well silently first. Then you build a “dummy” payload free package that dumps the real installer somewhere on the drive, run it using your customizations, then delete it afterward and force a reboot if necessary afterward. While Adobe installers are not a good example of ANYTHING, that is essentially what their console-generated pkgs do. They inject everything they need for their customized setup app onto the machine, run it as a script and then remove it.
Posted on 01-27-2021 02:12 PM
Hi I tried following steps,
copy pasted .app file in private/tmp folder
Dragged and dropped it in Composer and converted into .pkg and saved it in /tmp
Added this as a package in Jamf
Added this package to policy
And then placed /private/tmp/ABCD Installer 8.pkg/Contents/MacOS/ABC Installer --quiet --update No --analytics No into the Execute Command field of the Files and Processes tab of a policy
And it worked like gem :) thank you so much for guiding me .
How can I delete it from /private/Tmp post installation?