我有一个NSIS安装程序,它在安装完成时会发送一封带有几个不同日志的电子邮件。 我想允许用户添加他们的电子邮件地址以接收电子邮件,并且我希望他们在结束页面上输入它,因为它似乎最合适。 如何在完成页面上添加文本框,以供用户输入其电子邮件地址?

这是我当前的完成页面:

  ;Finish page
!Define MUI_FINISHPAGE_RUN
  !Define MUI_FINISHPAGE_RUN_TEXT 'Open Install Log'
  !Define MUI_FINISHPAGE_RUN_NOTCHECKED
  !define MUI_FINISHPAGE_RUN_FUNCTION 'LaunchLog'
!define MUI_FINISHPAGE_LINK 'Click here to visit us at co.com.'
  !define MUI_FINISHPAGE_LINK_LOCATION http://www.co.com/
!define MUI_FINISHPAGE_TEXT_LARGE
!define MUI_FINISHPAGE_TEXT "text text text"
!insertmacro MUI_PAGE_FINISH

===============>>#1 票数:1 已采纳

!include MUI2.nsh ;If you are using MUI v1 you need to replace NSD_* with .ini file commands
!include Logiclib.nsh
...

!ifndef EM_SETCUEBANNER
!define EM_SETCUEBANNER 0x1501 ; NT5 w/Themes & Vista+
!endif

Var EMailEdit

Function CustomizeFinishPage
${NSD_CreateText} 120u 144u 180u 12u ""
Pop $EMailEdit
System::Call 'USER32::SendMessage(i$EMailEdit,i${EM_SETCUEBANNER},i0,w"E-mail address goes here...")'
FunctionEnd

Function SendFinishMail
${NSD_GetText} $EMailEdit $0
${If} $0 == "" ; TODO: Verify address by at least checking for *@*.*
    MessageBox mb_iconstop "You must enter a valid address!"
    Abort
${EndIf}
MessageBox mb_ok "TODO: Send mail to: $0"
FunctionEnd

...

!insertmacro MUI_PAGE_*
;Finish page
!define MUI_FINISHPAGE_RUN
  !define MUI_FINISHPAGE_RUN_TEXT 'Open Install Log'
  !define MUI_FINISHPAGE_RUN_NOTCHECKED
  !define MUI_FINISHPAGE_RUN_FUNCTION 'LaunchLog'
!define MUI_FINISHPAGE_SHOWREADME "" #Used as our email checkbox
  !define MUI_FINISHPAGE_SHOWREADME_TEXT "E-mail me some crap:"
  !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED 
  !define MUI_FINISHPAGE_SHOWREADME_FUNCTION SendFinishMail
!define MUI_FINISHPAGE_LINK 'Click here to visit us at co.com.'
  !define MUI_FINISHPAGE_LINK_LOCATION http://www.co.com/
!define MUI_FINISHPAGE_TEXT_LARGE
!define MUI_FINISHPAGE_TEXT "text text text"
!define MUI_PAGE_CUSTOMFUNCTION_SHOW CustomizeFinishPage
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE English

  ask by afriesenborg translate from so

未解决问题?本站智能推荐:

关注微信公众号