Page 1 of 1

Problem with (unwanted) localized Set Variable statements

Posted: Wed Jan 11, 2006 8:05 am
by Olaf Kober
Hi! I have a problem with localized Set Variable statements that assign compiler variables to script variables, like...

Set Variable VERSION to #VERSION#
Set Variable PRODUCTSTATE to #PRODUCTSTATE#

We set these compiler variables (#VERSION# and #PRODUCTSTATE#) from command line when building the setup on our build machine. This enables us to change the product version with each build automatically.

This worked fine until I have started to translate the project. After enabling multi-language support for my project the script variables no longer contains the values provided by command line, instead they contain "#VERSION#" and "#PRODUCTSTATE#". I suggest that's because the Set Variable statements were localized, too.

And here are my questions: Is there a way to tell InstallAware to do not localize these Set Variable statements? Or, What can I do else? Is there another trick to change product version from command line at build time?

Thanks,
A happy InstallShield-to-InstallAware-Switched User :wink:

Posted: Wed Jan 11, 2006 1:02 pm
by MichaelNesmith
Hi Olaf!

I believe there should be several ways to solve this problem.

One approach would be to leave those strings out of the translation process. You can simply add those commands to your setup script after having run the localization wizard, or since you have already pre-localized, I'd suggest cutting those lines out, then pasting them back in (this should reinitialize their IDs); if that doesn't work, just delete those lines and re-create them. Either way you should have broken the association of the localized strings with those commands, so they will remain unlocalized.

Another approach, somewhat less convenient, would be to not show the pre-built InstallAware dialog for language selection, but to build and show your own dialog. This will delay the activation of the language translations until you manually update the LANGUAGE variable and again let your Set Variable commands run as intended. See Samples->Multi-Lingual Setups for more information and a script that already shows how to do this for you.

The core issue here is that compiler variables are substituted at compile time (not run time), and therefore after the localization system overwrites the new "localized" values for your compiler variables, they are not re-substituted while the script is running. But I hope one of the above two approaches will sort this out for you.

another solution

Posted: Tue Dec 12, 2006 2:03 pm
by pmessina
We ran info a similar problem and solved it by creating an ini file during the build process with a specific name and used name value pairs inside which then correspond to the variables that get set.
i.e.

[params]
BUILDTIME=
BUILDDATE=
BUILDNUM=

etc.

That file is included in the project as a support file packaged up as part of the installer which is built. The installer opens it referencing the $SUPPORTDIR$ value as to its location.

Make sure that the code that gets the values from the ini file and sets the variables is at the beginning of the install prior to the dialogs displaying.