Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 24th October 2008, 06:50   #1
shahil
Junior Member
 
Join Date: May 2008
Posts: 34
Send a message via Yahoo to shahil
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.
shahil is offline   Reply With Quote
Old 24th October 2008, 09:33   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,775
!insertmacro un.DirState
${un.DirState} ...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 24th October 2008, 11:54   #3
shahil
Junior Member
 
Join Date: May 2008
Posts: 34
Send a message via Yahoo to shahil
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

=====================================================
shahil is offline   Reply With Quote
Reply
Go Back   Winamp 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