Archive: DirState problem


DirState problem
i want to determin whether a directory is empty or not.
i am using DirState
============= part of code =============================

!include LogicLib.nsh
!include FileFunc.nsh
!insertmacro DirState
Var Is_Empty

Section Uninstall
${DirState} "$SMPROGRAMS\FQR\" $Is_Empty
${If} $Is_Empty == 0
Delete "$SMPROGRAMS\FQR\"
${EndIf}
SectionEnd

=====================================================

the compiler is giving me the following error:-

!insertmacro: DirStateCall
Call must be used with function names starting with "un." in the uninstall section.
Usage: Call function_name | [:label_name]
Error in macro DirStateCall on macroline 4
Error in script "D:\MSL\GM Debug\GM_Debug.nsi" on line 2304 -- aborting creation process


======================================================

any help is highly appreciated.


!insertmacro un.DirState
${un.DirState} ...


thanks brother.

so the corrected code is:-

============= part of code =============================

!include LogicLib.nsh
!include FileFunc.nsh
!insertmacro un.DirState
Var Is_Empty

Section Uninstall
${un.DirState} "$SMPROGRAMS\FQR\" $Is_Empty
${If} $Is_Empty == 0
Delete "$SMPROGRAMS\FQR\"
${EndIf}
SectionEnd

=====================================================