Archive: MUI Help


MUI Help
Hello people..

I am trying to migrate to the MUI system, but I cannot find the info I need (properly because of me :weird: )
Anyway..I would like the users to be able to (de)select weather they want to have shortcuts or not. First of I do not know how to add components to the MUI_PAGE_COMPONENTS, second I cannot figure out how to make the !insertmacro MUI_PAGE_STARTMENU page dynamic in terms of when users deselect the option to have shortcuts, the page shoul not be shown.

If I am not clear enough about my troubles, please ask me to clarify.

Best regards :D


Each section is a component for the user to choose from. So, to add components to the installation add new sections.

second I cannot figure out how to make the !insertmacro MUI_PAGE_STARTMENU page dynamic in terms of when users deselect the option to have shortcuts, the page shoul not be shown.
I think you need to use MUI_PAGE_CUSTOMFUNCTION_PRE - define.
Put this define before inserting a StartMenu page macro and create function. Inside this function you can check selected or deselted the option to create shortcuts, and abort page execution if deselected.

Mmmh.. I see. But I have just realized that there is an embedded option to deselect shortcuts, so no need to check on it or script it. But thank you for the help ;)


Originally posted by tatsudoshi
Mmmh.. I see. But I have just realized that there is an embedded option to deselect shortcuts, so no need to check on it or script it. But thank you for the help ;)
What problem?
Add Section named "Shortcuts". Inside this section create shortcuts on desktop and other places. Code like this:
....
Function "PageAbort"
SectionGetFlags ${SecShort} $R1
IntOp $R1 $R1 & 0x1
IntCmp $R1 1 allok abortpage
abortpage:
abort
allok:
FunctionEnd

....

!define MUI_PAGE_CUSTOMFUNCTION_PRE "PageAbort"
!insertmacro MUI_PAGE_STARTMENU Application $ICONS_GROUP

....

Section "Shortcuts" SecShort
CreateShortCut ...
CreateShortCut ...
SectionEnd

....

If user select section "Shortcuts" then StartMenu page will be displayed and shortcuts created. If deselect -> aborted and no shortcuts.