• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Installer script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Installer script


  • Subject: Installer script
  • From: Phil Dobbin <email@hidden>
  • Date: Sun, 01 Sep 2002 02:46:36 +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.

  • Prev by Date: Re: getting MACaddress
  • Next by Date: ScriptMenu oddity
  • Previous by thread: Re: Installer script
  • Next by thread: Re: Script-dictionary
  • Index(es):
    • Date
    • Thread