PDA

View Full Version : Problems with System.GetOSVersionInfo


kmartin7
03-13-2004, 12:28 PM
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

kmartin7
03-13-2004, 01:20 PM
Sorry, I meant to say that it always returns false. It does NOT run file.open.

Sorry about the confusion.

kurt

TJ_Tigger
03-13-2004, 03:19 PM
The System.GetOSVersionInfo returns a table. In your if statement you will want to check for the appropriate value within the table. Try this:


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

kmartin7
03-13-2004, 08:55 PM
That did it. Thanks TJ_Tigger!

Kurt