To simplify the process of using the DeployStudio app, and associated NetBoot image a small AppleScript app was created. When run it asks the user whether they would like to NetBoot, or to run the Client and then does so (cancel is also an option). The script is rather simple, and is reproduced below.

 

The .app bundle is slightly modified:

  • A copy of the DeployStudio runtime is included in the Resources folder. If a new version is needed this can be found at /Applications/Utilities/DeployStudio\ Admin.app/Contents/Resources/Runtime.app. While the app is vanilla, you it needs to be further modified because it includes the DeployStudio frameworks via a relative link. So you need to replace this link (Runtime.app/Contents/Frameworks) with a copy of the Frameworks from /Applications/Utilities/DeployStudio\ Admin.app/Contents/Frameworks.
  • A copy of the /Library/Preferences/com.deploystudio.server.plist file. This includes the server and login credentials needed to automate the client. Note: this file is put into that same place on clients running this app replacing anything they may have there. Currently there is no way of calling the client with this information otherwise.
  • The applet.icns file has been replaced by the .icns file from the DeployStudio Runtime.app.

There are currently some limitations to this script that should be solved:

  • It will only NetBoot Intel computers running 10.5.4 or newer.
  • If you NetBoot the information is put in as the default boot parameter, rather than a boot-once setting that would probably be better. This is not an issue if you actually image the computer, as it will be set to boot into that image, but is an issue if you quit (restart) from the NetBoot DS client and expect to go back to your unchanged system.

 

The script:

-- RunDeployStudio script

-- Written by Karl Kuehn on Jan 28, 2010

-- Requirements: The DeployStudio Runtime.app and a filled out com.deploystudio.server.plist file. The runtime should have the Frameworks link replaced by the actual frameworks.

set serverName to "lm.apple.com"

 

set answer to display alert "If you want to partition this computer or install to the currenly running volume please select netboot. Otherwise you can run the DeployStudio client directly." buttons {"NetBoot Computer", "Run Client", "Cancel"}

 

if button returned of answer is "NetBoot Computer" then

 

-- get the platform we are runing on

set platform to do shell script "/usr/bin/arch"

 

set serverIP to the last word of (do shell script "host -4 " & serverName)

 

if platform contains "ppc" then

display dialog "PPC netbooting is not yet implimented"

else

set netbootBundleName to "DeployStudioRuntime-Intel.nbi"

 

do shell script "bless --netboot --nextonly --server bsdp://" & serverIP with administrator privileges

 

--do shell script "sudo bless --netboot --nextonly --booter tftp://" & serverIP & "/NetBoot/NetBootSP0/" & netbootBundleName & "/i386/booter --kernel tftp://" & serverIP & "/NetBoot/NetBootSP0/" & netbootBundleName & "/i386/mach.macosx --options \"rp=nfs:" & serverIP & ":/private/tftpboot/NetBoot/NetBootSP0:" & netbootBundleName & "/DeployStudioRuntime.sparceimage\" " with administrator privileges

ignoring application responses

tell application "Finder" to restart

end ignoring

end if

 

else if button returned of answer is "Run Client" then

 

set prefPath to (POSIX path of (path to me)) & "Contents/Resources/com.deploystudio.server.plist"

set runtimePath to (POSIX path of (path to me)) & "Contents/Resources/Runtime.app/Contents/MacOS/Runtime"

 

do shell script "/bin/cp '" & prefPath & "' /Library/Preferences/com.deploystudio.server.plist" with administrator privileges

do shell script (quoted form of runtimePath) with administrator privileges

 

end if

 

 

----------------------This is what was posted before

The script:

-- RunDeployStudio script
-- Written by Karl Kuehn on Jan 28, 2010
-- Requirements: The DeployStudio Runtime.app and a filled out com.deploystudio.server.plist file. The runtime should have the Frameworks link replaced by the actual frameworks.

set serverName to "lm.apple.com"

set answer to display alert "Would you like to run the DeployStudio client or NetBoot this computer. If you want to partition this computer, or install to the currenly running volume you will need to netboot." buttons {"NetBoot", "DeployStudio Client", "Cancel"}

if button returned of answer is "NetBoot" then
 
 -- get the platform we are runing on
 set platform to do shell script "/usr/bin/arch"
 
 set serverIP to the last word of (do shell script "host -4 " & serverName)
 
 if platform contains "ppc" then
display dialog "PPC netbooting is not yet implimented"
 else
set netbootBundleName to "DeployStudioRuntime-Intel.nbi"

do shell script "bless --netboot --nextonly --server bsdp://" & serverIP with administrator privileges

--do shell script "sudo bless --netboot --nextonly --booter tftp://" & serverIP & "/NetBoot/NetBootSP0/" & netbootBundleName & "/i386/booter --kernel tftp://" & serverIP & "/NetBoot/NetBootSP0/" & netbootBundleName & "/i386/mach.macosx --options \"rp=nfs:" & serverIP & ":/private/tftpboot/NetBoot/NetBootSP0:" & netbootBundleName & "/DeployStudioRuntime.sparceimage\" " with administrator privileges
ignoring application responses
 tell application "Finder" to restart
end ignoring
 end if
 
else if button returned of answer is "DeployStudio" then
 
 set prefPath to (POSIX path of (path to me)) & "Contents/Resources/com.deploystudio.server.plist"
 set runtimePath to (POSIX path of (path to me)) & "Contents/Resources/Runtime.app/Contents/MacOS/Runtime"
 
 do shell script "/bin/cp '" & prefPath & "' /Library/Preferences/com.deploystudio.server.plist" with administrator privileges
 do shell script (quoted form of runtimePath) with administrator privileges
 
end if