3 Replies Latest reply on Mar 3, 2010 12:43 PM by Mike Blaustein

    Detecting OS - How?

    Dignified_Dude Level 1

      Hello -


      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

      on startMovie

        gPathDelimiter = determineDelimiter()
        gQTState = #unknown



      on determineDelimiter

        thisMachine = the platform

        if thisMachine contains "Windows" then
          return "\"
        else if thisMachine contains "Macintosh" then
          return ":"
          -- wishing for a world with UNIX playback
          return "/"
        end if




      global gPathDelimiter

      on mouseUp me

        -- build a path to the installer
        pathToInstaller = the moviePath & "QT" & gPathDelimiter

        case (gPathDelimiter) of
            pathToInstaller = pathToInstaller & "WindowsAPP.exe"
            pathToInstaller = pathToInstaller & "MacintoshAPP"
        end case

        -- open it
        open pathToInstaller

        -- quit