Archive: Need help with my password page


Need help with my password page
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:

!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

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