MacOS Install with EraseInstall & InstallPackage Flags?

ShaunRMiller83
Contributor III

If this has already been posted or asked I apologize. I looked here and googled this and got no clear answer on it.

Is it possible to use the EraseInstall and InstallPackage flags with a MacOS Install?

I've found various scripts with packages being called up with the InstallPackage flag and the paths to those packages are in /Users/Shared.

My confusion is that if I'm doing an EraseInstall. Their wouldn't be any packages in the Shared folder. Do I need to put the additional packages in the install media and call that up in the InstallPackages flag?

4 REPLIES 4

sshort
Valued Contributor

@ShaunRMiller83 You would pre-stage the additional pkgs you want installed, so many people choose the /Users/Shared folder for that purpose (but it can be somewhere else).

When you run startosinstall --installpackage /path/to/pkg --eraseinstall the operating system does some magic to copy your pkgs to a hidden APFS container so it's "saved" for later. Then after the drive is wiped it can pull those installers for you.

ShaunRMiller83
Contributor III

Thanks for the reply... Simple enough. I knew I was over thinking it!

I am going to give that a test now.

SCADtom
New Contributor III

Any idea if there is a limit to the size of the package?
I'm getting crazy ideas about using this for the Office and Adobe Suites.

m_donovan
Contributor III

I have seen a demo by an Apple SE who had the full office package installed. I don't recall if he said there was a limit but I don't think there is. You would need to push the packages out before sending the command.