- NSIS Discussion
- ReadInstr is not working
Archive: ReadInstr is not working
kulakshay
27th December 2006 04:57 UTC
ReadINIStr is not working
I am trying to take input from user , have written code something like this...
It is not working properly it's generating an error... plz help me
Function UserSerialNumberDialog
!insertmacro MUI_HEADER_TEXT "$(NAMEPAGEHERE_TITLE)" "$(NAMEPAGEHERE_SUBTITLE)"
# Display the page.
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "UserSerialNumberDialog"
ClearErrors
ReadINIStr $R0 "test1.ini" "Field 2" "State"
IfErrors done
goto +3
done:
MessageBox MB_OK "Error"
FunctionEnd
Red Wine
27th December 2006 05:43 UTC
ReadINIStr $R0 "$PLUGINSDIR\test1.ini" "Field 2" "State"
IfErrors 0 next
MessageBox MB_OK "Error"
Abort
next:
kulakshay
27th December 2006 05:51 UTC
hi, thanks for that reply...
but still it is giving error...ie gng to error part of if...
plz help me
Red Wine
27th December 2006 06:02 UTC
I don't get it. Is this your custom page show function, or leave function?
kulakshay
27th December 2006 06:16 UTC
hi,
I am trying to take input from user through a .ini file ..
.ini file is a simple file having a 3 compnents like textbox, list etc.
I want to read those value in $R0 but can't do it..
but it always go to error part of if...
Red Wine
27th December 2006 06:33 UTC
Download the test.nsi
from the following thread, compile it and exetute it. This would help you to understand how to get input from user.
http://forums.winamp.com/showthread....hreadid=262263
kulakshay
27th December 2006 08:29 UTC
hi,
thanks for that file ..
it is realy a useful...
but still my code is not working..
neither readINIStr nor writeINIStr is working
where is the possibility of mistake..?
Red Wine
27th December 2006 08:36 UTC
Compare the 2 files regarding on the show-leave functions to see where is the fault. You can't add code that captures user input at show function, you have to add it at leave function.
kulakshay
27th December 2006 08:46 UTC
what is show and leave function are they any particular
Red Wine
27th December 2006 09:14 UTC
show means show the custom page, leave means when user presses next button to go to the next page or presses a button that has NOTIFY flags, so before step to the next page you're able to capture the input.
They are all explained there plainly. Also check the included IstallOptions examples.