Posted on 03-23-2017 05:54 AM
Hey All,
I feel like this question has been answered in many parts over many threads, but I'm pretty noobish and having trouble putting it all together. I'm looking for the best way to accomplish the following:
User downloads one file (assumedly a DMG)
User opens the DMG, runs "RUN-ME-FIRST" file (type to be determined)
System automagically installs an app (prompting user for credentials along the way, and yes this has already written and functional)
Once complete, system automagically runs a script which will move a file included on the DMG to the System/Library/LaunchAgents folder, then runs a modification to permissions on that file
My goal is to have this whole process kick off with one click from the user after they've opened the DMG. Can I do this with a bash script?
This is for running the user client for PaperCut and setting it up to automatically start at user login.
Posted on 03-23-2017 09:12 AM
Hi
I packaged up the login hook and added it to the policy along with the paper cut installer.
Works great
Posted on 03-23-2017 10:26 AM
CapU,
Can you elaborate on that setup for PaperCut? That's exactly what I have been struggling with.
Thanks,
brs
Posted on 03-23-2017 11:02 AM
@Fissionchips What you're asking for is easily accomplished with a post install script as part of a .pkg. Is there a specific reason you're trying to do this as a .dmg instead? You could use a .dmg, Casper policy, and a script but it should be much easier with a .pkg and Composer makes it pretty easy to build.
Posted on 03-23-2017 11:41 AM
I originally looked at doing it as a PKG, but perhaps was using the wrong tool. I've been attempting using a free tool called Iceberg. I couldn't make sense of how it was selecting source files and their destination. Sounds like Jamf Composer is easier?
Posted on 03-23-2017 11:42 AM
I used Composer to assist in capturing the settings in the application and to be sure Papercut was in the correct location. When I got an updated version I installed paper cut then manually copied the file into Applications. For some reason its wasn't updating. I used a tool called Lingon to help me get the login hook and packed it seperatley so I can just add the login hook package to any paper cut updates in the future.
Posted on 03-23-2017 11:43 AM
CapU, your method also interests me. Did you modify PaperCuts "Client-local-install.app" to include the login hook?
Posted on 03-23-2017 12:08 PM
@Fissionchips Yes, Jamf Composer has a much more approachable UI than Iceberg. In addition to the ability to manually create a .pkg (or .dmg) by specifying what files you want included you can have it do a before and after snapshot of a 3rd party's installer in order to capture what they do then build on it for your own installer.
Posted on 03-23-2017 12:52 PM
@Fissionchips Just using Composer to create a snapshot won't create the login hook. I used Lingon then created a package with the login hook seperate so I can just apply the login hook to future installs
Posted on 03-23-2017 01:01 PM
@Fissionchips Reading your post again...I wouldn't be able to trust my users with installing anything themselves. Here we (I) either push the software, run a policy or have the Tech run Self Service. If it's run from Self Service then the package has to be a 1 click no questions asked procedure.
Posted on 03-24-2017 09:36 AM
Just so we're all on the same page, this is how I handle Papercut client. There are likely better ways, but this way is mine:
1) On a machine with Composer, create a LaunchAgent for the papercut client as per the following instructions: (https://www.papercut.com/kb/Main/MacClientStartupWithLaunchd) and place it in /Library/LaunchAgents
2) Install PCClient on that machine and modify any settings you need in /Applications/PCClient/Contents/Resources/config.properties
-All I do is simply uncomment (remove the # symbol) the line #hide-balance=y and then save the file.
3) Open Composer, cancel the wizards that auto launch and then drag in the PCClient app (/Applications/PCClient). This will create a new composer package/dmg "policy".
4) Drag the LaunchAgent (com.papercut.client./plist) into the same window so that it looks like this:
5) Check your permissions on these two files. Mine look like this:
After this, package as you wish. I use .dmg because I create uninstallers out of this policy (One HAS to unload the launchAgent before uninstalling, FYI)