Page 1 of 1

Preserve feature states on upgrades

Posted: Tue Jun 01, 2010 8:48 am
by Bjarne
I have a pretty complex installer with many selectable features.
When an application is being uppgraded the "Prevoius version uninstallation" is invoked which of course uninstall the current package.
Is there now a way of preserving the state(s) of the uninstalling/uninstalled package so it can be used as default for the upgrade?
The point would be to avoid unwanted components to be installed and also not to miss a previously selected component by mistake.

Re: Preserve feature states on upgrades

Posted: Tue Jun 01, 2010 7:39 pm
by MichaelNesmith
Pre-Defined Compiler Variables

LOADOLDDATA: If set to TRUE, the setup engine will load feature definitions and other saved data (see the Load Feature Selections command for more details) from an older version of setup. Normally this data is loaded only in between the same versions of setup, when working on the same installed application version for a maintenance or uninstall operation. With any other value for this compiler variable, this normal behavior is preserved.

Re: Preserve feature states on upgrades

Posted: Tue Jun 01, 2010 9:52 pm
by Bjarne
Brilliant! I 'll give this a try right away! :D

Re: Preserve feature states on upgrades

Posted: Thu Jun 03, 2010 2:48 am
by Bjarne
Nope, can't get this to work at all.
I've declared a persistent variable but this is never seen as declared.
The test always returns FALSE (see attached image).

My scenario:
I compile my installer and run it.
The installer show a dialog with this var's current value (FALSE as default).
I change the state to TRUE through a radio button and also check the state with a message box just to be 100%.

I then recompile the installer in order to get a new revision and run it again.
I get the "Previous version uninstallation.."- message" indicating a new version of the same product.
I continue the installation expecting my variable to be persistant and set to TRUE, just as I left it.
But installer still show FALSE and the "If defined"-test evaluates to false which indicates that the variable doesn't persist?

Any clues? :?:

Re: Preserve feature states on upgrades

Posted: Thu Jun 03, 2010 4:04 am
by MichaelNesmith
It's a compiler variable, not a script variable :)

Re: Preserve feature states on upgrades

Posted: Thu Jun 03, 2010 6:19 am
by Bjarne
Ok....
Two follow ups then...
1 - Is this compiler variable required for persistent variables?
2 - How the heck do I go about setting a comp var? 8)

Re: Preserve feature states on upgrades

Posted: Thu Jun 03, 2010 10:14 pm
by MichaelNesmith
1. No.
2. Project Options dialog.

Re: Preserve feature states on upgrades

Posted: Thu Jun 03, 2010 11:54 pm
by Bjarne
Thanx, found it and I've set it to True.

Well, it seems this done the trick..
Looks like the persistent variable needed LOADOLDDATA anyway...

When is "data" considered old?
Is it when Revision Code is changed (by recompilation) or when the Product Version changes or both?

Re: Preserve feature states on upgrades

Posted: Fri Jun 04, 2010 2:01 am
by MichaelNesmith
Persistent variables are not automatically reloaded when running a different version (as identified by an updated revision code). They persist only in a single version of your installation. The compiler variable helps you reload them in different versions too, of course.