Create Bootable Installation Media For High Sierra Installations

A bootable installer is one of the fastest ways to install a Mac. Rather than copy the installer to a local drive you can run it right off a USB disk (or Thunderbolt if you dare). Such a little USB drive would be similar to the sticks that came with the older MacBook Air, when we were all still sitting around wondering how you would ever install the OS on a computer with no optical media or Ethernet otherwise. Luckily, Apple loves us. To make a bootable USB/flash drive of High Sierra like the one that used to come with the MacBook Air, first name the USB drive. I’ll use hsinstall for the purposes of this article. The format should be Mac OS Extended Journaled, although the new system drive will be apfs on the target volume. The installer is called Install macOS Sierra and is by default located in the /Applications directory. Inside the app bundle, there’s a new binary called createinstallmedia (nested in Contents/Resources). Using this binary you can create an installation drive (similar to what we used to do with InstallESD). To do so, specify the –volume to create the drive on (note that the target volume will be erased), the path of the “Install macOS High Sierra” app bundle and then we’re going to select –nointeraction so it just runs through the whole thing

/Applications/Install\ macOS\High\ --volume /Volumes/hsinstall --applicationpath /Applications/Install\ macOS\ High\ --nointeraction

Note: You’ll need to elevate your privileges for this to run.

Once run you’ll see that it erases the disk, copies the Installation materials (InstallESX, etc) and then makes the drive bootable, as follows:

Erasing Disk: 0%... 10%... 20%... 100%... Copying installer files to disk... Copy complete. Making disk bootable... Copying boot files... Copy complete.

Then you can either select the new volume in the Startup Disk System Preference pane or boot the computer holding down the option key to select the new volume.

Note: If you can do this on a system with a solid state drive it will be  faster. Although this took 17 minutes last I ran it even then so be patient for the files to copy.

Delete User Configurable nvram In High Sierra (10.13)

A nifty little feature of nvram is the ability to delete all of the firmware variables you’ve created. This can get helpful if you’ve got a bunch of things that you’ve done to a system and want to remove them all. If you run nvkram followed by a -p option you’ll see all of the configured firmware variables:

nvram -p

If you run it with a -d you’ll delete the given variables that you define (e.g. boot-args):

nvram -d boot-args

But, if you run the -c you’ll wipe them all:

nvram -c

Remotely and Silently Install A Windows MSI Via PowerShell

One of the easiest things to do in OS X is to remotely run an installation package using the installer command. You can do some similar tasks in Windows, although the commands aren’t quite as cut and dry. The Start-Process command can be used to kick off an executable. Here, we will kick off the msiexec.exe and feed it an argument, which is the msi file to install silently. We’ll then wait for it to complete: {Start-Process -FilePath "msiexec.exe" -ArgumentList "/i TEST.msi /qb" -Wait -Passthru}

Receipts & Bills of Material in 10.8

When installing a package OS X makes a list of what it installs in /Library/Receipts/InstallHistory.plist. The dictionaries show each package installed, along with the installation date, the name displayed during installation, the version of the package being installed, the identifier of the package and the process name used to install the package. This information, along with the file name of the actual package is stored in corresponding property lists in /private/var/db/receipts. Each bill of material is also stored there, in .bom file. The lsbom command is used to see a list of objects installed by the package. You can also see the options such as the permissions assigned to files by the package as they’re installed. For example, that Twitter app from the app store; to see what it installs: lsbom /private/var/db/receipts/ This package is installed by the Mac App Store. When run, packages installed by the Mac App Store should only contain objects within that applications .app bundle. That’s a pretty good bit of information, so you can also use the -s option to constrain the output to only see the paths of files (relative paths, of course). I’m usually a fan of getting more information than less, so I usually run it adding the -m option, which shows me those permissions. lsbom /private/var/db/receipts/ Note: You can also use the mkbom command to create new .bom files. As the man page for bom indicates, this goes back to NeXTSTEP and was extended for 10.0 and again in 10.3.

Deploy Final Cut Pro Fast

One of the challenges that we face when building a large Xsan for video environments where we also need to deploy Final Cut is to install Final Cut Pro or Final Cut Studio on all the clients. It can mean a lot of switching out of optical media and kill productivity if you aren’t careful. This is why we started looking to the Xsan to provide some of the speed to the installation process that it will later provide to the clients. First off, extract the installers or create an image of the disk(s). If you extract the disk then you will need to mount it and then start the installer package, which can be done programmatically (assuming a disk image called FCInstaller.dmg located on an Xsan volume called simply SAN): hdid /Volumes/SAN/FCInstaller.dmg installer -verbose -pkg /Volumes/Final Cut Studio Install/Installer/FinalCutStudio.mpkg -target /Volumes/Final Cut Studio 3 Once installed, don’t forget to clean up after yourself by unmounting the drive. This can also be done programatically using the hdiutil command with the detatch option. You can use df or another tool to obtain the device and then unmount based on that device. For example, if df showed a device of /dev/disk3s2 for your installer disk image, then the following would unmount the disk image: hdiutil detach /dev/disk3s2 If you have multiple disk images then each will need to be mounted and unmounted separately. You can also mount them all manually by simply double-clicking on the dmg files. Performing the installation over point-and-click or programmatically can then be done on a number of Xsan clients concurrently. It provides a means of deploying Final Cut over fibre channel and beats the pants off the previous means of installation, which was mostly to either do optical media, ethernet or over firewire drives moved between stations via sneakernet. This type of deployment will also free up the Ethernet network for any other installers or processes that you are working on at the time. Also, as you get deployment packages and scripts built, you can host those on the Xsan as well. This allows for fast deployment of any suite. Anyway, hope it saves you a little time…

Positional Parameters and Packaging

When packaging it is worth note that Apple reserves some positional paremeters for your scripts. These are defined at They include:
  • $1: Path to the package
  • $2: Path to the destination.
  • $3: Installation volume.
  • $4: Root directory