SetupAssistant.plist bypass

ImAMacGuy
Valued Contributor II

Since the other threads are a little long in terms of upgrading to 10.9 through Self Service. I'd like to branch this off to discuss bypassing the AppleID setup.

I tried modifying this script that was found on this board with the keys from my SetupAssistant.plist, by adding these two lines and setting the script to run "after" in SS policy to install 10.9. It didn't work.

defaults write "${template}/Library/Preferences/com.apple.SetupAssistant" DidSeeSyncSetup2 -bool TRUE defaults write "${template}/Library/Preferences/com.apple.SetupAssistant" ShowKeychainSyncBuddyAtLogin -bool FALSE
#!/bin/bash

# updated from DeployStudio's ds_finalize.sh script by Ryan Manly 02-24-12

# man bash
shopt -s nullglob

# arrays are the safest way to deal with lots of strings in bash so let's make some!
user_templates=("/System/Library/User Template/"*)
user_homes=(/Users/*)

# why match to > 7 if they aren't here yet...?
if [[ $(sw_vers -productVersion | awk -F. '{ print $2 }') -eq 7 ]]; then

    for template in "${user_templates[@]}"; do
        defaults write "${template}/Library/Preferences/com.apple.SetupAssistant" DidSeeCloudSetup -bool TRUE
        defaults write "${template}/Library/Preferences/com.apple.SetupAssistant" GestureMovieSeen none
        defaults write "${template}/Library/Preferences/com.apple.SetupAssistant" DidSeeSyncSetup2 -bool TRUE
        defaults write "${template}/Library/Preferences/com.apple.SetupAssistant" ShowKeychainSyncBuddyAtLogin -bool FALSE
    done

    # I don't see why you would ever have a user directory for a valid user without having Library/Preferences
    # already in there anyway, so I got rid of the exception for Shared and the mkdir's etc.
    for home in "${user_homes[@]}"; do

        # /Users/Shared shouldn't have a ./Library/Preferences so just work on everything that does 
        if [[ -d "${home}/Library/Preferences" ]]; then

            defaults write "${home}/Library/Preferences/com.apple.SetupAssistant" DidSeeCloudSetup -bool TRUE
            defaults write "${home}/Library/Preferences/com.apple.SetupAssistant" GestureMovieSeen none
            defaults write "${template}/Library/Preferences/com.apple.SetupAssistant" DidSeeSyncSetup2 -bool TRUE
            defaults write "${template}/Library/Preferences/com.apple.SetupAssistant" ShowKeychainSyncBuddyAtLogin -bool FALSE

            # using bash's built-in parameter expansion features gets to the username MUCH more
            # quickly than the external program basename and we don't have to assign another variable
            chown "${home##*/}" "${home}/Library/Preferences/com.apple.SetupAssistant.plist"

        fi

    done

fi
1 REPLY 1

nessts
Valued Contributor II

I have been using a method of removing many parts of setup assistant over the past few years, so that only the pieces i cared about would execute. with 10.8 Apple made some changes and that is less elegant than before. Now with 10.9 they were supposed to have a great new useful feature to go with a request i put in with 10.6 that setup assistant could be controlled with a plist. Well they demo'd such behavior at WWDC, but all my digging and asking has turned up that it is sort of vapor ware and that maybe if you are a school or organization that buys tens of thousands of pieces of hardware they might make changes for you and help you to modify setup assistant. So back to my sub routine called hackSetupAssistant and again 10.9 has changed from 10.8, what i have found is that if you actually remove the iCloud setup assistant parts, then the users first login will never complete you get a greyish white screen and it sits there forever. I had to not remove those parts, but instead I found the plist from a machine i just ran the full setup on and grabbed com.apple.SetupAssistant.plist then copied it in to /System/Library/User Template/Non_localized/Library/Preferences so that all new users get it. Here is what it consists of.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict> <key>DidSeeCloudSetup</key> <true/> <key>DidSeeSyncSetup</key> <true/> <key>DidSeeSyncSetup2</key> <true/> <key>LastCacheCleanupProductVersion</key> <string>10.9</string> <key>LastCacheCleanupStillRunning</key> <false/> <key>LastPreLoginTasksPerformedBuild</key> <string>13A598</string> <key>LastPreLoginTasksPerformedVersion</key> <string>10.9</string> <key>LastSeenCloudProductVersion</key> <string>10.9</string> <key>RunNonInteractive</key> <false/> <key>ShowKeychainSyncBuddyAtLogin</key> <false/> <key>SkipFirstLoginOptimization</key> <false/>
</dict>
</plist>

I suppose we need to update the LastPreLoginTasksPerformedBuild key to 603 now but that seems to work just fine. of course for machines being upgraded you might want to copy the proper preference in to all of the existing homes.

you can of course do all of those defaults write commands but it just seems unnecessary when you can capture an existing file and use it.