|
|
#1 |
|
Junior Member
Join Date: Aug 2007
Posts: 6
|
Text Box
I have searched the forums for this but have not found something that works. I have a custom page that has a text box in it, Field 4. I want to read from the user's registry and insert a value into this text box. The reading from the registry appears to be working but the writing to the text box appears not to be working. I have tried the following:
ReadRegStr $DatabaseServer HKLM "SOFTWARE\test" "TestServer" !insertmacro MUI_INSTALLOPTIONS_WRITE "DatabaseLogin.ini" "Field 4" "State" $DatabaseServer ---- ReadRegStr $DatabaseServer HKLM "SOFTWARE\test" "TestServer" !insertmacro MUI_INSTALLOPTIONS_WRITE "DatabaseLogin.ini" "Field 4" "Text" $DatabaseServer --- ReadRegStr $DatabaseServer HKLM "SOFTWARE\test" "TestServer" !insertmacro MUI_INSTALLOPTIONS_WRITE "DatabaseLogin.ini" "Field 4" "State" $DatabaseServer ---- WriteINIStr '$PLUGINSDIR\DatabaseLogin.ini' "Field 4" "State" $DatabaseServer I think it may have to do with where I'm placing it I do not know for sure. I've tried before and after this section of code: !insertmacro MUI_INSTALLOPTIONS_EXTRACT "DatabaseLogin.ini" !insertmacro MUI_INSTALLOPTIONS_DISPLAY "DatabaseLogin.ini" in my Form show area. Please let me know if you need more information or if you can help. Thank you! |
|
|
|
|
|
#2 |
|
Forum King
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
|
are you writing this to the ini-file before displaying the page?
|
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Aug 2007
Posts: 6
|
I don't know 100% what you mean. I have done it before and after I call the function for the page and before and after this line and it has made no difference. Can you maybe clarify more?
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "DatabaseLogin.ini" |
|
|
|
|
|
#4 |
|
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
Just 3 steps:
1st extract the INI 2nd modify it 3rd display it Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Aug 2007
Posts: 6
|
Right after the extract I tried setting the value and it still did not work. I have no clue what I'm doing wrong. When I go to the page that should have the value change it still says the default value. Here is what I tried:
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "DatabaseLogin.ini" !insertmacro MUI_INSTALLOPTIONS_WRITE "DatabaseLogin.ini" "Field 4" "State" "Hello" WriteINIStr '$PLUGINSDIR\DatabaseLogin.ini' "Field 4" "State" "test" WriteINIStr '$PLUGINSDIR\DatabaseLogin.ini' "Field 4" "Text" "test2" None of the values were in the text box as I would have expected. Just 127.0.0.1 was in the text box which is the default value that I set when creating the text box on the page. Thank you! Sorry I'm having such a hard time with this. |
|
|
|
|
|
#6 |
|
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
code: Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Aug 2007
Posts: 6
|
In order for this to work, do I have to create the INI file in the fly like you did? I think my issue is that I have created the ini file in a separate file already with a GUI editor in Eclipse, and I'm calling and using that.
|
|
|
|
|
|
#8 |
|
Junior Member
Join Date: Aug 2007
Posts: 6
|
Here is what I have maybe this will help.
My DatabaseLogin.ini file code: Installer Code - I kind of chopped it up a little so some basic stuff may be missing. code: |
|
|
|
|
|
#9 |
|
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
Of course there's no need to create the INI on the fly, I did so just for convenience.
Taking a look at your code, remove the line !insertmacro MUI_INSTALLOPTIONS_EXTRACT "DatabaseLogin.ini" and add it into function .onInit. Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS |
|
|
|
|
|
#10 |
|
Junior Member
Join Date: Aug 2007
Posts: 6
|
Awesome! that was it. Thank you and sorry I was difficult
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|