Archive: "Install" button disabled after verifying directory


"Install" button disabled after verifying directory
I am an NSIS newbie and am stuck. All help appreciated. My NSI file has just a few additions to an example that came with the NSIS distribution, but the "Install" button is now greyed out after I select the target directory.
The entire code of the NSI file is appended below-- quite short. I want the user to select the drive which happens to be assigned to the iPod, I want to verify that this drive is the right one, and I want to set the $INSTDIR (or $OUTDIR) to the "\Notes" folder on that drive. Is there something elementary I am screwing up? I have indeed read the manual and searched this forum, but to no avail. Thanks for any help. BTW, if I hard code the path (e.g.
SetOutPath "F:\Notes\"
it works just fine.
Alan Zaitchik
+========================================+

; The name of the installer
Name "az1"
; The file to write
OutFile "az1.exe"
; Select and verify installation directory
DirText 'Be sure that your iPod is connected to your computer and appears as an external drive.' 'If you are not sure which drive is your iPod,\r\ncheck to see which drive has the file "._iPod_Control" and a "Notes" folder on it.' 'Browse' 'Select the drive letter for your iPod. The installation will not continue unless a valid drive is selected.'
InstallDir ""
InstallButtonText "Continue"
Var /GLOBAL ipod_drive
Var /GLOBAL notes_dir

Function .onVerifyInstDir
IfFileExists $INSTDIR\._iPod_Control PathGood
Abort
PathGood:
StrCpy $ipod_drive $INSTDIR
StrCpy $notes_dir "\Notes\"
StrCpy $INSTDIR $ipod_drive$notes_dir
FunctionEnd
;--------------------------------
; Pages
Page directory
Page instfiles
;--------------------------------
; The stuff to install
Section "" ;No components page, name is not important
SetOutPath $INSTDIR
File az1.nsi ;for testing
SectionEnd ; end the section


See NSIS manual about AllowRootDirInstall,

http://nsis.sourceforge.net/Docs/Chapter4.html#4.8.1.2

Provided that ._iPod_Control is a valid file name, this should work,

!define NOTES_DIR "Notes"
InstallDir ""
InstallButtonText "Continue"
AllowRootDirInstall true

Function .onVerifyInstDir
IfFileExists $INSTDIR\._iPod_Control PathGood
MessagrBox MB_OK|MB_ICONSTOP "Bad path"
Abort
PathGood:
;StrCpy $ipod_drive $INSTDIR
;StrCpy $notes_dir "\Notes\"
StrCpy $INSTDIR "$INSTDIR\${NOTES_DIR}"
FunctionEnd
;--------------------------------
; Pages
Page directory
Page instfiles
;--------------------------------
; The stuff to install
Section "" ;No components page, name is not important
SetOutPath "$INSTDIR"
File az1.nsi ;for testing
SectionEnd ; end the section


PS Of course you can make a bit more pro looking. e.g. you may use ${GetDrives} http://nsis.sourceforge.net/Docs/AppendixE.html#E.1.5 in function .onInit to find the drive with the file ._iPod_Control and add it in $INSTDIR

Thank you very much!
Dear Red Wine,
I was able to get it working based on your help. In the end I changed some of the specific testing to make sure it is the iPod in the selected drive, but you got me over the hump! Thanks so much.
Alan