Skip to main content

Mac OS X "SOE" Day 4

Page Redirection > continued from day 3...

Now that the essential stuff has been done for the "build" phase you could add some other nice things. Here's some of the stuff I'm doing.
  1. User Templates preferences.
  2. Disable the Registration Wizard.
  3. Enable Access for Assistive Devices
  4. Disable Dockfixup
  5. Cleanup default PPDs
  6. Symlink for Directory Utility
  7. Symlink for Printer Utility
  8. Symlink for Screen Sharing

Obviously there is an infinite number of things you can do, these are just the things I do :)

Modify default user template preference.

NOTE : You may want to do prior to STEP 3 in the build phase so that a) your locally created admin accounts get the same prefs and b) so you can use your locally created admin accounts to test the prefs settings.
#* Default preferences.
#+ Modifies /System/Library/User Template
#+ Note : I copy com.apple.dock.plist and com.apple.sidebarlists.plist as they are too messy to write.
for USER_TEMPLATE in `sudo ls /System/Library/User\ Template`
do
 if [ -r "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences" ]; then
  /bin/echo "Modifying /System/Library/User Template/${USER_TEMPLATE}/Library/Preferences"
  # com.apple.ATS.plist
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.ATS" ATSAutoActivation -string ATSAutoActivationDisable
  # com.apple.desktop.plist
  sudo ${PLISTB} -c 'Add Background:default:BackgroundColor array' "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.desktop.plist" 
  sudo ${PLISTB} -c 'Add Background:default:BackgroundColor:0 real 0' "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.desktop.plist"
  sudo ${PLISTB} -c 'Add Background:default:BackgroundColor:1 real 0' "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.desktop.plist"
  sudo ${PLISTB} -c 'Add Background:default:BackgroundColor:2 real 0' "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.desktop.plist"
  sudo ${PLISTB} -c 'Add Background:default:DrawBackgroundColor bool true' "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.desktop.plist"
  sudo ${PLISTB} -c 'Add Background:default:ImageFilePath string /Library/RDA/FWDrop/Desktop/RDA/Midnight.peg.png' "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.desktop.plist"
  # com.apple.desktopservices.plist
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.desktopservices" DSDontWriteNetworkStores -bool TRUE
  # com.apple.DiskUtility.plist
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.DiskUtility" advanced-image-options -bool YES
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.DiskUtility" DUDebugMenuEnabled -bool YES
  # com.apple.finder.plist
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.finder" _FXShowPosixPathInTitle -bool NO
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.finder" FXDefaultSearchScope -string SCcf
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.finder" FXPreferredViewStyle -string Nlsv
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.finder" NewWindowTarget -string PfHm
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.finder" ShowHardDrivesOnDesktop -bool NO
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.finder" ShowMountedServersOnDesktop -bool YES
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.finder" ShowRemovableMediaOnDesktop -bool YES
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.finder" ShowPathbar -bool YES
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.finder" ShowStatusbar -bool YES
  # com.apple.FontBook.plist
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.FontBook" FBValidateFontsBeforeInstalling -bool NO
  # com.apple.iTunes.plist
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.iTunes" disableCheckForUpdates -bool YES
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.iTunes" disableGeniusSidebar -bool YES
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.iTunes" disableGetAlbumArtwork -bool YES
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.iTunes" disablePing -bool YES
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.iTunes" disablePingSidebar -bool YES
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.iTunes" disablePodcasts -bool YES
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.iTunes" disableRadio -bool YES
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.iTunes" disableSharedMusic -bool YES
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.iTunes" dontAutomaticallySyncIPods -bool YES
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.iTunes" lookForSharedMusic -bool NO
  # com.apple.NetworkBrowser.plist
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.NetworkBrowser" BrowseAllInterfaces -bool NO
  # com.apple.Safari.plist
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.Safari" AutoFillFromAddressBook -bool NO
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.Safari" AutoFillMiscellaneousForms -bool NO
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.Safari" AutoFillPasswords -bool NO
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.Safari" IncludeDebugMenu 1
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.Safari" LastDisplayedWelcomePageVersionString -string 4.0
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.Safari" NewWindowBehaviour 0
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.Safari" RestoreSessionAtLaunch -bool NO
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.Safari" WebKitJavaScriptCanOpenWindowsAutomatically -bool YES
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.Safari" ShowStatusBar -bool YES
  # com.apple.SetupAssistant.plist
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.SetupAssistant" DidSeeCloudSetup -bool YES
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.SetupAssistant" GestureMovieSeen none
  # com.apple.systempreferences.plist
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.systempreferences" HiddenPreferencePanes -array "com.apple.preference.startupdisk" "com.apple.prefs.backup" "com.apple.preferences.softwareupdate" "com.apple.preferences.parentalcontrols" "com.apple.preference.internet" "com.apple.preferences.internetaccounts" "com.apple.preferences.icloud" "com.apple.preferences.sharing" "com.apple.preference.desktopscreeneffect" "com.apple.preference.security" "com.apple.preference.engerysaver"
  # com.apple.symbolichotkeys.plist (Disable Dashboard and Mission Control Keys so they are default Fn keys)
  sudo ${PLISTB} -c "Add :AppleSymbolicHotKeys:32:enabled bool NO" /System/Library/User\ Template/${USER_TEMPLATE}/Library/Preferences/com.apple.symbolichotkeys.plist
  sudo ${PLISTB} -c "Set :AppleSymbolicHotKeys:32:enabled NO" /System/Library/User\ Template/${USER_TEMPLATE}/Library/Preferences/com.apple.symbolichotkeys.plist
  sudo ${PLISTB} -c "Add :AppleSymbolicHotKeys:33:enabled bool NO" /System/Library/User\ Template/${USER_TEMPLATE}/Library/Preferences/com.apple.symbolichotkeys.plist
  sudo ${PLISTB} -c "Set :AppleSymbolicHotKeys:33:enabled NO" /System/Library/User\ Template/${USER_TEMPLATE}/Library/Preferences/com.apple.symbolichotkeys.plist
  sudo ${PLISTB} -c "Add :AppleSymbolicHotKeys:34:enabled bool NO" /System/Library/User\ Template/${USER_TEMPLATE}/Library/Preferences/com.apple.symbolichotkeys.plist
  sudo ${PLISTB} -c "Set :AppleSymbolicHotKeys:34:enabled NO" /System/Library/User\ Template/${USER_TEMPLATE}/Library/Preferences/com.apple.symbolichotkeys.plist
  sudo ${PLISTB} -c "Add :AppleSymbolicHotKeys:35:enabled bool NO" /System/Library/User\ Template/${USER_TEMPLATE}/Library/Preferences/com.apple.symbolichotkeys.plist
  sudo ${PLISTB} -c "Set :AppleSymbolicHotKeys:35:enabled NO" /System/Library/User\ Template/${USER_TEMPLATE}/Library/Preferences/com.apple.symbolichotkeys.plist
  sudo ${PLISTB} -c "Add :AppleSymbolicHotKeys:36:enabled bool NO" /System/Library/User\ Template/${USER_TEMPLATE}/Library/Preferences/com.apple.symbolichotkeys.plist
  sudo ${PLISTB} -c "Set :AppleSymbolicHotKeys:36:enabled NO" /System/Library/User\ Template/${USER_TEMPLATE}/Library/Preferences/com.apple.symbolichotkeys.plist
  sudo ${PLISTB} -c "Add :AppleSymbolicHotKeys:37:enabled bool NO" /System/Library/User\ Template/${USER_TEMPLATE}/Library/Preferences/com.apple.symbolichotkeys.plist
  sudo ${PLISTB} -c "Set :AppleSymbolicHotKeys:37:enabled NO" /System/Library/User\ Template/${USER_TEMPLATE}/Library/Preferences/com.apple.symbolichotkeys.plist
  sudo ${PLISTB} -c "Add :AppleSymbolicHotKeys:52:enabled bool NO" /System/Library/User\ Template/${USER_TEMPLATE}/Library/Preferences/com.apple.symbolichotkeys.plist
  sudo ${PLISTB} -c "Set :AppleSymbolicHotKeys:52:enabled NO" /System/Library/User\ Template/${USER_TEMPLATE}/Library/Preferences/com.apple.symbolichotkeys.plist
  sudo ${PLISTB} -c "Add :AppleSymbolicHotKeys:59:enabled bool NO" /System/Library/User\ Template/${USER_TEMPLATE}/Library/Preferences/com.apple.symbolichotkeys.plist
  sudo ${PLISTB} -c "Set :AppleSymbolicHotKeys:59:enabled NO" /System/Library/User\ Template/${USER_TEMPLATE}/Library/Preferences/com.apple.symbolichotkeys.plist
  sudo ${PLISTB} -c "Add :AppleSymbolicHotKeys:62:enabled bool NO" /System/Library/User\ Template/${USER_TEMPLATE}/Library/Preferences/com.apple.symbolichotkeys.plist
  sudo ${PLISTB} -c "Set :AppleSymbolicHotKeys:62:enabled NO" /System/Library/User\ Template/${USER_TEMPLATE}/Library/Preferences/com.apple.symbolichotkeys.plist
  sudo ${PLISTB} -c "Add :AppleSymbolicHotKeys:63:enabled bool NO" /System/Library/User\ Template/${USER_TEMPLATE}/Library/Preferences/com.apple.symbolichotkeys.plist
  sudo ${PLISTB} -c "Set :AppleSymbolicHotKeys:63:enabled NO" /System/Library/User\ Template/${USER_TEMPLATE}/Library/Preferences/com.apple.symbolichotkeys.plist
  sudo ${PLISTB} -c "Add :AppleSymbolicHotKeys:64:enabled bool NO" /System/Library/User\ Template/${USER_TEMPLATE}/Library/Preferences/com.apple.symbolichotkeys.plist
  sudo ${PLISTB} -c "Set :AppleSymbolicHotKeys:64:enabled NO" /System/Library/User\ Template/${USER_TEMPLATE}/Library/Preferences/com.apple.symbolichotkeys.plist
  sudo ${PLISTB} -c "Add :AppleSymbolicHotKeys:65:enabled bool NO" /System/Library/User\ Template/${USER_TEMPLATE}/Library/Preferences/com.apple.symbolichotkeys.plist
  sudo ${PLISTB} -c "Set :AppleSymbolicHotKeys:65:enabled NO" /System/Library/User\ Template/${USER_TEMPLATE}/Library/Preferences/com.apple.symbolichotkeys.plist
  sudo ${PLISTB} -c "Add :AppleSymbolicHotKeys:73:enabled bool NO" /System/Library/User\ Template/${USER_TEMPLATE}/Library/Preferences/com.apple.symbolichotkeys.plist
  sudo ${PLISTB} -c "Set :AppleSymbolicHotKeys:73:enabled NO" /System/Library/User\ Template/${USER_TEMPLATE}/Library/Preferences/com.apple.symbolichotkeys.plist
  # com.apple.TimeMachine.plist
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.TimeMachine" DoNotOfferNewDisksForBackup -bool YES
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.TimeMachine" AutoBackup -bool NO
  # com.apple.universalaccess.plist
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.universalaccess" voiceOverOnOffKey -bool NO
  # .GlobalPreferences
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/.GlobalPreferences" AppleKeyboardUIMode -int 2
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/.GlobalPreferences" AppleMiniaturizeOnDoubleClick -bool YES
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/.GlobalPreferences" AppleShowAllExtensions -bool YES
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/.GlobalPreferences" AppleShowScrollBars -string "Always"
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/.GlobalPreferences" NSAutomaticSpellingCorrectionEnabled -bool NO
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/.GlobalPreferences" NSAutomaticWindowAnimationsEnabled -bool NO
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/.GlobalPreferences" NSNavPanelExpandedStateForSaveMode -bool YES
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/.GlobalPreferences" NSQuitAlwaysKeepsWindows -bool NO
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/.GlobalPreferences" PMPrintingExpandedStateForPrint -bool YES
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/.GlobalPreferences" com.apple.swipescrolldirection -bool NO
  sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/.GlobalPreferences" com.apple.keyboard.fnState -bool YES
 fi
done

Enable Access for Assistive Devices so you can script GUI elements with Applescript if you really need to.
# Enable Access for Assistive Devices.
sudo touch /private/var/db/.AccessibilityAPIEnabled

Remove dockfixup so you can set your default dock.
# Remove dockfixup.
sudo /bin/mv -f /Library/Preferences/com.apple.dockfixup.plist{,.BACKUP}

Disable or remove default PPDs (using deployment scripts during localisation to move the relevant ppds back), I used to do this because of they Quark would populate its printer dialog with all PPDs. InDesign seems to auto select the PPD so not sure how long I will continue this.
# Disable /Library/Printers/PPDs
sudo /bin/cp -R /Library/Printers/PPDs/Contents/Resources /Library/PrintersPPDsDisabled
sudo /bin/rm -R /Library/Printers/PPDs/Contents/Resources/*.*
# Disable /System/Library/Printers/PPDs
sudo /bin/cp -R /System/Library/Printers/PPDs/Contents/Resources /System/Library/PrintersPPDsDisabled
sudo /bin/rm -R /System/Library/Printers/PPDs/Contents/Resources/*.*

Setup a symlink for convenience, I personally use this app frequently to verify workstations are bound to AD.
# Link to Directory Utility.
sudo /bin/ln -s "/System/Library/CoreServices/Directory Utility.app" "/Applications/Utilities/Directory Utility.app"

Setup a symlink for end user convenience.
# Link to Printer Utility.
sudo /bin/ln -s "/System/Library/PreferencePanes/PrintAndScan.prefPane" "/Applications/Utilities/Printer Setup Utility.app"
Now its time to reboot the TARGET machine into TARGET DISK MODE and capture a dmg so we have a snapshot up to this stage.

Stay tuned...

Popular posts from this blog

Mac OS X "SOE" Day 7

Page Redirection> continued from day 6...

In summary, here is my method for creating a Mac OS X 10.7.3 Standard Operating Environment "SOE" Image.


Overview The goal is to create a "MASTER" non-booted SOE that can be used with multiple models and it multiple sites with different local requirements.

My intention is to use this "MASTER" image in a manual restore procedure due to the fact netboot facilities cannot be made available to all the sites I support however the DMG files are netboot compatible.

RequirementsLion Recovery Disk Assistant v1.0"TARGET" workstation. A compatible workstation that will be used to install Mac OS X 10.7.3 and capture a DMG image(s)."ADMIN" workstation. A workstation with Disk Utility that you will use to capture your DMG image(s).External storage such as a USB HARD DISK. SetupDownloaded the Lion Recovery Disk Assistant v1.0 and followed the instructions to setup an external Recovery D…

Mac OS X "SOE" Day 6

Page Redirection> continued from day 5...

Continuing on from the "firstboot" phase setup we need to script our "localiser" options.

I previously set my build phase to autologin and run the firstboot script, the localiser phase essentially sits there and waits for you to run it.

In my case I have an applescript GUI wrapper that requests some info to use in the localisation. I request a TAG number which is an organisational internal number and I also request a user name that will be set as the OWNER.

NOTE : I ordered these specifically...not just because it makes sense logically but also technically. For example, setting the Language actually zaps a plist file (.GlobalPreferences) which you need to write to for Locale and Country info.

This stuff is going to be totally dependant on your environment, as an example here is what I do.

So what's the minimum we need in the "localiser" phase? Depends on how many sites you support, I support over 50 si…

Portable TextWrangler (kinda)

Terminal is great, but sometimes I'm too lazy to use vi and editing lots of shell scripts is waaaayyyyy more efficient with TextWrangler. I use this small dropbox hack so I can sync my stationery and settings across multiple macs. #!/bin/bash #+ Portable TextWrangler #* Formatted date & time string. FORMATTED_DATE=`/bin/date "+%Y-%m-%d%H%M%S"` #+ Remove it from /Applications (optional, just so you can replace it with a ln to your dropbox) sudo /bin/mv -f /Applications/TextWrangler.app ~/.Trash/ #* Add a link in /Applications to your DropBox copy sudo /bin/ln -Fs ~/DropBox/TextWrangler.app /Applications/TextWrangler.app #* Archive existing folder /bin/mv -f ~/Library/Application\ Support/TextWrangler{,.$FORMATTED_DATE} #+ Create cloud app support folder /bin/mkdir -p ~/DropBox/TextWrangler #+ Link cloud app support folder to your local workstation (this contains your stationery etc etc) sudo /bin/ln -Fs ~/DropBox/TextWrangler ~/Library/Application\ Support/TextWra…