Persistent variable

Got a problem you cannot solve? Try here.
maurosturaro
Posts: 22
Joined: Tue Mar 14, 2006 6:29 am

Persistent variable

Postby maurosturaro » Mon Jun 26, 2006 5:18 am

Sorry I've not undestood how to use persistent variable.

I've seen that the first reference of a variable in the script must be a 'Set Variable' or I get a runtime error of 'Attenpting to get value of undefined variable'.

But doing so I overvrite the persisted value that i can see in the debugger.

What's wrong in my usage ?

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Mon Jun 26, 2006 5:14 pm

You could say:

Code: Select all

if Variable MAINTENANCE Equals FALSE
  Set Persistent Variable MYVARIABLE to VALUE
end


all the way on top of your script. This way the compiler will be happy, and the variable will not be overwritten on future runs of your script.

Note: The typical place for this type of first-time initialization in the setup code is the place marked:

Code: Select all

  Comment: First Time Install


in the setup script. Choose "Comments" on the left combo box and "First Time Install" in the right combo box (both located on top of your script, below the tabs) to quickly locate this place.
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 26 guests