Archive: MUI_PAGE_CUSTOMFUNCTION_PRE not working


MUI_PAGE_CUSTOMFUNCTION_PRE not working
hello i am haveing trouble getting this to work properly here is some of my code:

;--------------------------------------------------------------------
!insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Examples\TKLBXLicense.rtf"
Page custom CustomPageA
!define MUI_PAGE_CUSTOMFUNCTION_PRE skipDirectory
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES

Var INI_VALUE
;--------------------------------

ReserveFile "choose.ini"
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS

!insertmacro MUI_INSTALLOPTIONS_READ $INI_VALUE "choose.ini" "Field 3" "State"

StrCmp $INI_VALUE "1" 0 TKLINST

Call skipDirectory
Call PreInstall
Call AddFiles

TKLINST:

Call AddFiles
;---------------
;----FUNCTIONS--
Function CustomPageA

!insertmacro MUI_HEADER_TEXT "$(TEXT_IO_TITLE)" "$(TEXT_IO_SUBTITLE)"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "choose.ini"

FunctionEnd

;--------------------------------------------------

Function skipDirectory

Abort

FunctionEnd
;--------------------------------------------------------------------


Basically what the installer does is create a custom page that asks if they want to update an existing installation or have a fresh install. If they select the radiobutton in "field 3" on customPage i want to skip the directory page and just install the update, not working proprly....Doesnt show directory page either way, and just aborts the whole installation from there

any help would be appreciated

mike


You can't use run-time commands such as Call, StrCmp etc outside Functions or Sections. If you want to jump over the Directory page, use:

StrCmp $INI_VALUE "1" 0 +2
Abort

in your skipDirectory page.

You should put all the run-time code above your CustomPageA function in a new Function CustomPageB and use that as a Leave function of your Custom page:
Page custom CustomPageA CustomPageB

-Stu