skhatri
9th August 2005 06:21 UTC
2 Problems
Hi All,
I Am Sunil, and I am new to Null Soft installer. Previously I was working in MSI technology in Installshield.
I have 2 problems :
1. I want a to append a new string in English.nlf file
# ^Text1
"SomeTextHere"
Now I tried using this string Text1:
WriteRegStr HKLM ".mov\shell\import" "Desc" "$(Text1)"
But this doesnt work.
As I want to use this $Text string in my script. Is it possible ? Basically I want that all strings, which I am adding in my installer script, should not be hard coded in script, they should be in some file (Like *.nlf file), so that it is easy to localise the application.
2.
Say I declare a variable :
Var Path
StrCpy $Path "C\\Program Files\\AAA\\BBB\\CCC\\DDD\\FFF"
Now I pick files, which are located at the same base path :
File ${Path}\\ppp.exe
File ${Path}\\GGG\\HHH\\uuu.exe
File ${Path}\\III\\JJJ\\KKK\\gggg.exe
But this too doesnt work. $(Path) doesnt get resolved to exact path, it has. Why so ?
Basically here, I dont want to hard code Path. Whenever I want, I should be able to change the path with changing it only at one place.
Please help,
Sunil.
Anders
9th August 2005 07:17 UTC
-1 No need to change the lang files, use LangString
-2 File is a compile time command, use a define (ex: !define Path "C\\Program Files\\AAA\\BBB\\CCC\\DDD\\FFF")
skhatri
9th August 2005 07:29 UTC
Thanks a lot Anders !! I understood the second answer. But I dint get the first one. You wrote that I should use LangString.
For example :
LangString Message ${LANG_ENGLISH} "English message"
LangString Message ${LANG_DUTCH} "Dutch message"
LangString Message ${LANG_FRENCH} "French message"
LangString Message ${LANG_GERMAN} "German message"
Now the problem in this is that, while developing script, I dont know all languagee translations, so I will write some junk text in all locales, other than english.
And when one has to localise the software, he has to look through script and has to find out, which strings should get localised.
What I want that all strings, which are being added and should get localised, should be altogether in a file, and that file, we should be able to get localised. Localisation ppl, has only see that text file. And through script I should be able to pick up those translated strings.
Can you please give me any example ?
Thanks once again,
Sunil.
Yathosho
9th August 2005 08:21 UTC
you could keep the translations in a seperate script (which you can distribute) and !include it to your main script. that's how i do it, have a look at this.
i'm not sure if you can use an external ini-file (readinistr) for your translations, you probably cant define a langstring on runtime.
Mæster
9th August 2005 08:29 UTC
If you want to include localized strings after compilation (during run time) things become more difficult.
But if you just want to have a single "language file" which could be easely localized and compiled in your installer than you could export all language strings in an extra file, lets say "languages.nsh" which looks like:
LangString Message ${LANG_ENGLISH} "English message"
LangString Message ${LANG_DUTCH} "Dutch message"
LangString Message ${LANG_FRENCH} "French message"
LangString Message ${LANG_GERMAN} "German message"
Then you easely include 'languages.nsh' in your installer script:
!include "languages.nsh"
You could give the languages.nsh to the translators and after it came back you include the new language and recompile the script.
skhatri
9th August 2005 15:28 UTC
It worked.
Thanks a lot ,
Sunil.