Installing cached packages one by one

bentoms
Release Candidate Programs Tester

Hi all,

Anyone know a way to install cached packages one by one?

Not using a policy per package or install all cached.

1 ACCEPTED SOLUTION

cvgs
Contributor II

Well, it's a little tedious, but it can be done :-)

  1. Use one policy per package which caches the pkg to your clients
  2. Create a smart group "has cached my package" for each package
  3. Create a logout policy for each package, scoped to that smart group, which a) installs the package and b) uses jamfhelper to display a message like "Installing mypackage..."
  4. repeat ad libitum

View solution in original post

9 REPLIES 9

mm2270
Legendary Contributor III

Ben, can you clarify what you're looking for?

bentoms
Release Candidate Programs Tester

Sure. It's for an ihook window @ logout.

I'd like to notify the user like;

installing cached update 1 of x...
installing cached updated 2 of x...

mm2270
Legendary Contributor III

Ok, for that I think you'd need to custom script to do the installs using command line installer and not use the built in JAMF functionality, since I don't think you really have any control over it that way, nor any visibility into what its doing. Maybe I'm wrong on that, but I've never found a good way to get feedback from that. Perhaps the sudo jamf installAllCached command? Maybe it has a verbose to get some feedback on progress?

I have a rather long script I've put together for a custom install process we're beginning to use that utilizes cocoaDialog to show the number of updates (along with the name) in a progress bar window, showing real-time progress as each installation happens. I don't know if something like that would be compatible with iHook though. I've heard of it, but never really used it.

bentoms
Release Candidate Programs Tester

Thanks Mike.

installAllCached does echo out each step, I just wanted to give the end users a kind of progress.

Nvm, probably being too precious about it.

Oh & I'm using iHook & not CocoaDialog as I wanted a progress bar with an image & running @ logout.

cvgs
Contributor II

Well, it's a little tedious, but it can be done :-)

  1. Use one policy per package which caches the pkg to your clients
  2. Create a smart group "has cached my package" for each package
  3. Create a logout policy for each package, scoped to that smart group, which a) installs the package and b) uses jamfhelper to display a message like "Installing mypackage..."
  4. repeat ad libitum

franton
Valued Contributor III

Do they have to be cached?

Our deployment and update system runs with iHook based off manual triggers. Script does other misc tasks and then calls the jamf binary to execute the trigger, everything needed installs and that's it.

cvgs
Contributor II

No, they do not have to be cached. We just happen to do all our installs at logout time and want to keep the install time as short as possible. Thus we cache during the day using every15 and then install the cached packages at logout with a notification script.

franton
Valued Contributor III

As my previous post stated, we have a manual trigger to do updates. This is run through a script running through iHook.

What we do is set the scheduling on the computers to turn themselves on at 2am, execute a policy that installs all of this and restarts the computer. That allows a launchd plist to run the updates over the loginwindow. The computer then updates itself, deletes the update files and turns itself off.

We do it that way to avoid inconveniencing students and staff during operational hours.

bradtchapman
Valued Contributor II

Kind of a late reply, I suppose, but it may help some folks.  

The command jamf install is one of the oldest methods in the jamf binary.  It will process both DMG and PKG.  Recently, I discovered quite by accident that it also can be used for items in the Waiting Room, and that it will clean up cached packages automatically.

Those of you who have been using jamf installAllCached will perhaps find it useful to know that this command is a built-in shortcut that iterates through all items in the Waiting Room, and runs jamf install until they are gone.

Here is an example of how to use jamf install.  Through trial and error, I learned that the 'path' and 'package' switches operate slightly differently than the macOS installer command.  With the jamf binary, you must specify the -path to the package separately.  The -package argument only accepts the filename, and not any path components.

Examples below for comparison:

 

macOS installer binary:
sudo installer -pkg /path/to/directory/ThePackageFileName.pkg -target /

jamf binary:
sudo jamf install -path /path/to/directory -package ThePackageFileName.pkg -target /

 

By playing around with it, this is how I accidentally deduced that jamf installAllCached just installs everything in the list one by one, as OP has expressed a desire to do.  And when jamf detects the package is in the Waiting Room—it's looking for the corresponding .cache.xml file—it cleans up after a successful installation.

From there, all you need to do is write a script that for-loops through the Waiting Room items and displays jamfHelper or swiftDialog messages to the user about the installation progress.

@cvgs @franton @mm2270 @bentoms