Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   What is wrong with my code? (http://forums.winamp.com/showthread.php?t=230089)

M4RC II 4th November 2005 12:11

What is wrong with my code?
 
1 Attachment(s)
Hy I've make (with the help of afrow uk) a custom page where the user can write an password. This password must insered in an file.

This is my code:

code:

LangString NoPassword ${LANG_ENGLISH} "No password entered!"

Function PasswordLeave

!insertmacro MUI_INSTALLOPTIONS_READ $R0 "Password.ini" "Field 1" "State"
StrCmp $R0 "" 0 +9
Push "Password" #-- text to be replaced within the " "
Push "$R0" #-- replace with anything within the " "
Push all #-- replace all occurrences
Push all #-- replace all occurrences
Push $INSTDIR\users.ini #-- file to replace in
Call AdvReplaceInFile #-- Call the Function
MessageBox MB_OK|MB_ICONINFORMATION $(NoPassword)
Abort

FunctionEnd



But it doesn't work.

What is wrong?

Please help me.

Here is my *.nsi

kichik 4th November 2005 12:27

You've got StrCmp backwards. It's skipping the code if the user has entered has a password, instead of the other way around. You should use the LogicLib:
code:
!include LogicLib.nsh
# ...
${If} $R0 == ""
MessageBox MB_OK blah
${Else}
Call Adva...
${EndIf}


M4RC II 4th November 2005 20:38

hy kichik thx for your help but I don't understand what I must write now in my *.nsi

Could you write please the code in my password.nsi?


Marc

M4RC II 5th November 2005 11:53

Please help me

If someone one know how I can do this could you write me the code in my nsi ?

kichik 5th November 2005 12:18

...
code:
!insertmacro MUI_INSTALLOPTIONS_READ $R0 "Password.ini" "Field 1" "State"
${If} $R0 != ""
Push "Password" #-- text to be replaced within the " "
Push "$R0" #-- replace with anything within the " "
Push all #-- replace all occurrences
Push all #-- replace all occurrences
Push $INSTDIR\users.ini #-- file to replace in
Call AdvReplaceInFile #-- Call the Function
${Else}
MessageBox MB_OK|MB_ICONINFORMATION $(NoPassword)
Abort
${EndIf}


M4RC II 5th November 2005 12:46

WOW thx kichik it works


All times are GMT. The time now is 04:44.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.