Skip to content
⌘ NSIS Forum Archive

Uninstall all files and folder

7 posts

pegase06#

Uninstall all files and folder

Hello,

I use this command for install the application :

File /r "C:\Files_to_install\*"
My script is use to compile some project.

My problem is to uninstall.

How to uninstall all files and subfolder witch is in Files_to_install ?

Thanks.
pegase06#edited
Another question for the same problem, I use

FindFirst $R1 $R2 "c:\*"
I want to say if R2 is a file or a folder.

Function exists ?

If R2 is a file :

Delete "c:\$R2"
If R2 is a folder:

RMDir /r "c:\$R2"
Thanks.
kichik#
!include LogicLib.nsh
#...
${If} ${FileExists} "C:\$R2\*.*"
DetailPrint folder
${Else}
DetailPrint file
${EndIf}
pegase06#
Originally posted by kichik
!include LogicLib.nsh
#...
${If} ${FileExists} "C:\$R2\*.*"
DetailPrint folder
${Else}
DetailPrint file
${EndIf}
Thanks 🙂

But don't works if folder $R2 is empty ?