- NSIS Discussion
- UMUI_PAGE_ALTERNATIVESTARTMENU and its LEAVE function
Archive: UMUI_PAGE_ALTERNATIVESTARTMENU and its LEAVE function
HSorgYves
24th December 2009 15:17 UTC
UMUI_PAGE_ALTERNATIVESTARTMENU and its LEAVE function
When should the LEAVE function defined by
define MUI_PAGE_CUSTOMFUNCTION_LEAVE AlternativeStartMenuLeave
>
be called on UMUI_PAGE_ALTERNATIVESTARTMENU? Only when clicking NEXT?
I think it would be good to always call it and give the developer the flexibility to interact with the page using this way... what do you think?
Best Regards,
Yves
HSorgYves
24th December 2009 21:01 UTC
I have made the following changes to achieve my goal.
Lines 7449-7450 and 7497-7498 replaced by:
Goto customfunction
>
Lines 7467-7468 replaced by:
"3"
>Goto customfunction
>
Line 7552 replaced by:
customfunction:
!insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE
StrCmp $MUI_TEMP1"0" +3
ClearErrors
Abort
>
Best Regards,
Yves
SuperPat
25th December 2009 00:21 UTC
I have found a bug in the leave function:
A little fix allow the custom leave function to use the abort instruction itself.
The code setting the varcontext and saving the selected path was always called, even then the pas is show the first time (this is why the page is not shown if Abort is used in the custom leave function)...
Your patch is no longer necessary with the futur version.
Thanks for your bug reports.
HSorgYves
25th December 2009 00:27 UTC
Great that the next release will continue to work as expected by my description. Did you see the fix I needed for state 3 (the SendMessage call relaunches the LEAVE function with state 2).
Best Regards,
Yves
HSorgYves
25th December 2009 17:45 UTC
Unfortunately this has not been adressed in today's release. Let me rephrase:
I want the LEAVE function to be called whatever action the user does on this page to be able to react to it (like check the folder (s)he enteres in the text field or the one (s)he selects in the tree view ...). However the LEAVE function is only called when the Next button is clicked...
Best Regards,
Yves
HSorgYves
25th December 2009 18:30 UTC
The required changes for the release 2009-12-25 are (without the radio buttons which are not set to NOTIFY anyway):
Line 7477 and line 7533:
Goto customfunction
>
Line 7495:
StrCpy $MUI_TEMP1 "3"
>!insertmacro INSTALLOPTIONS_WRITE "AlternativeStartMenu${ID}.ini" "Settings" State "3"
>Goto customfunction
>
Line 7589:
StrCpy $MUI_TEMP1 0
customfunction:
!insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE
StrCmp $MUI_TEMP1"0" end
Abort
>
Best Regards,
Yves
SuperPat
26th December 2009 12:04 UTC
I may be add an other custom function than LEAVE to do this.
But I never understood the need to check the directory every time you click on a component rather than when you click next.
HSorgYves
26th December 2009 15:33 UTC
Just one example:
You always add ${MUI_STARTMENUPAGE_DEFAULTFOLDER} when a user clicks on a folder. However if $MUI_TEMP2 == ${MUI_STARTMENUPAGE_DEFAULTFOLDER} I do not want it to be added. I could achive this quickly by modifying the UMUI.nsh, but then I would need to redo it on each upgrade which is nasty...
Thanks,
Yves