Providing access to Mac App Store applications via Self Service policies
In my shop, we’re not currently using Apple’s VPP program for purchasing applications from the Mac App Store (MAS). However, we do want to make it convenient for our users to be able to access and install some commonly used applications which are available from the App Store. Casper 9.4 and later natively supports providing access to MAS applications, but this approach is more focused on VPP-purchased applications. In my shop’s case, our customers are more likely to purchase apps from the MAS using Apple’s consumer payment model and then get reimbursed.
To help with this, I originally used a process similar to this one developed by Bryson Tyrell. I wanted to make the process more modular though, where I only needed to supply a URL from the MAS and have a scripted solution handle the rest. For more details, see below the jump.
To help address this issue in my own shop, I wanted to be able to do the following:
- Provide a way to open the Mac App Store application from Self Service
- Open the Mac App Store application using the logged-in user’s privileges, even if the script itself is being run as root
- Go to a specified application’s page in the Mac App Store
To accomplish this, I wrote the following script. It uses launchctl to open the Mac App Store application using the logged-in user’s privileges, and uses the best launchctl method for the customer’s version of OS X or macOS. It also is designed to use Casper’s Parameter 4 ($4) value for the address of a specified application’s page in the Mac App Store, which allows the script to be used by multiple policies to open the policy’s desired application page in the MAS.
The script is also available on GitHub via the link below:
From there, I uploaded the script to Casper and set the parameter label for Parameter 4 to the following:
Mac App Store address
When setting up a policy using the script, the first thing you need is the URL of the application’s page in the Mac App Store. You can get the URL using the following method:
1. Open the Mac App Store
2. Click the disclosure triangle next to the app’s price
3. Select Copy link
After clicking the Copy link option, the URL for that Mac App Store page is copied to the clipboard and can be pasted where needed.
Note: For more information on this process, please see the following Apple developer documentation:
Technical Q&A QA1633: Creating easy-to-read short links to the App Store for your apps and company
Once you have the URL, a Self Service policy in Casper can be set up to use the script to open the Mac App Store and display specified application’s page in the MAS. For the Parameter 4 ($4) value, use the URL taken from the application’s page the Mac App Store page. It will be automatically translated to use the correct macappstore:// address
For example, to access the Slack application page on the Mac App Store, enter the following URL:
The script will translate it to the following URL, which will trigger the Mac App Store application
to open the URL instead of the user’s default web browser:
From there, you can build a Self Service policy which uses the script and the Mac App Store application’s URL. Here’s an example policy that installs the Slack application from the Mac App Store.
Once built, the policy should be available in Self Service for your users to access.
Please see below for what the process looks like from the customer’s perspective.