Easter Egg
17th August 2005 10:29 UTC
How can I make this page
Hy I've make an custom page with an password
[Settings]
NumFields=1
[Field 1]
Type=Password
Left=12
Right=135
Top=6
Bottom=20
      
      This password must redo an the word password I.
      
      For this I use
      
http://nsis.sourceforge.net/wiki/ReplaceInFile
      
      But where must I put in the !insertmacro
      
      how can I do it?
    
 
    
      Afrow UK
      17th August 2005 11:12 UTC
      Put it in the custom page's Leave function:
      
      Page Custom ShowFunc LeaveFunc
      
      Function LeaveFunc
      ...
      FunctionEnd
      
      -Stu
     
    
      Easter Egg
      17th August 2005 13:35 UTC
      Hi I think that I haven't write very good what I want:
      
      The Field 1
      
      is a password field. So in the Function LeaveFunc I must write anything:
      
      Perhaps
      
      Function LeaveFunc
      
      
      ReadIniStr $0 '$PLUGINSDIR\netsettings.ini' 'Field 1' 'State'
      
      StrCmp $R0 (this should be the text in the password field) "1" 0 +2
      !insertmacro ReplaceInFile "Password.txt" (Source file) "Password 1" (Search) "$R0" (replace with)
      
      end
      
      MessageBox MB_OK "Pls write an password"
      
      
      
      I know that this is wrong but so it should be
      THX
     
    
      Afrow UK
      17th August 2005 15:32 UTC
      The value won't be 1, but what the user has entered in the password box (the actual password).
      
      Also, you can't jump over the !insertmacro ReplaceInFile with a relative +2 jump because the macro contains more than one like of code. You need to jump over it with a label.
      
      -Stu
     
    
      Easter Egg
      17th August 2005 16:54 UTC
      Hi
      I'm not very good with nsis
      
      
      Could you write me the code
      that it works ?
      
      Thank you