help!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Lucian Cain
    Indigo Rose Customer
    • Jul 2006
    • 12

    help!

    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
    Indigo Rose Customer
    • Dec 2003
    • 6125

    #2
    When comparing you need to use "==" (two equals) not just one.
    Intrigued

    Comment

    • longedge
      Indigo Rose Customer
      • Aug 2003
      • 2496

      #3
      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.

      Comment

      • Lucian Cain
        Indigo Rose Customer
        • Jul 2006
        • 12

        #4
        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

        Comment

        • longedge
          Indigo Rose Customer
          • Aug 2003
          • 2496

          #5
          Something along these lines should get you going -

          Code:
          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.

          Comment

          • longedge
            Indigo Rose Customer
            • Aug 2003
            • 2496

            #6
            A little example for you -

            Comment

            Working...
            X