Old 28th October 2013, 11:30   #1
winman2004
Member
 
Join Date: Nov 2009
Location: Mangalore-Karnataka-India
Posts: 87
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
code:

!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
winman2004 is offline   Reply With Quote
Old 28th October 2013, 11:55   #2
jpderuiter
Major Dude
 
Join Date: Feb 2007
Posts: 672
In function FinishPageShow call
code:
GetDlgItem $0 $HWNDPARENT 3 ; next = 1, cancel = 2, back = 3
EnableWindow $0 0

jpderuiter is offline   Reply With Quote
Old 28th October 2013, 13:43   #3
winman2004
Member
 
Join Date: Nov 2009
Location: Mangalore-Karnataka-India
Posts: 87
Quote:
Originally Posted by jpderuiter View Post
In function FinishPageShow call
code:
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.
winman2004 is offline   Reply With Quote
Old 28th October 2013, 14:24   #4
jpderuiter
Major Dude
 
Join Date: Feb 2007
Posts: 672
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?
jpderuiter is offline   Reply With Quote
Old 29th October 2013, 10:10   #5
winman2004
Member
 
Join Date: Nov 2009
Location: Mangalore-Karnataka-India
Posts: 87
Quote:
Originally Posted by jpderuiter View Post
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
winman2004 is offline   Reply With Quote
Old 29th October 2013, 13:26   #6
aerDNA
Senior Member
 
aerDNA's Avatar
 
Join Date: Feb 2007
Location: Rijeka, Croatia
Posts: 225
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.

PostEnd:
aerDNA is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump