Wabiloo
10th May 2006 10:55 UTC
Automated (not Silent) Installer
I've created a rather complex installer for my application, that "intelligently" finds what components to install, how to fill in the default values in the custom pages, etc. according to what's already on the computer. This is (at the moment) all done in the custom page functions.
I would like now to make the installer fully automated, ie. not require the user to click the "next" button manually.
However, I don't want it to be silent. First, because I would have to rewrite the whole thing so that the logic wouldn't be in the custom page functions (I discovered that the page functions are not called at all in a silent installer). Anyway, I want to see the GUI, even if I want to not have to interact with it.
Is there a way, just after a page (be it custom page or standard MUI page) is displayed, to automatically go to the next page (as if the "next" button had been clicked)?
I notice that if in a custom page I put a messagebox just after the call to MUI_INSTALLOPTIONS_DISPLAY, it will not appear until I actually click the "next" button...
o_owd
10th May 2006 11:15 UTC
you can make the installer to proccess your custom pages too when making a silent install.
have a look at this thread, maybe it helps...
http://forums.winamp.com/showthread....hreadid=239240
OJi.
Wabiloo
10th May 2006 12:29 UTC
Yes, but that what I meant when I said I didn't want to rewrite the whole thing. Plus, I actually want to see the screens, just not want to click them.
What I'd like is some way of having each page show for 3 seconds, then the next button is "clicked" automatically.
o_owd
10th May 2006 13:45 UTC
i understood what you want.
i just wanted to show you that it can be made in silent too. you don't have to rewrite everything.
i had the same problem and with the help from the thread i specified i managed to do it. :)
sorry, but i don't know how to make what you want.
the solution will come, just be pacient. somebody from this forum will help you. they allways do ! :up:
OJi.
galil
10th May 2006 17:33 UTC
Clicking a button is a simple matter of sending a bm_click message to installer window.
Problem here is that I don't think (though I might be wrong) there's a way to send it from installer itself when it finishes creating a page and waits for user input.
So you have to compile an external proggy to do the job and run it from your main installer.
Conceptual script for the proggy:
SetCompress off
Name "Autoclick"
OutFile "Autoclick.exe"
!include WinMessages.nsh
Function .onInit
loop:
Sleep 3000 ;wait some (optional)
FindWindow $0 "#32770" ;search for the NSIS window
StrCmp $0 0 end ;quit if not found
GetDlgItem $0 $0 1 ;get handle of the proceed button
SendMessage $0 ${BM_CLICK} "" "" ;click the button
Goto loop ;repeat
end:
Quit
FunctionEnd
Section ""
SectionEnd
In your main script, add something like this:
!define MUI_CUSTOMFUNCTION_GUIINIT myGuiInit
Function myGuiInit
ClearErrors
Exec "$EXEDIR\Autoclick.exe"
IfErrors 0 +2
MessageBox MB_OK "Could not launch Autoclick! Manual step through."
FunctionEnd