Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Need help with my password page (http://forums.winamp.com/showthread.php?t=258525)

Sp33dy G0nz4l3s 29th October 2006 09:07

Need help with my password page
 
1 Attachment(s)
Hello, I've created a password page for my installer.

On the password page one enter a password. Then the function AdvReplaceInFile will be call.

So the entered password replace the text in a file.

Here is an example:

code:
!insertmacro MUI_INSTALLOPTIONS_READ $R0 "password-client.ini" "Field 1" "State"
${If} $R0 != ""
Push "Passwort" #-- 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\Infos\Counter-Strike-1.6-Dedicated-Client-Erweiterungssystem.txt #-- file to replace in
Call AdvReplaceInFile #-- Call the Function
${Else}
MessageBox MB_OK|MB_ICONINFORMATION $(NoPassword)
Abort
${EndIf}

;Match?
!insertmacro MUI_INSTALLOPTIONS_READ $R1 "password-client.ini" "Field 2" "State"
StrCmp $R0 $R1 +3
MessageBox MB_OK|MB_ICONINFORMATION "$(PassDoNotMatch)"
Abort

FunctionEnd



Up to now the script works perfect. But now i will extend the script because i have created some new installer which affect this installer.

Before the password page is shown the installer should check if the file "Password.txt" exist.

If this file exist the Password page shouldn't shown and the installer should automatically take the content from the Password.txt and replace it e.g. with the word "Password" in the Counter-Strike-1.6-Dedicated-Client-Erweiterungssystem.txt.

I hope you're understanding what i meaning.

Here is the installer script. I tried to extract the password function but unfortunately it hasn't work after this. So sorry that it is the complete script.

It would be very friendly if you help me
Thank you Marc

kichik 30th October 2006 18:30

The FAQ holds your answer. Simply skip the call to InstallOptions. Jump to the end of the function if the file exists.


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

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.