Old 9th February 2008, 18:45   #1
********
Junior Member
 
Join Date: May 2004
Posts: 43
Can't disable Next/Install on directory page

I need to disable Next/Install button on directory page to make additional checks for specific files required for installation. User should not be able to see enabled Install button until correct directory is chosen.

I disable Next button in pre-, show- and leave- functions of directory page, but it becomes visible again as soon as function exits. Are there any workarounds? Can it be fixed in next release?

PHP Code:

OutFile 
"test.971.exe"

Page directory "" makeDisabled checkFiles
Page instfiles

Function makeDisabled
  GetDlgItem 
$0 $HWNDPARENT 1 # next/install button
  
EnableWindow $0 1
  MessageBox MB_OK 
"$0"
FunctionEnd


Function checkFiles
  GetDlgItem 
$0 $HWNDPARENT 1 # next/install button
  
EnableWindow $0 0
  MessageBox MB_OK 
"$0"
  
Abort
FunctionEnd


Section
DetailPrint $INSTDIR
SectionEnd 
******** is offline   Reply With Quote
Old 9th February 2008, 18:52   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
That's what the .onVerifyInstDir callback function is for. Just call Abort from it and the Next button will be disabled for you.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 10th March 2008, 11:26   #3
********
Junior Member
 
Join Date: May 2004
Posts: 43
Thanks!
******** 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