Skip to content
⌘ NSIS Forum Archive

Un-installer: Possible to delete *.* but leave ONE file?

7 posts

cjs#

Un-installer: Possible to delete *.* but leave ONE file?

I am trying to leave one file when un-installing the "install" line looks like:
file "p:\micad\*.mdb"

^^ this line adds alot of mdb files, typing out each one manually would waste alot of time

I need to leave one particular .mdb file

I tried SETFILEATTRIBUTES readonly

but the uninstaller still wipes the file.
any help?

Thanks.
-chris
kichik#
You can find the files one by one using FindFirst, FindNext and FindClose. If the file's name isn't the one you want to keep, delete it.
cjs#
I know what the files name is, but is there an EXCLUDE option for keeping one file whilst deleting all others?
mrtech#
you can also try moving the file to your temp directory, deleting everything and then putting it back.

Just an idea?
rsegal#
I'm creating a program to do something very similar for the installer. You can read details on it here.

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.


I'll look into writing an equivalent uninstaller version as well.
Jay#
possibly a quicker way would be to open the file in question and then delete the contents of the directory then close the file in question.

Haven't tried this myself though.