Install missing AppStore purchase that’s not visibly available (like macOS Sierra)

Once macOS 10.13.0 High Sierra became officially available to the public, I decided to keep a backup of the macOS 10.12.6 Sierra installation application on my Mac, for archiving reasons. I normally do this when every new macOS release is out, since the 10.xx.0 versions tend to be buggy. I did the exact same thing with El Capitan 10.11.6 when Sierra was officially out, last fall.

However, to my surprise, when I visited the AppStore on my Mac, I could not find the Install macOS Sierra entry, which I had very well downloaded some time ago. It was either deleted from the AppStore or visibly not available to end-users, anymore. This was just days after High Sierra was out.

Whilst searching for answers, I stumbled across a discussion over at MacRumors Blog where people confirmed this, too, and expressed their dissatisfaction to the fact that Apple had removed Install macOS Sierra from their AppStore so quickly; not to mention a theory that this specific download doesn’t really make part of official or registered purchases by end-users, like all previous (and still available) Mac OS X releases. Strange.

But thanks to user jasminetroll and his/her straight-to-the-point tip, I was able to re-download Install macOS Sierra.app officially, using some Terminal magic and with very little hassle, compared to other (evidently, more painful) methods such as the one described over at 7 Labs.

The main tool needed is the mas-cli utility by Dmitri Rodionov, found at GitHub. Download the latest version (currently at v1.3.1) and unpack, then copy the binary executable to a location that you can freely run from; for example /opt/local/bin/ if you have MacPorts already present, or simply /usr/local/bin/ through Administrator authentication.

Next, just go to any temporary location such as ~/Downloads/ and run the command with the following parameters, as jasminetroll points out:

mas install 1127487414

The process will launch the download of the selected AppStore application (in this case, 1127487414 is linked to Install macOS Sierra) on both on the Terminal and Dock:

This rather easy process results to an application bundle that evidently contains a properly-signed MAS receipt linked to my connected Apple ID, it seems:

Once the download is complete, user jasminetroll advises to confirm the signature information as proof that it is indeed an official download of the Sierra installer:

codesign -dv /Applications/Install\ macOS\ Sierra.app

…that results to the following output on Terminal:

Executable=/Applications/Install macOS Sierra.app/Contents/MacOS/InstallAssistant_springboard
Identifier=com.apple.InstallAssistant.Sierra
Format=app bundle with Mach-O thin (x86_64)
CodeDirectory v=20200 size=321 flags=0x2200(kill,library-validation) hashes=4+3 location=embedded
Signature size=4605
Info.plist entries=30
TeamIdentifier=K36BKF7T3D
Sealed Resources version=2 rules=7 files=137
Internal requirements count=1 size=124

Now, an official Install macOS Sierra application is available to run!

…which also includes the very useful createinstallmedia tool by Apple that allows the creation of USB installers (via Terminal, of course).

JUNE 2018 UPDATE

It seems Apple now offers the chance to (re-)download a couple of previous OS versions by publishing on their Knowledge Base the direct links to AppStore:

For further reading, you can visit the related StackExchange thread.