I’m using nsis for developing an installer. As the last step there is a registration process for the user to get his email address and some other data and send it to a server. The code is as follows.
StrCpy $ContactName "$0"
StrCpy $ContactEmail "$1"
StrCpy $Coments "$2"
StrCpy $Updates "$3"
StrCpy $PostStr "userName=$ContactName&userEmail=$ContactEmail&userComments=$Coments&updates=$Updates"
inetc::post "$PostStr" "http://www.mysite.com/registration/registerAcceptor.php" "$INSTDIR\output.txt"
Pop $0
StrCmpS $0 "OK" success failedToSubmit
failedToSubmit:
MessageBox MB_OK|MB_ICONEXCLAMATION "There was an error submitting the registration information"
Return
success:
MessageBox MB_OK|MB_ICONINFORMATION "Your information was successfully received by OrangeHRM"
But for the fist time when the user is trying to register it gives the error message as
"There was an error submitting the registration information"
And when I check the return value of the command using the message as follows
MessageBox MB_OK $0
it shows the following error
URL Parts Error
But when I go back and proceed with the same action it gives the success message and the return value is also as
OK
I’m not sure why this thing acts two separate ways in these two scenarios. Can someone help.
Thanks in advance.
Try adding “/END” to the plugin call as suggested in this forum thread (There might be other things on the stack and the plugin does not know when to stop reading, this would explain why it works the second time around)