Skip to content
⌘ NSIS Forum Archive

"Remve all files in directory" question

3 posts

querschlaeger#

"Remve all files in directory" question

Hi,

how can I get such a uninstall-question in my uninstaller:



This question should only appear if there are 'user-created files' (which not includes in the default-installation) in the $INSTDIR.
Davion#
You just have to define a Message box with a text like this
and depending on the Answer you delete the files or not



MessageBox MB_YESNO "Would you like to delete all Files in the Folder?" IDNO done
delete:
RMDir /r "$INSTDIR/Folder"
done:

hope this helps

greetz, Dave
evilO#
Hi querschlaeger 🙂

Well actually the solution posted by Davion does not suit your needs, as "RMDIR /r" will remove *all* the files from the specified directory.

In order to remove specifically the files installed, and not the files created by the user, you'll have to write some code to 'log' the installed files into an 'ini' file, and then a function that go through this list to remove each 'logged' file.

You can check this thread for more info:

Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.



Good luck 🙂

evilO/Olive