Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Problem with path valid (http://forums.winamp.com/showthread.php?t=258676)

Nastasia 31st October 2006 13:52

Problem with path valid
 
Hello!

I have a problem with vaidation of path. I use 'Modern UI' and I want to disable "Next" button if Destination Folder is empty or not exist.
I try to use .onVerifyInstDir function, but it doesn't work correctly.
For example, I wrote:

Function .onVerifyInstDir
StrCmp $INSTDIR "" 0 +2
Abort
FunctionEnd

and empty field didn't produce Next button disabled

May be, you know, what's a problem?

Animaether 31st October 2006 14:17

odd... ModernUI should already disable the Next button if the field is an empty string.

edit: whoops, totally misread that. ignore earlier sample code %)

Edit: here we go, new sample code:

code:

!include "MUI.nsh"
!include "LogicLib.nsh"

Name "Modern UI Test"
OutFile "Basic.exe"

!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES

!insertmacro MUI_LANGUAGE "English"

Section "Dummy Section 1" SecDummy

SectionEnd

Function .onVerifyInstDir
IfFileExists "$INSTDIR\*.*" +2
Abort
FunctionEnd


Nastasia 31st October 2006 16:13

I tried so, but the same was
May be it is from using MUI_DIRECTORYPAGE_TEXT_DESTINATION instead of MUI_PAGE_DIRECTORY in my code?

I have in my code:

; Directory page
;------------------------------
!verbose push
!verbose ${MUI_VERBOSE}
!insertmacro MUI_PAGE_INIT
!insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}DIRECTORYPAGE
!insertmacro MUI_DEFAULT MUI_DIRECTORYPAGE_TEXT_TOP ""
!insertmacro MUI_DEFAULT MUI_DIRECTORYPAGE_TEXT_DESTINATION ""

PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}directory
PageCallbacks MyFuncPre MyFuncShow MyFuncLeave
Caption " "
DirText "${MUI_DIRECTORYPAGE_TEXT_TOP}" "${MUI_DIRECTORYPAGE_TEXT_DESTINATION}"
DirVerify leave
PageExEnd

!undef MUI_DIRECTORYPAGE_TEXT_TOP
!undef MUI_DIRECTORYPAGE_TEXT_DESTINATION
!insertmacro MUI_UNSET MUI_DIRECTORYPAGE_VARIABLE
!insertmacro MUI_UNSET MUI_DIRECTORYPAGE_VERIFYONLEAVE
!verbose pop
;-------------------------------------

Nastasia 31st October 2006 16:36

I understand something -
'DirVerify leave' parameter denied to involve the validation. It's necessarily to turn off it :)


All times are GMT. The time now is 04:33.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.