Hi!
I am experiencing some strange problems with localization variables that contain variable references again. For example, my translations.German contains the line
Die Installation ist fehlgeschlagen: $LASTERROR$.
that is linked to a localization variable named "FinishMainText5", which is displayed in a dialog if necessary. However, in case of an error, only the text
Die Installation ist fehlgeschlagen: .
is displayed in the dialog although $LASTERROR$ is not empty as a MessageBox call confirms.
I have now changed the line in the translations.German file to
Die Installation ist fehlgeschlagen: $LastErrorLocalized$.
and call
Set Variable LastErrorLocalized to $LASTERROR$
right before the dialog is displayed. This works!
So my assumption is that there's a difference between pre-defined variables and user-defined variables. It seems that pre-defined variables in localization variables are resolved e.g. when the setup starts, while user-defined variables are not resolved until the localization variable is evaluated. Is this correct?
Variable substituion in localization variables
-
- Posts: 55
- Joined: Tue Jan 09, 2007 12:20 pm
-
- Posts: 3452
- Joined: Thu Dec 22, 2005 7:17 pm
- Contact:
No, that kind of a distinction doesn't exist.
What is the timing of your calls like? Once Set Variable (or Set Localization Variable) is called, any existing variable references inside that call are resolved immediately. They are not kept unsubstituted for resolution at a later time.
So since $LASTERROR$='' (empty string) at start of setup, and since that's probably around when you are calling Set Variable, this is what ends up happening.
What is the timing of your calls like? Once Set Variable (or Set Localization Variable) is called, any existing variable references inside that call are resolved immediately. They are not kept unsubstituted for resolution at a later time.
So since $LASTERROR$='' (empty string) at start of setup, and since that's probably around when you are calling Set Variable, this is what ends up happening.
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
-
- Posts: 55
- Joined: Tue Jan 09, 2007 12:20 pm
translations.German and project.mtx define these localization variables: And this is the script: So the reason why LocVarDynamic is evaluted every time is that the LastErrorDynamic is declared after LocVarDynamic?
Code: Select all
LocVarStatic=Die Installation ist fehlgeschlagen: $LASTERROR$
LocVarDynamic=Die Installation ist fehlgeschlagen: $LastErrorDynamic$
Code: Select all
Set Localization Variable LocVarStatic to
Set Localization Variable LocVarDynamic to
Set Variable LASTERROR to foobar
Set Variable LastErrorDynamic to $LASTERROR$
MessageBox: , $LocVarStatic$ // Displays "Die Installation ist fehlgeschlagen:"
MessageBox: , $LocVarDynamic$ // Displays "Die Installation ist fehlgeschlagen: foobar"
Set Variable LASTERROR to foobar2
Set Variable LastErrorDynamic to $LASTERROR$
MessageBox: , $LocVarStatic$ // Displays "Die Installation ist fehlgeschlagen:"
MessageBox: , $LocVarDynamic$ // Displays "Die Installation ist fehlgeschlagen: foobar2"
Terminate Installation
-
- Posts: 3452
- Joined: Thu Dec 22, 2005 7:17 pm
- Contact:
Exactly. If VARIABLE hasn't been defined as a variable, then $VARIABLE$ is interpreted just as a string literal.
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
Who is online
Users browsing this forum: No registered users and 82 guests