Installer script
Installer script
- Subject: Installer script
- From: phildobbin <email@hidden>
- Date: Sun, 01 Sep 2002 03:11:37 +0100
I'm trying to create an installer script to be run from a CD where an applet
checks for which system is the start-up disk. Below is an example I've
managed to get to work to check OS X volumes (apres 10.2) but I'm stuck for
a OS 8.6 -> 9.2.x version of the same.
property isOSX : false
property isOSX1plus : false
on gestaltVersion_info(gestalt_code, string_length)
try
tell application "Finder" to ,
copy my NumToHex((system attribute gestalt_code), ,
string_length) to {a, b, c, d}
set the numeric_version to {a, b, c, d} as string
if a is "0" then set a to ""
set the version_string to (a & b & "." & c & "." & d) as string
return {numeric_version, version_string}
on error
return {"", "unknown"}
end try
end gestaltVersion_info
on NumToHex(hexData, stringLength)
set hexString to {}
repeat with i from stringLength to 1 by -1
set hexString to ((hexData mod 16) as string) & hexString
set hexData to hexData div 16
end repeat
return (hexString as string)
end NumToHex
tell application "Finder"
set curVer to first item of (my gestaltVersion_info("sysv", 4)) as
number
if curVer > 1000 then
set isOSX to true
if curVer > 1010 then
set isOSX1plus to true
end if
end if
activate
if not isOSX then
display dialog "In OS < 10"
else if isOSX1plus then
display dialog "in OS X 10.1 or greater"
else
display dialog "in OSX 10.0"
end if
end tell
Any help appreciated.
Regards,
Phil (on digest).
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.