Reinstall a clean macOS with One Button

Eigger
Contributor III

Hi Admins, we are testing the https://www.jamf.com/blog/reinstall-a-clean-macos-with-one-button/

After the process and we decided to leave the install macOS High Sierra.app in /Applications? How does one protect the user from clicking/running it? Is there a way to hide it from the Users like make it a hidden file?

6 REPLIES 6

marklamont
Contributor III

change the permissions so only root can see it, or place it else where which is what we do. All our builds have a Management folder which has subfolders for various things we can use like graphics, Documents and Deployments which is where we place the OS installer.
like this /Library/corpnamemanagement/Deployments.

davidacland
Honored Contributor II
Honored Contributor II

You can use chflags hidden /Applications/appname.app to hide things like that. In recent OSes, it doesn't work on built-in apps (you get a "Operation not permitted" error), but might still work for Install macOS.app.

(use chflags nohidden... to make items visible again)

niacobelli
New Contributor III

Hi, when I go by the blog post and try it on a test machine, it does not do anything. It has the most current High Sierra.app from the app store. When I go into Terminal it brings back an error code: 800.

Any ideas?

talkingmoose
Honored Contributor II

@niacobelli, I believe that error 800 indicates the drive may not be formatted as APFS. To verify, open Disk Utility and you'll find it's either HFS+ (not supported with this command) or APFS.

Eigger
Contributor III

@davidacland after hiding the install macOS using chflags, we should be able to use the script right since it is being run by root? sorry, I don't have the means to test right now. Thanks Sir!

davidacland
Honored Contributor II
Honored Contributor II

Yes, the script will still work as chflags only hides the app from the GUI. Command-line is unaffected.