Skip to content
⌘ NSIS Forum Archive

back/next button simulation problem

3 posts

zhangxiaorui#

back/next button simulation problem

Hi, everyone

I use NSIS 2.46 and MUI2 to generate an install file, but I meet some problems. With HM NIS EDIT wizard I have generated the whole installation files, and I insert two custom pages:

!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE
!insertmacro MUI_PAGE_COMPONENTS

Page custom nsDialogsPage nsDialogsPageLeave ; (select the install Directory, 2 options, if 1, go to next Page custom ADTF....., if 2, go to MUI_PAGE_DIRECTORY)

Page custom ADTFDirecPage ADTFDirecPageLeave ;(another install Directory)

!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH

Problem1: How can I get the simulation of back button in MUI_PAGE_DIRECTORY? nsDialogs::OnBack runs perfect for custom Pages, but it doesn't work for MUI_PAGE. PRE, SHOW and LEAVE functions for MUI_PAGE can not solve this problem, either. My goal is: When I click the back button in MUI_PAGE_DIRECTORY, a message box will appear. Then When I close this MSG box, I will see the Page custom nsDialogsPage instead of Page custom ADTFDirecPage (Skip one page!).

Problem2: If I have selected the option 2 and already go to Page custom ADTFDirecPage. In this page I have given a new install directory. Then I'd like to go directly to MUI_PAGE_INSTFILES (Skip MUI_PAGE_DIRECTORY!) and finish the installation. This means, here the Next button of Page custom ADTFDirecPage has the same effect as an install button.

If you have any useful suggestion, please tell me. Thank you!!

Xiao
MSG#
To skip a page, call abort in its prefunction (== creation function, for custom pages). This works in both directions. So you can simply set a variable in your directory's prefunction saying "$ComingFromDirectoryPage == true", and in the adtf page simply call abort if that variable is set to true. (Remember to reset the value in the nsdialogspage function).

To jump to instfiles page from your adtf leave function use this: http://nsis.sourceforge.net/Go_to_a_NSIS_page
T.Slappy#
Simply use WM_COMMAND message to simulate clicking the buttons.

SendMessage $hwndparent ${WM_COMMAND} 1 0 ; Click the "Next" button