Script to install .dmg and .pkg using JamF School Scripts module

Michael_Powis
New Contributor

Hi,

I have a few programs i want to install on our new iMacs, Logic.pkg, Papercut.dmg, Sibelius.pkg & netsupport.dmg

I have searched and tried several scripts but nothing seems to work, JamF says the iMac has recieved the script but nothing happens.

the packages are currently stored on a munki repository accessible by URL, if its easier i can copy them to a network share?

i need it so they automatically download and install on the iMacs using Bash or Apple Script, i can see a lot of you are good at doing this type of scripting and i thank you for your help.

PaperCut website:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.papercut.client.agent</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/PCClient.app/Contents/MacOS/JavaAppLauncher</string>
</array>
<key>KeepAlive</key>
<true/>
</dict>
</plist>

 

thanks

Michael

3 REPLIES 3

AJPinto
Honored Contributor III

Why are you not having JAMF deploy the source files (pkg, dmg, etc)? If JAMF deploys the pkg, or dmg it will do everything needed to trigger the installation without further action on your part. The example you put in your post looks like a plist (maybe a launch agent), not a script.

 

If you must install a package with a script, the script below will do it. However, you still need to get the source files to the device. You can grab source files with CURL and script that, or use JAMF to cache the packages (or better use JAMF to install the packages). The choice is really up to you. 

 

#!/bin/zsh

######################
# Script Name: 
# Author: 
# Date: 
# Enhancements
######################

######################
# Exit Codes
# 0 - Success
# 1 - 
# 2 - 
######################

4=Package Name


##################################################################
# Reinstalling JAMF Protect
##################################################################

if [ -d "/Library/Application Support/JAMF/Waiting Room/$4" ]
	then
		echo "Something for the logs"
		echo "Something else for the logs"
		sudo installer -pkg "/Library/Application Support/JAMF/Waiting Room/$4" -target /
		echo "Install Completed"
		exit 0
	else
		echo 'Source files missing, exiting'
		exit 1
fi

##################################################################
# Deleting source files
##################################################################

sudo rm -rf "/Library/Application Support/JAMF/Waiting Room/$4"

 

Jam F School doesn't have that option, Jamf themselves told me I have to install using the script module.

If that's wrong please enlighten me, I just need to get it working now lol

Michael_Powis
New Contributor

Ok so more research it looks like i have to first mount the network share and then copy the PKG or DMG to a local folder on the MacBooks, then i can run the installer and remove the install file, still working on how to make this happen, but when a network user logs in on the MacBook the Network Share is already automatically mounted.