Archive: Disable back button in finish page


Disable back button in finish page
For my installation i have added new custom page. It comes after MUI_PAGE_INSTFILES. But before this custom page was not there. The problem is that after adding this custom page,it has effected finish page and finish page now has back button enabled.Before it was disabled(I have not done any coding before to disable back button). But after adding new custom page finish page has back button enabled.

I have below order of pages


!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "${Stpath}read me.txt"
!define MUI_PAGE_CUSTOMFUNCTION_PRE wel_pre
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE DirectoryPageLeave
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
Page custom InstallPageCreate checkinstdir
!define MUI_FINISHPAGE_RUN "$INSTDIR\setupx.exe"
!define MUI_FINISHPAGE_RUN_PARAMETERS ""
!define MUI_PAGE_CUSTOMFUNCTION_PRE welfinish
!define MUI_PAGE_CUSTOMFUNCTION_SHOW FinishPageShow
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE myleave
!insertmacro MUI_PAGE_FINISH


Before the line Page custom InstallPageCreate checkinstdir was not there and finish page does not had back button enabled.

After adding that custom page back button in finish page is enabled.The custom page is shown only when certain command line is passed to installer. So if no command line is passed for my setup.exe then after MUI_PAGE_INSTFILES, finish page comes.If user clicks on back button then again MUI_PAGE_INSTFILES is shown and files will copy to install directory. Also if that custom page appears then that page has back button disabled, which is proper.
Also i need to know where this back button disable is done? Is it done in macro MUI_PAGE_INSTFILES(nsis builtin macro)?

So i need to disable back button in finish page. Please help

In function FinishPageShow call

GetDlgItem $0 $HWNDPARENT 3 ; next = 1, cancel = 2, back = 3
EnableWindow $0 0

Originally posted by jpderuiter
In function FinishPageShow call
GetDlgItem $0 $HWNDPARENT 3 ; next = 1, cancel = 2, back = 3
EnableWindow $0 0
Works fine. Thank you

But where does this button are enabled and disabled? In my case after adding custom page the button got enabled in finish page.

I'm not sure, the NSIS source code must be reviewed for that.
I think you should file a bug for this.
What version of NSIS are you using?


Originally posted by jpderuiter
I'm not sure, the NSIS source code must be reviewed for that.
I think you should file a bug for this.
What version of NSIS are you using?
i am using 2.46

This is expected behaviour, Back is disabled only if the page was preceded by InstFiles. Afaik, it goes for any page, Finish has no specific properties in that regard. It may arguably be a flaw but I wouldn't call it a bug.