[NSIS] NSIS : How to create custom input field page
!insertmacro MUI_PAGE_COMPONENTS
Page Custom MyInputPageCreate MyInputPageLeave ; Custom input page
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
Function MyInputPageCreate
!insertmacro MUI_HEADER_TEXT "My Input page" "This is my Input page"
Var /Global Input1_Textbox
Var /Global Input2_Textbox
nsDialogs::Create /NOUNLOAD 1018
Pop $0
${NSD_CreateLabel} 0 0u 100u 10u "Input1"
${NSD_CreateNumber} 10% 20u 80% 12u "1234"
Pop $Input1_Textbox
${NSD_CreateLabel} 0 50u 100u 10u "Input2"
${NSD_CreateText} 10% 70u 80% 12u "abcd"
Pop $Input2_Textbox
nsDialogs::Show
FunctionEnd
Function MyInputPageLeave
${NSD_GetText} $Input1_Textbox $0
${NSD_GetText} $Input2_Textbox $1
${if} $0 == ''
MessageBox MB_OK "Input1 is blank"
Abort ;Don't move to next page (If the input was invalid etc)
${endif}
${if} $1 == ''
MessageBox MB_OK "Input2 is blank"
Abort ;Don't move to next page (If the input was invalid etc)
${endif}
FunctionEnd