PDA

View Full Version : help!


Lucian Cain
07-24-2006, 03:25 PM
i am a first time user. i have version 5.05 and am trying to get a script to run "on click". i continue to get a syntax error (it refers to the text in bold):

Syntax Error: [Location="Install:System Test", Event "On Click", Line=10]
Error Detail: [`then' expected near `='] in [if result1 = true, then ]

any help would be appreciated... and this is the script that i have created....

result1 = System.GetOSName("Windows XP", "Windows Server 2003', "Windows 2000", "Windows NT 4", "Windows NT 3", "Windows ME", "Windows 98SE", true);
result1 = System.GetOSName("Windows '98", "Windows '95", false);
result2 = System.GetOSVersionInfo("MajorVersion", "MinorVersion", "BuildNumber", "PlatformId", "CSDVersion");
result3 = System.GetMemoryInfo("AvailableRAM");

Dialog.Message("System Information", "Result1 \nResult2 \nResult3",
MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);

if result1 = true, then end
elseif result1 = false, then

Dialog.Message("Notice", "Your system is running a version of Windows that is incompatible
with the AccuShade software. The software can not be installed. Please upgrade your operating
system to Windows '98SE, Windows ME, Windows 2000, or Windows XP.",
MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
Application.Exit(0);
end if

if Result3 < "96" then
Dialog.Message("Notice", "Your System does not have enough RAM Memory to handle the installation or
the running of the AccuShade Color Retrieval System. Please upgrade your system's RAM to at least
128 MB (128,000 KB)."
MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
Application.Exit(0);
end if
end

Intrigued
07-24-2006, 03:54 PM
When comparing you need to use "==" (two equals) not just one.

longedge
07-24-2006, 05:43 PM
In addition to Intrigueds' reply - just some thoughts, the line :-

result1 = System.GetOSName("Windows XP", "Windows Server 2003', "Windows 2000", "Windows NT 4", "Windows NT 3", "Windows ME", "Windows 98SE", true);

throws an error before the one you mention but replacing the ' after Server 2003 with a " avoids the error. However the statement returns a string e.g. "Windows XP" on my system and not a boolean value so are you setting the value of result1 in some other code that you haven't included?

Also you are setting the variable result1 and then in your dialogue using Result1. These are two different variables because of the uppercase r.

Lucian Cain
07-25-2006, 08:07 AM
First of all, thank you both for the quick replies.

Second, thanks for pointing out the typos that the syntax checker wasn't catching ( the ' after Windows 2003 and the caps on result1 ) as i stated, i am a noob at the programing/scripting thing.

What i am trying to do is check the user's OS, Version # and the amount of RAM on the system. i am try to verify that the software meets within certain specs. (Windows 98SE, ME, 2000, XP or 2003 and a minimum of 128MB RAM) After checking against the results, the software will terminate the autorun, giving a dialog stating that the system does not meet specs, (Windows 98, 95 and/or less than 96MB RAM (to allow for 32mb shared video))

*looks back at last run-on sentence* ok, so grammar wasn't my specialty either:rolleyes

longedge
07-25-2006, 11:05 AM
Something along these lines should get you going -

resultOS = System.GetOSName();
resultMEM = System.GetMemoryInfo();
if resultOS=="Windows 95" or resultOS=="Windows 98" or resultMEM.TotalRAM<96 then
result = Dialog.Message("No way!", "Time to go and buy a new Computer.\r\nThis one is no good.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
end

I'm not sure about distinguishing between Win 98 and Win 98SE.

You need to bear in mind what is being returned - System.GetOSName() returns a string but System.GetMemoryInfo returns a table. Note the ".TotalRAM" which 'gets' that piece of info out of the table for you.

longedge
07-25-2006, 04:21 PM
A little example for you -