Papercut Client 15.0 - automate installation over existing older installs

New Contributor

I'm looking to automate upgrading our fleet of OSX clients to the latest version of Papercut MF Client 15.0.

The "Mac" folder the OSX client software is found in on the Papercut Server looks like this


As per Papercut's recommended install instructions, the best way to install the client is to run:

Examining "" shows it contains a script that sets permissions correctly, etc in order for the app to run for all users on the target client once installed, so I definitely want to leverage this method if possible via Casper.

My questions is, is anyone out there using this method to automate their PCClient installs using Casper?

If so, can you please tell me how you are doing this? The manual process on the client would be to connect to a network share hosting the above file structure and run the file.

How do I go about automating this same process in Casper? Do all of the files in that structure need to be uploaded to the JSS repository? The flat structure of the JSS repository would make that very messy, not being able to place them all in a sub folder for organisation and ease of navigation.

Thanks very much.


Valued Contributor

Make a package that places all those files/directories (if they're all actually needed! if the instructions from paper cut tell you to just run the .app, you most likely only need the .app file, not the rest.) within a temporary directory on the target machines, then have the package run a postflight/postinstall script that opens the .app.
The only concern would be whether or not that is silent or not, and whether or not that matters in your environment.

New Contributor III

I recreated the Applescript app in Packages. However, you could use whatever package building utility is your favorite.

I update the installer version with the current long form build number of PaperCut.

Honored Contributor

I just deployed it out this week to end-users. Here's what I did using Packages.

Create a preinstall and postinstall script



#Determine current logged in user
User="$(who|awk '/console/ {print $1}')"

if [ -f /Library/LaunchAgents/com.papercut.client.agent.plist ]; then
    sudo -u "$User" /bin/launchctl unload $3/Library/LaunchAgents/com.papercut.client.agent.plist

ProcessCheck="$(ps axc | grep "${ProcessName}$" | awk '{print $5}')"

if [ "$ProcessCheck" = "$ProcessName" ]; then
    /usr/bin/killall JavaAppLauncher



#Determine current logged in user
User="$(who|awk '/console/ {print $1}')"

if [ -f /Library/LaunchAgents/com.papercut.client.agent.plist ]; then
    sudo -u "$User" /bin/launchctl unload $3/Library/LaunchAgents/com.papercut.client.agent.plist

ProcessCheck="$(ps axc | grep "${ProcessName}$" | awk '{print $5}')"

if [ "$ProcessCheck" = "$ProcessName" ]; then
    /usr/bin/killall JavaAppLauncher

sudo -u "$User" /bin/launchctl load /Library/LaunchAgents/com.papercut.client.agent.plist

You'll notice that I kill the process twice, once in the preinstall and again in the post install. May not be necessary to do it the second time but I just wanted to make sure that it wasn't suddenly launched again in that short time period before the postinstall ran.

Create a launchagent as per Papercut if you want to make sure the app launches every time at login:

Make sure launchagent has root:wheel 644 permissions.

  <?xml version="1.0" encoding="UTF-8"?>
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
  <plist version="1.0">

Open up Packages and do the following:
Copy the (from the Papercut server share) to /Applications
Copy the launchagent to /Library/LaunchAgent/
Add the preinstall and postinstall scripts accordingly.

You can do this in Composer too or any other packaging tool of your choice. If you do not want it to start at login then do not use the launchagent. Also be aware that if you do use the launchagent that the user does not also happen to have listed under Login Items. You do not want two instances of Papercut running.

And make sure to edit the config files located in and

You can open those text files with a text editor such as TextWrangler. Read through the config file and you will see what options are available. I set Silent=Y so that users do not get errors when the computer is off the network.

Hope this helps.

New Contributor II

Hello, nice script. But are you sure with the postinstall script, you kill agin the process ? if I use your script I have a java error. Mac OS 10.14.6 client PCClient V21. Thanks for your response at advance