- NSIS Discussion
- need IO with no buttons
Archive: need IO with no buttons
Brummelchen
8th September 2003 03:36 UTC
need IO with no buttons
i have a little problem.
i have an IO with infos but i dont need any button 'cause behind this IO there is action and when action is done IO is closed.
Unfortunatly IO has those buttons and one has to be pressed to continue action.
is it possible to have an IO without any button?
thx
kichik
8th September 2003 11:04 UTC
IO allows you to disable the back and cancel button using CancelEnabled and BackEnabled. In the latest CVS version you can also disable and enable windows using EnableWindow from the script. Use this to disable the next button too:
GetDlgItem $0 $HWNDPARENT 1
EnableWindow $0 0
Brummelchen
8th September 2003 12:53 UTC
>> using CancelEnabled and BackEnabled.
This is what i already have - all buttons are disabled (0) in IO - i only get "Fertigstellen" (german) (and "Beenden" greyed out)
hmm, where must i put that code?
Like this it disables the buttons from the next pane not the concerning IO
;Modern UI Configuration
page custom dosilent
Function dosilent
;if silent do backup and save all options
Call IsSilent
IfSilent notSilent 0
;silent stuff
call checkbackupfolder
;disable all buttons
GetDlgItem $5 $HWNDPARENT 1
EnableWindow $5 0
dosilent01:
!insertmacro MUI_HEADER_TEXT "Taskplaner" "These files are saved now.$\nPlease wait a moment"
dosilent04:
Push $INSTDIR
Call ConvertBStoDBS2
Pop ${TEMP1}
dosilent05:
!insertmacro MUI_INSTALLOPTIONS_WRITE "$R3silent01.ini" "Field 6" "Text" ${TEMP1}
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "$R3silent01.ini"
dosilent06:
sleep 5000 ;just testing
Quit
notSilent:
FunctionEnd
kichik
8th September 2003 12:59 UTC
Replace MUI_INSTALLOPTIONS_DISPLAY with MUI_INSTALLOPTIONS_INITDIALOG and MUI_INSTALLOPTIONS_SHOW and put the code between them.
Brummelchen
8th September 2003 13:12 UTC
yeah works so far
i had no success with _SHOW last night - i found it in the changelog and unfortunately i could not work with it. it was very late for me.
dosilent05:
!insertmacro MUI_INSTALLOPTIONS_WRITE "$R3silent01.ini" "Field 6" "Text" ${TEMP1}
!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "$R3silent01.ini"
;disable all buttons
GetDlgItem $5 $HWNDPARENT 1
EnableWindow $5 0
!insertmacro MUI_INSTALLOPTIONS_SHOW
dosilent06:
sleep 5000
Quit
But now i have another problem - IO is waiting for input again.
i had to kick my prog with the taskmanager.
kichik
8th September 2003 13:14 UTC
What do you mean waiting for input? Isn't that program of yours supposed to close IO?
Brummelchen
8th September 2003 13:23 UTC
i mean - input=button
i want this behaviour:
if "silent"
- show IO with infos (no user input)
- while showing IO do savings in background
- when done close IO and show messagebox success
(strip .nsi from attachment)
is that possible overall?
PS $R3 in script above contains language shorty - for attachment it is "e" - if you intend to test it.
kichik
8th September 2003 13:36 UTC
Works fine for me... IO has no buttons enabled whatsoever. All you need to do is get your program to make IO destroy itself.
Brummelchen
8th September 2003 14:15 UTC
Does not work here... :(
you see that sleep command (for test) at the end (before quit) ?
That command is never reached. thats my trouble
kichik
8th September 2003 14:19 UTC
So your program doesn't close IO? I thought your problem is just disabling the buttons... What you're trying to do is impossible (without changes to the source of course). IO is not multi-threaded and the script can't continue while IO is still running. For that there is the broken banner. It should work outside of .onInit though...
Brummelchen
8th September 2003 14:41 UTC
damn - so i have to use banners.
BTW how can i close the IO?
kichik
8th September 2003 14:44 UTC
All you need to do is send the main NSIS window WM_COMMAND with 1 as wParam.
Brummelchen
8th September 2003 15:20 UTC
SendMessage HWND "" WM_COMMAND 1
?
when & where?
:confused:
kichik
8th September 2003 15:32 UTC
In another application that will do the action. You can create a sub installer that will do all the action and send a message to the main window. To get the $HWNDPARENT into the sub installer you can pass it on the command line.
Brummelchen
8th September 2003 16:08 UTC
hmm, nice idea
you this one?
Exec '"prog.exe" $HWNDPARENT'
And prog.exe gets $CMDLINE and close it afterwards?
kichik
8th September 2003 16:22 UTC
Yep, but don't close it, send the WM_COMMAND message.
Brummelchen
8th September 2003 16:31 UTC
thats what i mean ;)
SendMessage HWND "" WM_COMMAND #
(where # is from cmdline)
or - hmm, dont know now - confused...
kichik
8th September 2003 16:36 UTC
SendMessage $HwndFromCMDLINE ${WM_COMMAND} 1 0
Brummelchen
8th September 2003 16:50 UTC
i though it was wrong what i wrote :D
thank you kichik :)