Skip to content
⌘ NSIS Forum Archive

Add variable (ex. program version) to use in all language

2 posts

bovirus#

Add variable (ex. program version) to use in all language

@Anders

Hello.

I'm an installer script for a program
I want toa dd a variable that I change every time I will release a new program version to change the relative strings in the installer (ex Window caption), etc

Langstring examples are

LangString LSTR_0 1033 " "
LangString LSTR_1 1033 "$(LSTR_2) Setup"
LangString LSTR_2 1033 "Test application (x64) Professional"

Of course I can create a string with version for each language like

LangString LSTR_0 1033 " "
LangString LSTR_1 1033 "$(LSTR_2) Setup"
LangString LSTR_2 1033 "Test application (x64) Professional v. $(LSTR_3)"
LangString LSTR_3 1033 "2.06"

but I would do one times and sue it for all languages instead one line for each language,

How can do that?
For the same reason I think to create also variables for

"x64" (or "x86")
"Professional" (or "Free")

that are ripetitive things.

Thanks.
JasonFriday13#
For strings that remain the same across languages, you can use a define instead.

Oh, and this won't work because it's out of order (LSTR_2 is used before it's initialized):

LangString LSTR_1 1033 "$(LSTR_2) Setup"
LangString LSTR_2 1033 "Test application (x64) Professional"