khal_nayak
6th June 2003 01:15 UTC
Page calling command
how to call or take the user back to a specific page of the installer by just specifing some command in the section?
I mean when u specify some command in a section and when the user selects the components and clicks next, the installation starts. What i want is that if the user selects a specific section then during installation, a msgbox should appear on clicking which the user be send to some previous page of the installer, eg:license, welcome, component. So then what command is there to make the user jump to diffrent pages?
iceman_k
6th June 2003 02:02 UTC
None really that I know of.
You may be able to go to the next or previous page by sending a WM_COMMAND message to the window with the ID of the next or previous button. Never tried it, so I don't know if it will work.
BTW, like your nick. :D
kichik
6th June 2003 10:37 UTC
You can add another page after the instfiles page and skip it if the user hasn't selected the right component.
khal_nayak
6th June 2003 11:02 UTC
is it possible to disable the next button on the components page if the user doesnt select the appropriate install type from the drop down list?
kichik
6th June 2003 11:06 UTC
It's not possible to disable it, but it's possible to not allow the user to continue. Call Abort from the leave function of the page and the user won't be able to move on.
khal_nayak
6th June 2003 17:08 UTC
im not so good at scripting the NSIS so can u plz type in that part of the script so i know what u exactly mean.
Secondly, in my installer there r some exe files which while installing update some older version of them on the computer but the problem is u cant update a dll or exe file if it is already running in the background or foreground so then is it possible to detect that such files r running and that the installer can close such running programs and then update the file and then make it run again using exec? Like what the msn messenger installer has, it closes the msn that is running in the system tray and then updates the exe file and then runs it again?
kichik
7th June 2003 10:25 UTC
As for the leave function:
Page components "" "" compLeave
#...
!include Sections.nsh
Function compLeave
# make sure ${mySec} is defined!
SectionGetFlags ${mySec} $0
IntOp $0 $0 & ${SF_SELECTED}
StrCmp $0 ${SF_SELECTED} ok
# the user didn't select the required section,
# don't let him leave the page
Abort
ok:
FunctionEnd
In case you're using the MUI see the MUI readme about defining a leave function for the components page.
As for updating in use DLLs, use the
UpgradeDLL macro.
I don't know how to close messenger yet. There is a recent thread about it. I really recommend you don't use the process termination method though, it's far from being the ideal way. There are also some other less recent threads about closing programs, some linked from that thread.
khal_nayak
7th June 2003 16:52 UTC
thanx m8, i finally got the script working my way.
Plz keep me informed if u get any news bout some way to close running exe files and progs.