Acctualy, the whole order is messed up.
Try order it like this
- Variables, Naming and stuff
- pages (just the pages and stuff you have to define for the page like so:
; Welcome page
!insertmacro MUI_PAGE_WELCOME
; Directory page
!insertmacro MUI_PAGE_DIRECTORY
LangString CUSTOM_TITLE ${LANG_ENGLISH} "Enter your Login Details."
LangString CUSTOM_SUBTITLE ${LANG_ENGLISH} " "
Page custom Custom1Page
; Start menu page
var ICONS_GROUP
!define MUI_STARTMENUPAGE_NODISABLE
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "Draco SSC"
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "${PRODUCT_STARTMENU_REGVAL}"
!insertmacro MUI_PAGE_STARTMENU Application $ICONS_GROUP
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!define MUI_FINISHPAGE_RUN "$INSTDIR\DracoSSC.exe"
!insertmacro MUI_PAGE_FINISH
-localization and language stuff
-Functions (onInit, then the custompage function, then the sections, then un.onInit, un.Sections, un.onUninstSucces)
Basicly, first tell the installer which pages to use in what order, then follow with the function in the order they will most likely be used. I'm not certain if everything has to be in exact order, but it's easier to read and comprehend that way at least.
Oh, and if you got a custom Page called CustomPage you got to call the function the same.