Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Location
    Toronto, ON CANADA
    Posts
    696

    Variables in message dialogs now broken?

    Hmm... I could have swore that when I was using the trial version of SF7 (7.0.1.0) before purchasing it last week and getting the latest version (7.0.2.0) that I was able to use variables in dialog messages. I had it working and now it's displaying the variable name rather than its contents.

    I use a variable called %ProductNameShort% to display the name of the software being installed in a short form (sort of like saying Windows XP instead of Microsoft Windows XP) in my session variables, but it doesn't seem to use it in dialog messages. This variable is working correctly in other areas of the installer where it is not displayed in a dialog message. The other variable in this code that I use is %OMTEXE% which is just the name of the main executable set in the session variables as well. I handle dozens of software products and the more that I can use session variables, the easier it is for me to copy one SF7 project to another and make as little changes as possible.

    Here is my code that I use in my 'On Startup' actions:

    Code:
    -- Check for the existence of a pre v2.1.0 installation and abort if true
    EXEExist = File.DoesExist("%AppFolder%\\%OMTEXE%");
    EXEVersionInfo = File.GetVersionInfo("%AppFolder%\\%OMTEXE%");
    EXEVersion = EXEVersionInfo.FileVersion;
    if (EXEExist) and (EXEVersion < "2.1.0.24") then
    	result = Dialog.Message("Older Version Detected", "Setup has detected that you currently have an older version of ".."%ProductNameShort%".." installed prior to version 2.1.0.\nYou must first uninstall any existing ".."%ProductNameShort%".." software before installing this version.\n\nYou can uninstall previous versions from the Control Panel under Add/Remove Programs.\n\nSetup will now close.", MB_OK, MB_ICONSTOP, MB_DEFBUTTON1);
    	Application.Exit(0);
    end
    Am I missing something? Did something change?

    Confused,

    Tek

  2. #2
    Join Date
    Oct 2001
    Location
    Norway
    Posts
    939
    My wife says, "Milk is for calfs". I should say, "Session varaiables are for screens. The strong action engine needs ordinary variables."

    To use a session variable in an action, you have to expand it.
    EXEExist = File.DoesExist(SessionVar.Expand("%AppFolder%\\%OM TEXE%"));

    My personal habit:
    If I use a session variable several times in the code, I expand it once and store the value in an ordinary variable:

    sProductNameShort = SessionVar.Expand("%ProductNameShort%");

    Then I can reuse the variable without the expanding:

    Code:
    Dialog.Message("Older Version Detected", "Setup has detected that you currently have an older version of "..
    	sProductNameShort.." installed prior to version 2.1.0.\nYou must first uninstall any existing "..
    	sProductNameShort.." software before installing this version.\r\n"..
    	"\r\nYou can uninstall previous versions from the Control Panel under Add/Remove Programs.\r\n"..
    	"\r\nSetup will now close.", MB_OK, MB_ICONSTOP, MB_DEFBUTTON1);
    This demonstrates another habit of mine; I split long code lines with the string concatenation operator. I hate the long command lines!

    Well, I still have my membership in "The Confused Designers Foundation". From time to time, I visit their meetings, but my overall view is:

    To work with the Lua engine in the I.R. products is like a voyage of discovery. You regularly strike a treasury.

  3. #3
    Join Date
    Mar 2004
    Location
    Toronto, ON CANADA
    Posts
    696
    Well thank you!

    I don't know what I did but I understand SF7 a little bit more now.

    "SessionVar.Expand" always confused me somehow.

    I've cleaned things up now.

    Thanks for the tips.

Similar Threads

  1. Built-In variables no longer in SF7?
    By Tek in forum Setup Factory 7.0
    Replies: 10
    Last Post: 02-16-2005, 12:34 PM
  2. Changing message text
    By thormel in forum Setup Factory 6.0
    Replies: 2
    Last Post: 08-04-2003, 05:09 AM
  3. INFO: Setting Environment Variables
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 10-10-2002, 12:07 PM
  4. INFO: Tips for Debugging Action Lists in AutoPlay Media Studio 4.0
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-03-2002, 08:38 AM
  5. Packages and If Statements
    By Medlir in forum Setup Factory 6.0
    Replies: 4
    Last Post: 05-09-2002, 03:51 PM

Posting Permissions

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