In-Place macOS Sierra Upgrade Script

TylerC
New Contributor III

Hello,

I am trying to follow this guide from JAMF: https://www.evernote.com/shard/s398/sh/bec8a262-e33d-4ad9-80fa-05b939db6d8d/f4ca396a63caa510

I am using the script noted here: https://www.evernote.com/shard/s398/sh/bec8a262-e33d-4ad9-80fa-05b939db6d8d/f4ca396a63caa510/res/9163d1d7-3bbf-4e2f-b70a-0cd447c749a1/startosinstall.sh

I got everything else working so far (you do need another policy to place the .dmg in the applications folder that the article neglects to tell you). I would like the script to force the restart instead of being "soft". I tested it and found that any open application will stop the upgrade.

Just need it to forcibly and immediately preform the restart.

Thanks.

Here is the script:

#!/bin/bash
/Applications/Install macOS Sierra.app/Contents/Resources/startosinstall --applicationpath "/Applications/Install macOS Sierra.app" --volume $1 --rebootdelay 30 --nointeraction
killall "Self Service"
126 REPLIES 126

metalfoot77
Contributor II

@Rosko thanks very much for your help with this. I am starting back from scratch with the Sierra build and letting it go through the script to see what I can collect. I'll reply with what I find.

metalfoot77
Contributor II

@Rosko I found something in my install.log that hints at an issue with the targeted drive. Basically I am half completing the script and it upgrades to High Sierra but never converts to APFS (and finishes wiping the drive etc). The same situation as this post:

https://www.jamf.com/jamf-nation/discussions/26978/unable-to-upgrade-macos

I should also mention that I am running a bootcamp partition as these lab computers have the option to dual-boot into Windows if chosen.

jhalvorson
Valued Contributor

Is there a blog or wiki that explains how create a policy to use the script macOSUpgrade.sh created by @Rosko ?

I forgot if the Self Service policy should include a "Restart Options" or a restart by way of "Files and Process > Excute command". Or is the reboot already a function of

startosinstall

command?

RLassus
Release Candidate Programs Tester

@alex030cc What directory did you place your launch agent in? I have FV2 Encrypted Macs and am looking to get this going with @Rosko 's script.

alex030cc
New Contributor II

@RLassus take a look at @Rosko 's Script shared on Github. He already implemented the LaunchAgent to his script. He uses the general "/Library/LaunchAgent/" path. But this will not matter. You can launch it from any path. However, use the provided script will be the easiest way.

Mikep62
New Contributor II

Just a quick note to say that when installing 10.12.6 via script to startosinstall in older versions(up to10.12.3) it had the --volume entry in the script which if removed makes the script work with Sierra 10.12.6. i.e.
startosinstall --volume / --applicationpath
change to
startosinstall --applicationpath
Had me fooled for a while.

cyberook
New Contributor

Thank you @Rosko for the effort and support you are putting into your script.

I am in the process of trying to deploy High Sierra via Self Service and was stuck for the longest time putting in the user variables.

It turns out, every time I tried to put in /Applications/Install macOS High Sierra.app in variable $4, the JSS would give an error and tell me to check the logs. Checking the logs, I find:

QueryException: Data too long for column 'parameter_1' at row 1

I presume this is MySQL barking at me.

Sure enough, if I put in a shorter path it works.

I am now trying it with the string hard-coded into the script.

Anybody else have issues with the user variables?