Old 31st October 2006, 13:52   #1
Nastasia
Junior Member
 
Join Date: Oct 2006
Posts: 7
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?
Nastasia is offline   Reply With Quote
Old 31st October 2006, 14:17   #2
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
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

Animaether is offline   Reply With Quote
Old 31st October 2006, 16:13   #3
Nastasia
Junior Member
 
Join Date: Oct 2006
Posts: 7
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 is offline   Reply With Quote
Old 31st October 2006, 16:36   #4
Nastasia
Junior Member
 
Join Date: Oct 2006
Posts: 7
I understand something -
'DirVerify leave' parameter denied to involve the validation. It's necessarily to turn off it
Nastasia 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