Page 1 of 1

Compiler variable in title suppresses language selector

Posted: Mon Jan 22, 2007 9:22 am
by Christoph Schneegans
Hello!

I have to create several setups with almost identical functionality, but different titles. Therefore, I have added a compiler variable PROGRAM_NAME, so I can set the "Product Name" value on the "Project Properties" page to "#PROGRAM_NAME#", and the output filename to "#PROGRAM_NAME#-setup".

This works very well, but I would now like to a language selection dialog. Unfortunately, this dialog is never displayed. When I change the "Product Name" property to a "regular" value without references to a compiler variable, the dialog is properly displayed.

Is anybody able to reproduce this problem? My guess is that InstallAware is unable to access the #PROGRAM_NAME#.mtx file.

Posted: Mon Jan 22, 2007 11:23 am
by Christoph Schneegans
Okay, I think I have found a workaround for this problem. I simply use some "neutral" name for my project, such as "SetupProject", and I set the TITLE variable according to my PROGRAM_NAME compiler variable at the very beginning of the script:

Code: Select all

[compiler if Variable PROGRAM_NAME Equals Program1]
Set Variable TITLE to Program1
[compiler else]
Set Variable TITLE to Program2
[compiler end]

The "Support Files" folder now contains a file "SetupProject.mtx"; its name is not dependent on the PROGRAM_NAME compiler variable, so it can be used during run-time by all builds.

However, I have already encountered another problem. It seems that dereferenced compiler variables (such as "#PROGRAM_NAME#") are not resolved in localized strings. Is this correct?

Posted: Mon Jan 22, 2007 2:17 pm
by MichaelNesmith
Yes, this is correct. Because compiler variables are substituted at build time, they are not at all in the picture at runtime. So if you have such variables in localized text, they won't work. If you want to use localized variables in localized text, try the Localization Variable command.

Posted: Tue Jan 23, 2007 3:29 am
by Christoph Schneegans
In my opinion, it would be reasonable to substitute compiler variables in localized strings for all languages, and I don't see why this substituion cannot be done at build time.