This custom page only contains 2 labels, a group box and a file browse box, so it shouldnt take long to read, parse and display the contents of the ini file. So does anybody have any ideas as to the cause of the delay?
If it helps at all, these are the relevant parts of the script:
Page ordering
Name of INI file is defined at the top of the script as follows:!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "${PATH_TO_FILES}\License.txt"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_COMPONENTS
Page custom GetCustomScriptPath
!insertmacro MUI_PAGE_INSTFILES
The code for my custom page is as follows (I have highlighted the line where the pause seems to occur)!DEFINE NSIS_CUSTOM_SCRIPT_INI "CustomScriptSelection.ini"
As you can see if the "is_CustomScript" section is not selected this section simply quits, if it is selected then the custom page code is executed
Function GetCustomScriptPath
SectionGetFlags ${is_CustomScript} $R0
IntOp $R0 $R0 & ${SF_SELECTED}
IntCmp $R0 ${SF_SELECTED} show
Abort
;;show the custom page
show:
!insertmacro MUI_INSTALLOPTIONS_EXTRACT ${NSIS_CUSTOM_SCRIPT_INI}
!insertmacro MUI_HEADER_TEXT "Custom script selection" "Enter the full path and file name of your custom installation script."
!insertmacro MUI_INSTALLOPTIONS_DISPLAY ${NSIS_CUSTOM_SCRIPT_INI}
;;Get the entered values into vars
!insertmacro MUI_INSTALLOPTIONS_READ $INSTALL_SCRIPT_PATH ${NSIS_CUSTOM_SCRIPT_INI} "Field 2" "State"
FunctionEnd
Interestingly if I add a 'MessageBox MB_OK "boo!"' just above the highlighted line the delay rarely occurs. As soon as I click "ok" on the message box the custom page is displayed
The following is the contents of my custom page ini file
[Settings]
NumFields=4
[Field 1]
Type=Groupbox
Text=Enter custom script path and file name
Left=0
Right=300
Top=44
Bottom=89
[Field 2]
Type=FileRequest
Text=C:\
State=C:\
Left=5
Right=290
Top=61
Bottom=74
[Field 3]
Type=Label
Text=You have selected to use a custom installation script to configure your XXXX System, please use the dialog below to select the custom script to use.
Flags=NOTABSTOP
Left=0
Right=300
Top=4
Bottom=35
[Field 4]
Type=Label
Text=Refer to documentation for further information regarding custom installation scripts.
Flags=NOTABSTOP
Left=0
Right=300
Top=98
Bottom=126