Home > Mac administration, macOS > Using the macOS High Sierra OS installer’s startosinstall tool to install additional packages as post-upgrade tasks

Using the macOS High Sierra OS installer’s startosinstall tool to install additional packages as post-upgrade tasks

Starting with macOS 10.12.4, Apple locked down the macOS installer to make it impossible to add non-Apple installer packages directly to the macOS Install .app without using NetInstall. However, there is a way to configure the macOS High Sierra OS installer to install additional packages as a post-upgrade task. For more details, please see below the jump.

Apple includes a command line tool named startosinstall as part of the macOS High Sierra OS installer application, inside Install macOS High Sierra.app/Contents/Resources.

 Screen Shot 2017 09 26 at 1 19 31 PM

This tool has several options, including a –installpackage option which allows one or more packages stored on the Mac in question to be installed following the upgrade.

computername:~ username$ "/path/to/Install macOS High Sierra.app/Contents/Resources/startosinstall" –usage
Usage: startosinstall
–applicationpath, a path to copy of the OS installer application to start the install with.
–license, prints the user license agreement only.
–agreetolicense, agree to license the license you printed with –license.
–rebootdelay, how long to delay the reboot at the end of preparing. This delay is in seconds and has a maximum of 300 (5 minutes).
–pidtosignal, Specify a PID to which to send SIGUSR1 upon completion of the prepare phase. To bypass "rebootdelay" send SIGUSR1 back to startosinstall.
–converttoapfs, specify either YES or NO on if you wish to convert to APFS.
–installpackage, the path of a package to install after the OS installation is complete; this option can be specified multiple times.
–usage, prints this message.
Example: startosinstall –converttoapfs YES
computername:~ username$

view raw
hosted with ❤ by GitHub

Something to be aware of is that if you want to add any additional packages, they must all be signed or unsigned distribution-style flat packages. This is a requirement that Apple first introduced for the OS X Yosemite installer and it still applies to macOS High Sierra. You can convert a component flat package to be a distribution-style flat packages by running the command below:

productbuild –package /path/to/component.pkg /path/to/distribution.pkg

To run an automated upgrade to macOS High Sierra, where two distribution-style flat packages stored in /Users/Shared are installed following the upgrade, please run the command shown below with root privileges:

/Applications/Install\ macOS\ High\ Sierra.app/Contents/Resources/startosinstall --applicationpath /Applications/Install\ macOS\ High\ Sierra.app --agreetolicense --installpackage /Users/Shared/installer_one.pkg --installpackage /Users/Shared/installer_two.pkg --nointeraction

Note: The –nointeraction flag is an undocumented option to automate the installation process from the command line without additional requiring actions by the logged-in user.

To show what the process looks like when upgrading from macOS Sierra, please see below for a video. In this example, I’m installing the latest Office 2016 installer following the upgrade.

Note: The video has been edited to artificially reduce the amount of time the upgrade and post-upgrade installation process takes to run. Run time of the pre-edited video was 32 minutes 57 seconds.

Categories: Mac administration, macOS
  1. HaroldB
    September 30, 2017 at 2:58 am

    Great guide!
    Thank You 😀

  2. Adam Vadala
    July 30, 2018 at 3:20 pm

    Will adding a third party package work if you use the –eraseinstall option?

    • Kevin
      August 8, 2018 at 2:37 pm

      I was thinking the same thing. The package to be installed afterwards must be copied to the installer disk image, though I haven’t tried it. I was hoping to use the erase disk flag but apparently it only works on an AFPS drive. I’m installing on Fusion drives.

  3. September 16, 2019 at 9:38 am

    This was very helpful for me

  4. Adam Vadala
    January 27, 2020 at 5:42 pm

    slight typo in the command above to create a distribution package. it should read “–package” with 2 dashes, instead of “-package” with one dash as written above.

  1. No trackbacks yet.

Leave a Reply to Adam Vadala Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: