Persistent variable

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

Persistent variable

Post by maurosturaro »

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:

Post by MichaelNesmith »

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
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
Post Reply