I am trying to write some code to detect the end users OS. I've looked all over the web for samples to start with and all I've come up with is something like the below code. Which I'm struggling to modify to work for my needs.
Essentially, all I need to do is two things:
1) writeup code that detects OS and launches a specific software installer from a DVD
2) Open an OS specific browser with one button (i.e., Finder or Explorer)
anyone want to take a shot at a simple Mouseover that would detect OS and then include an "if then statement" that launches either windows explorer or Macintosh Finder to the moviepath
If you got me that far I can figure out the rest
Below is the code I found on the web that uses path delimiters to detect OS
global gQTState, gPathDelimiter
gPathDelimiter = determineDelimiter()
gQTState = #unknown
thisMachine = the platform
if thisMachine contains "Windows" then
else if thisMachine contains "Macintosh" then
-- wishing for a world with UNIX playback
on mouseUp me
-- build a path to the installer
pathToInstaller = the moviePath & "QT" & gPathDelimiter
case (gPathDelimiter) of
pathToInstaller = pathToInstaller & "WindowsAPP.exe"
pathToInstaller = pathToInstaller & "MacintoshAPP"
-- open it
I got it
if thisPlatform = "Windows" then
go to frame "PC"
go to frame "MAC"
I can figure out the rest from there.
That should work, though it is a bit roundabout. You can always just do this:
if the platform contains "Windows" then
Also, if you just want to get the delimiter, then it is much easier to simply do this:
gDelimiter=the last char of the moviePath
That will work for both Mac and Windows.