Posted on 03-27-2022 05:17 PM
As of
macOS 11 (Big Sure) and macOS 12 (Monterey) the appstore extract script doesnt work due to changes in the directory structure and the manifest.plist files not being downloaded.
This updated script (v.3.1) resolves this issue and prompts the script use to type in a name to name the PKG and DMG like that of the previous naming convention.
https://github.com/blakeusblade/MacAdminHelpers/tree/master/AppStoreExtract
Solved! Go to Solution.
Posted on 04-15-2022 03:40 PM
This script isn't working for me on 12.3.1, whether I run as sudo or not:
08-23-2022 05:04 PM - edited 08-23-2022 06:18 PM
Dear All,
I think my instructions are a little lacking so will update them.
It should be noted that this script (v3.1) isn't designed to work using the appstore GUI. Its designed to be used with jamf using self service GUI to deploy an app to capture it. The end result is the same...
Step 1. Using jamf webUI, target a "Mac App Store" app to your capture machine. (Make avaliable to self service)
Step 2. Using your capture machine, check Self service that you can see your app
Step 3. Run the script using sudo eg "sudo sh ./AppstoreExtract_v3.1.sh"
Step 4. Click on Install in self service
Step 5. Wait until the app is installed and self service is completed the task
Step 6. Navigate to /Users/Shared/AppStore_Packages/ (There should be a PKG in there)
Step 7. Press any key in the script window to stop the script
Step 8. Name the package
Step 9. The PKG will be deleted and a DMG containing the PKG will be created
You now have a captured AppStore installer one can deploy out.
I've retested this on fresh installs on both macOS 11.6.8 and macOS 12.5.1 and confirmed that the above steps are working.
Important note (Scripting Writers/Users Only):
When jamf tells the machine to fetch/install something from the appstore, its done using sudo which will change the $DARWIN_USER_DIR_PATH. This is the reason why one MUST execute the script using sudo to use the correct $DARWIN_USER_DIR_PATH variable/path
Posted on 04-15-2022 03:40 PM
This script isn't working for me on 12.3.1, whether I run as sudo or not:
04-18-2022 05:01 PM - edited 04-18-2022 05:04 PM
Generally you should use sudo if your using the script to capture from jamf deployable app store app. If your using the actual apple store ie logging into the appstore after launching the app store, use without sudo.
I've just test run it again on a clean install of macOS 12.3.1 and is working as expected. It might be an (unclean or existing/messy home directory) that the default permissions have changed maybe... The errors/directories in the screenshot suggest that other things are either running or have been running and might have changed the permissions to the directory structure.
You could try creating a new account and trying again or on a clean install of macOS 12 with no changes but to run the script... I genreally always capture on/in clean environments thats just had macOS installed.
Posted on 04-21-2022 03:38 PM
Same thing happened on a fresh install on a different MacBook. Getting a bunch of operation not permitted. Nothing else has been installed :/
Posted on 04-21-2022 05:31 PM
Hmm... Can you confirm the following...
Are you using the Apple App Store or Jamf Pro to deploy and capture the app?
Could you supply each step/steps your using to capture?
Can you confirm your using V3.1 version of the script?
Your different macbook with a fresh install, has it been enrolled into jamf? and or been through DEP enrollment into jamf upon going through the setup assistant?
Happy to assist, maybe a zoom call might better.
Regards
Posted on 08-23-2022 09:35 AM
Any updates to this? I received similar "Operation not permitted" error messages with the script but continued until after I provided a name. It fails with the following error message:
"hdiutil: create failed - No such file or directory"
I can see the directory "AppStore_Packages" in the Users/Shared folder but it is empty.
I tested mine on Monterey 12.5 and Big Sur 11.6.5. with and without "sudo". Got the same results.
08-23-2022 05:04 PM - edited 08-23-2022 06:18 PM
Dear All,
I think my instructions are a little lacking so will update them.
It should be noted that this script (v3.1) isn't designed to work using the appstore GUI. Its designed to be used with jamf using self service GUI to deploy an app to capture it. The end result is the same...
Step 1. Using jamf webUI, target a "Mac App Store" app to your capture machine. (Make avaliable to self service)
Step 2. Using your capture machine, check Self service that you can see your app
Step 3. Run the script using sudo eg "sudo sh ./AppstoreExtract_v3.1.sh"
Step 4. Click on Install in self service
Step 5. Wait until the app is installed and self service is completed the task
Step 6. Navigate to /Users/Shared/AppStore_Packages/ (There should be a PKG in there)
Step 7. Press any key in the script window to stop the script
Step 8. Name the package
Step 9. The PKG will be deleted and a DMG containing the PKG will be created
You now have a captured AppStore installer one can deploy out.
I've retested this on fresh installs on both macOS 11.6.8 and macOS 12.5.1 and confirmed that the above steps are working.
Important note (Scripting Writers/Users Only):
When jamf tells the machine to fetch/install something from the appstore, its done using sudo which will change the $DARWIN_USER_DIR_PATH. This is the reason why one MUST execute the script using sudo to use the correct $DARWIN_USER_DIR_PATH variable/path
Posted on 11-06-2022 01:28 PM
"hdiutil:...." message disappeared after allowing Terminal to have "full disk access".