Archive: Locking Multiple option sections, or skipping a page


Locking Multiple option sections, or skipping a page
I've finally got my installer to work properly. But I'm left with a minor issue, that is mostly aesthetic, but I need to fix it.

When the installer starts there are multiple options, installing the main program, and creating shortcuts. Now the main install is locked. But I'd also like to lock the Start Menu shortcut option because even if it is unchecked the Start menu folder selection page still pops up (but it doesn't do anything if unchecked). How can I lock section2 as well as section1? All the examples I can find are to lock a single section, which I have done, I would like to lock both.

Alternatively It'd be just as good (if not better), to have the Start Menu Folder Selection screen just not open up if the user doesn't check the Start Menu shortcut. Unfortunately I can't figure out, or find any tutorials on how to lock out a macro if a user option is not selected.

Peace.


Well I tried this:

  Function onInitDirectoryPage1
StrCpy $CurrentPage "DirectoryPage1"
;Section 1 selected?
SectionGetFlags ${Section1} $0
IntOp $R0 $0 & ${SF_SELECTED}
IntCmp $R0 ${SF_SELECTED} checkRegEntry
Abort ;skip page
checkRegEntry:
StrCmp $INSTDIR "" 0 checkDefaultLocation
StrCpy $INSTDIR1 "" ;we know nothing
Return
checkDefaultLocation:
StrCpy $INSTDIR1 "$INSTDIR" ;found it!

SectionGetFlags ${Section2} $R0
IntOp $R0 $R0 & ${SF_SELECTED}
IntCmp $R0 ${SF_SELECTED} show

Abort

show:
!insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder

FunctionEnd


And it fails to compile either because:

1)I leave !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder in the beggining list of components. It complains that it's already defined
2)I remove it from the original list, and it complains because when it gets to the start menu stuff, it can't run the !insertmacro MUI_STARTMENU_WRITE_BEGIN Application part of the code.

Anyone know how to disable/enable the MUI_STARTMENU_WRITE_BEGIN page based on a section selection?

Figured it out. Had to create a new custom page so I could have multiple MUI_PAGE_CUSTOMFUNCTION_PRE entries.