Archive: ifdef and langstrings


ifdef and langstrings
Hi All,

Is there a way to tell if a string has been defined for a language? I'm trying to to something like:


test.nsh:

!ifndef $(error_message)
LangString error_message ${LANG_ENGLISH} "My generic error message"
!endif

function test
MessageBox MB_OK ${error_message
functionend

main.nsi
!include test.nsh
LangString error_message ${LANG_ENGLISH} "Override message"
...
call test

but anything I've come up with so far only results in either a warning message in the compiler of:
LangString "..." set multiple times for 1033, wasting space (...)

when I test it out, it seems to work as long as I put the message I want before the include (since it ignores the second one)... but I would rather not see the warning. I've looked through the source for NSIS and through the examples, and plugins, etc... but haven't really found anything like this...

Thanks!

Owen Borstad

(long time lurker and quite adept, but currently stumped on this)

I'm pretty sure that isn't possible. You just need to !define a constant of the same name when using LangString.

-Stu