Archive: create custom popup window


create custom popup window
Hi,
is it possible to create very basic pop up window with only edit control and ok button (for registration) using NSIS script?
Or i should code own exe?

Im sure i seen somewhere window manupulation functions on NSIS 2.0 docs but cant find it anymore.


Would it not be easier and look better to create a custom NSIS Page with a text box?

Vytautas :D


If you want to hide the cancel button and the back button use GetDlgItem and ShowWindow. You can find examples in Contrib\Modern UI\System.nsh. The MUI uses these kind of instructions a lot.


Hmm good idea about make custom UI page but how to attach it? Ideally it would be nice put register edit box tougether with directory selection page, so user fill directory edit plus register name and thats it. I go look to Moder UI macros now. Is so unusual grade from 1.98 to version 2.


Seems i found how to do it. InstallOptions.nsi is the way to go. What a powerful installer thanks alot.


well, if you talking like those Visual Basic popup windows (AKA InputBox) you can create one, using the system plugin and check the APIs CreateWindowEx and DialogBox.
Well....it's just my opinion
:)


I posted new post in that thread but its strangely disappeared.
Okay, i created custom page but now how to do no give user leave until
he fill that edit box? As i read, disable Install (next) button is not yet available.
I made a function

Function CustomPageC
!insertmacro MUI_HEADER_TEXT "" ""
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioC.ini"

Emp:
!insertmacro MUI_INSTALLOPTIONS_READ $INI_VALUE "ioC.ini" "Field 1" "Text"

StrCmp $INI_VALUE "" Emp Cont

Cont:
MessageBox MB_OK "Ok"
FunctionEnd

But its cause infinite loop so even exit installer doesnt help. Where i should put that coparation (but it should be before files installation start)

Thanks in advance


You should define a leave function for that page and then use the abort command in that function if you do not want the user to proceed to the next page.

Vytautas


I tryed this way:
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
Page custom CustomPageC
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE LeaveCustomPageC
!insertmacro MUI_PAGE_INSTFILES

ie Leave function after Custom page,
next:

Function LeaveCustomPageC
!insertmacro MUI_INSTALLOPTIONS_READ $REG_NAME "ioC.ini" "Field 1" "Text"
StrCmp $REG_NAME "" Emp Cont
Emp:
Abort
Cont:
;MessageBox MB_OK "Empty."
Exit:
FunctionEnd

Same infinite loop but appeareed after my custom page processed and AFTER files been installed (ie just before Finish dialog.

What i doing wrong?


Sorry for being stupid
Read TEXT instead STATE
but that CustomLeave page appear in strange place anyway.
Where it should be place for 100% call before INSTFILES?


your defines are wrong.
this:

Page custom CustomPageC
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE LeaveCustomPageC
!insertmacro MUI_PAGE_INSTFILES

defines LeaveCustomPageC as leave-function for the instfiles-page.

this code should work:
Page custom CustomPageC LeaveCustomPageC
!insertmacro MUI_PAGE_INSTFILES


see the docs for more information about custom pages and their functions.

Yep, made exactly that.
Thanks