Old 26th April 2012, 09:33   #1
zhangxiaorui
Junior Member
 
Join Date: Apr 2012
Posts: 1
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
zhangxiaorui is offline   Reply With Quote
Old 26th April 2012, 11:40   #2
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
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
MSG is offline   Reply With Quote
Old 30th April 2012, 08:05   #3
T.Slappy
Major Dude
 
T.Slappy's Avatar
 
Join Date: Jan 2006
Location: Slovakia
Posts: 566
Send a message via ICQ to T.Slappy
Simply use WM_COMMAND message to simulate clicking the buttons.

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

Cool looking installers with custom design: www.graphical-installer.com
Create Setup Pages easily: www.install-designer.com
Build installers in Visual Studio 2005-2022: www.visual-installer.com
or RAD Studio 2009 - 11 Alexandria: www.rad-installer.com
T.Slappy 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