|
|
|
|
#1 |
|
Junior Member
Join Date: May 2007
Posts: 7
|
ini files language strings
Hi,
I am new to NSIS and would like to know how to use laguage strings in ini files using custom pages using the new interface. Thanks in advance, |
|
|
|
|
|
#2 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,338
|
You should write the language string into the INI file using WriteINIStr or the MUI_INSTALLOPTIONS_WRITE macro at runtime.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: May 2007
Posts: 7
|
Thanks,
I tried the WriteINISTr command like this: Function CustomPageA ------------------------ !insertmacro MUI_HEADER_TEXT "$(TEXT_IO_TITLE)" "$(TEXT_IO_SUBTITLE)" !insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioA.ini" WriteINISTR "ioA.ini" "Field 1" "databasemessage1" dbMessage1 FunctionEnd ------------------------ The compiler will give me the following log. ------------------------ Function: "CustomPageA" !insertmacro: MUI_HEADER_TEXT !insertmacro: end of MUI_HEADER_TEXT !insertmacro: MUI_INSTALLOPTIONS_DISPLAY !insertmacro: end of MUI_INSTALLOPTIONS_DISPLAY WriteINIStr: [Field 1] databasemessage1=dbMessage1 in ioA.ini FunctionEnd ------------------------ So he sort of have seemed to understood. My ini file starts as follows: ------------------------- [Settings] NumFields=5 [Field 1] Type=label Text=databasemessage1 Left=0 Right=-1 Top=0 Bottom=9 ------------------------- So I have no errors but nothing is changed as still have the databasemessage1 displayed on my custum page instead of the contents of the language string dbMessage1. I haven't found any doculentation on the MUI_INSTALLOPTIONS_WRITE macro ? |
|
|
|
|
|
#4 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,338
|
MUI_INSTALLOPTIONS_WRITE is documented in the MUI readme and is the macro you should use in this case. If you're using the MUI to extract and display the page, you should use it to modify the page.
If you use WriteINIStr, you must use a full path ($PLUGINSDIR\ioA.ini). NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: May 2007
Posts: 7
|
My custompage function is now as follows:
-------------------------------- Function CustomPageA !insertmacro MUI_HEADER_TEXT "$(TEXT_IO_TITLE)" "$(TEXT_IO_SUBTITLE)" !insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioA.ini" !insertmacro MUI_INSTALLOPTIONS_WRITE "ioA.ini" "Field 1" "databasemessage1" "hi" FunctionEnd -------------------------------- Again no errors but no results either. Is this the right place to put this macro ? |
|
|
|
|
|
#6 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,216
|
There's not much point writing the language string to the page after displaying it.
Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: May 2007
Posts: 7
|
The thing is that I tried to place the installoptions_write in many places but all without succes.
Maybe I should give up. Maarten |
|
|
|
|
|
#8 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,216
|
What is databasemessage1?
It should either be Text or State depending on the control. Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#9 |
|
Junior Member
Join Date: May 2007
Posts: 7
|
Hi
Thanks for the reply. databasemessage1 is what is to be replaced in my ini.file which starts as follows: [Settings] NumFields=5 [Field 1] Type=label Text=databasemessage1 Left=0 Right=-1 Top=0 Bottom=9 |
|
|
|
|
|
#10 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,216
|
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioA.ini" "Field 1" "Text" "hi"
Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#11 |
|
Junior Member
Join Date: May 2007
Posts: 7
|
Thanks very much I got it working now
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|