Is there anyway to include file by mention it with variable? I mean
StrCpy $1 "bla.nsh"
!include $1
?
or maybe getting value of variable that called by another variable such as:
StrCpy $1 "EN"
StrCpy $2 ${LANG_${1}_WELCOME_MESSAGE}
?
Thanks.
If you want to set an environment variable only for the installer process and its sub-processes use: System::Call 'Kernel32::SetEnvironmentVariable(t, t)i ("name", "value").
To compile you can right-click your . nsi file and select Compile NSIS Script. This will cause MakeNSISW, the NSIS Compiler Interface, to launch and call MakeNSIS to compile your script.
Nullsoft Scriptable Install System (NSIS) is a script-driven installer authoring tool for Microsoft Windows backed by Nullsoft, the creators of Winamp. NSIS is released under a combination of free software licenses, primarily the zlib license.
Variables can only be used at runtime (running on the end-users machine), you need to use defines:
!define foo "bar"
!include "${foo}.nsh"
Edit:
You should be using the LangString
instruction if you want to add custom translated strings, you can access a langstring at runtime with $(mystringid)
.
Actually, Anders right. Think about that, when the compiler compiling your code, it need to know which files it need to include with your EXE file.
About the variable, you can use only with defines. again, because when you are compiling, the compiler will compile all the needed (in use) variables / defines, and you can't tell him use one that never been declared.. its little different from server side languages because here you are compiling and pack your code into EXE file which is assembled in your computer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With