0

所以你给我的效果很好。现在的问题是如何设置它,以便密码页面上有一条消息,要求您输入密码。这就是我目前所拥有的。

Function leave 


    ${NSD_GetText} $hwnd $0
    ${If} $0 != "web9^root"
        MessageBox MB_OK "Please enter a valid security code"
        Abort
    ${EndIf}
FunctionEnd
Function pre
nsDialogs::Create 1018
    Pop $dialog

${NSD_CreatePassword} 0 0 50% 8% ""
    Pop $hwnd


nsDialogs::show

FunctionEnd

=======================

所以我设置了以下脚本来运行,

!include "nsDialogs.nsh" 
!include "winmessages.nsh"
!include "logiclib.nsh"
OutFile "test.exe"



Page Custom pre

var dialog
var hwnd

Function pre
nsDialogs::Create 1018
    Pop $dialog
${NSD_CreatePassword} 0 0 50% 8% "web9^root"
    Pop $hwnd
    SendMessage $hwnd ${EM_SETPASSWORDCHAR} 149 0 # 149 = medium dot

nsDialogs::Show
FunctionEnd

Section ""
SectionEnd

我如何做到这一点,以便如果您不知道密码,它不会让您通过。我还需要知道谁来设置它,以便密码不在文本字段中。你们能帮我解决这个问题吗

4

1 回答 1

1

you will have to add a leave function for that nsdialogs page...

Page custom pre leave

...and there you verify the password...

Function leave
    ${NSD_GetText} $hwnd $0
    ${If} $0 != "yourPassword"
        MessageBox MB_OK "Wrong password"
        Abort
    ${EndIf}
FunctionEnd

if you don't want the password in that field, just leave it empty when creating the dialog!

于 2013-07-08T21:47:59.747 回答