- NSIS Discussion
- create custom popup window
Archive: create custom popup window
Aktion
4th December 2003 12:06 UTC
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.
Vytautas
4th December 2003 13:02 UTC
Would it not be easier and look better to create a custom NSIS Page with a text box?
Vytautas :D
kichik
4th December 2003 13:52 UTC
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.
Aktion
4th December 2003 14:40 UTC
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.
Aktion
4th December 2003 14:48 UTC
Seems i found how to do it. InstallOptions.nsi is the way to go. What a powerful installer thanks alot.
Joel
4th December 2003 19:05 UTC
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
:)
Aktion
5th December 2003 08:32 UTC
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
Vytautas
5th December 2003 10:41 UTC
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
Aktion
5th December 2003 12:06 UTC
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?
Aktion
5th December 2003 12:37 UTC
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?
Comm@nder21
5th December 2003 13:34 UTC
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.
Aktion
5th December 2003 15:20 UTC
Yep, made exactly that.
Thanks