Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2002
    Posts
    57

    Problems with System.GetOSVersionInfo

    I am having problems with the following code:

    OS_info = System.GetOSVersionInfo();

    if (Os_info ~= "2") then
    result = Dialog.Message("NT-Based Operating System Not Detected", "This software requires an NT-based operating system \r\n such as Windows 2000 or Win XP Pro. Please verify\r\n your O/S.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    else
    File.Open("AutoPlay\\Docs\\eclipseDEMO.msi", "", SW_SHOWNORMAL);
    end

    When run, it always runs file.open, regardless of O/S. Any ideas?

    TIA,

    Kurt

  2. #2
    Join Date
    Jun 2002
    Posts
    57
    Sorry, I meant to say that it always returns false. It does NOT run file.open.

    Sorry about the confusion.

    kurt

  3. #3
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    The System.GetOSVersionInfo returns a table. In your if statement you will want to check for the appropriate value within the table. Try this:

    Code:
    OS_info = System.GetOSVersionInfo(); 
    
    if (OS_info.PlatformId ~= "2") then 
         Dialog.Message("NT-Based Operating System Not Detected", "This software requires an NT-based operating system \r\n such as Windows 2000 or Win XP Pro. Please verify\r\n your O/S.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1); 
    else 
         File.Open("AutoPlay\\Docs\\eclipseDEMO.msi", "", SW_SHOWNORMAL); 
    end
    HTH
    Tigg
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  4. #4
    Join Date
    Jun 2002
    Posts
    57
    That did it. Thanks TJ_Tigger!

    Kurt

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts