Old 21st October 2011, 15:07   #1
louzorios
Junior Member
 
Join Date: Oct 2011
Posts: 6
Activate the button "next" in a script

Hello
To create an installation of my application I use a script "nsis". During installation the user must specify the installation directory of "SMPlayer" (via a browse).
The "Next" button is only activated when the user selects a location. Is it possible to activate this "next button" even if the user does not select a location

the code i'm using :

code:
define MUI_DIRECTORYPAGE_VARIABLE $Mplayervar
!define MUI_PAGE_HEADER_TEXT $(HEADER_TEXT)
!define MUI_PAGE_HEADER_SUBTEXT $(HEADER_SUBTEXT)
!define MUI_DIRECTORYPAGE_TEXT_TOP $(TEXT_TOP)
!define MUI_DIRECTORYPAGE_TEXT_DESTINATION $(TEXT_DESTINATION)
!define MUI_PAGE_CUSTOMFUNCTION_PRE ConfPath

!insertmacro MUI_PAGE_DIRECTORY



thank you
louzorios is offline   Reply With Quote
Old 21st October 2011, 17:51   #2
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
GetDlgItem $0 $HWNDPARENT 1
EnableWindow $0 1
MSG is offline   Reply With Quote
Old 24th October 2011, 10:01   #3
louzorios
Junior Member
 
Join Date: Oct 2011
Posts: 6
Thank you for the reply. I tried your proposition but it does not work. i inserted it in the function "confpath" like that:

Function ConfPath
GetDlgItem $0 $HWNDPARENT 1
EnableWindow $0 1
FunctionEnd

the "next button" remains disabled
louzorios is offline   Reply With Quote
Old 24th October 2011, 11:10   #4
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
In the pre function the page isn't created yet, so there's nothing to enable/disable. You must do it in the show function.

But keep in mind that the DIRECTORY page automagically enables/disables the Next button depending on free HDD space, valid path, etc. So it'll override your enabling anyway. You can probably use .onVerifyInstDir to force it enabled.


Edit: Actually, there's a much easier way to do this. MUI_DIRECTORYPAGE_VERIFYONLEAVE.
MSG is offline   Reply With Quote
Old 25th October 2011, 19:39   #5
louzorios
Junior Member
 
Join Date: Oct 2011
Posts: 6
thank you very much.it works.
louzorios 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