Renaming of Features at runtime

Got a problem you cannot solve? Try here.
andrejzr
Posts: 68
Joined: Sun Jun 25, 2006 9:17 am

Renaming of Features at runtime

Postby andrejzr » Wed Jun 28, 2006 8:48 am

Is it possible to change the name of the feature at runtime or at compile time?

I tried using variables, and at first it seemd that it worked. I defined two variables, $GROUP1$ and $GROUP2$. The components/features were defined in the script as:
Define Component: $GROUP1$
Define Component: $GROUP1$\\Program files
Define Component: $GROUP1$\\Samples
Define Component: $GROUP1$\\Help files
Define Component: $GROUP2$
Define Component: $GROUP2$\\Program files
Define Component: $GROUP2$\\Samples
Define Component: $GROUP2$\\Help files

By setting GROUP1 and GROUP2 variables at the beginning of the script, everything seemd to work - the list of components was properly displayed, etc.

But the command

Get Component $GROUP1$ Selection State into Variable SELECTED

did not work. If i changed the $GROUP1$ with the actual variable name, then it returned the correct value and correct files were installed, defined in the code block checking the SELECTED variable.

Is this a bug in "Get Component Selection State" command, or variables can not be used that way?

If variables can not be used, what is alternative to make the Component names configurable? It does not need to be configurable at runtime, but I would like to have one script that handles multiple product installations, that differ only in the product name. The install procedure is identical otherwise.

andrejzr
Posts: 68
Joined: Sun Jun 25, 2006 9:17 am

Postby andrejzr » Wed Jun 28, 2006 8:53 am

Another idea, that might be solution: maybe I should use compiler variables instead of normal variables. Would this be better?

Related to this, is the Project options the only way, where the compiler variables can be defined, and its values set?

Can be compiler variables defined in the script itself?

Can be compiler variables set in the script, or only in project options and command line?

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

Postby MichaelNesmith » Wed Jun 28, 2006 6:44 pm

Hi Andrej,

I'm not sure what the problem with Get Component State was...it does resolve variables before checking the component's state.

However, the correct implementation for you is using compiler variables. Its a lot easier and cleaner that way! Its exactly what compiler variables were designed for, in fact.

The Project Options window is the only place where compiler variables may be defined. Once defined, you may set their values in the IDE, or when building from the command line using the form "VARIABLE=VALUE".
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: Google [Bot] and 229 guests