Page 1 of 1

Persistent Variable not being persistent.

Posted: Tue Jul 14, 2009 12:40 pm
by albel
Hi,

I can not seem to get the 'Remember value when restarting setup' option to work on a variable. I would like to use the last value of it during the uninstall, but displaying its contents in a message box shows it to be empty when uninstalling. It actually had a value during setup because it passes the value to a custom program which successfully writes it to a database.
I've definately got the check box checked because the variable is called a 'Persistent Variable' in the script.

Does another setting need to be adjusted to recall the value?
Any ideas?

Thanks,

ab

Posted: Tue Jul 14, 2009 2:58 pm
by MichaelNesmith
Make sure you are not re-initializing the variable value by executing Set Variable again during a maintenance or uninstall script flow. Check that MAINTENANCE=FALSE before calling Set Variable on it, there's a place in the default script where this check is already performed so you could just inject your persistent declaration code there.

Posted: Tue Jul 14, 2009 5:32 pm
by albel
Hi michael,

The MAINTENANCE conditional got it to work.

Thanks again.

ab