Skip to content
⌘ NSIS Forum Archive

ReadInstr is not working

10 posts

kulakshay#edited

ReadInstr 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#
ReadINIStr $R0 "$PLUGINSDIR\test1.ini" "Field 2" "State"
IfErrors 0 next
MessageBox MB_OK "Error"
Abort
next:
kulakshay#
hi, thanks for that reply...
but still it is giving error...ie gng to error part of if...

plz help me
kulakshay#
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#
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.
Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.
kulakshay#
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#
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.
Red Wine#
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.