Archive: Uninstall of multiple $APPDATA directories


Uninstall of multiple $APPDATA directories
I'm assuming this may be a fairly common requirement, but I haven't found any mention of it anywhere...

I have an application that creates directories under the users $APPDATA directory (for multi-user support). This means that if Tom, Dick and Harry have use the application under their own logins, there will be a directory structure like so:

C:\Documents and Settings\Tom\Application Data\Foo
C:\Documents and Settings\Dick\Application Data\Foo
C:\Documents and Settings\Harry\Application Data\Foo

...where Foo is the name of the app.

So what is the cleanest way to remove these directories on uninstall?

Should I just remove "C:\Documents and Settings\*\Application Data\Foo"? Or is that just bad form?

Currently I am writing (one of) the user settings dir to the uninstall section of the registry and reading it back, but really I need to write the all. I could make an APPDIR key that contains them all like:

"C:\Documents and Settings\Tom\Application Data\Foo;C:\Documents and Settings\Dick\Application Data\Foo;C:\Documents and Settings\Harry\Application Data\Foo"

...but am I likely to run into limitations of the length of strings the registry can hold? And is there an easy way to split the string on ; in NSIS?

Thanks in advance for any help,

Michael


"C:\Documents and Settings\*\Application Data\Foo" is not a valid syntax and will also remove stuff from directories you have not used (if someone would use the same name).

Writing it into multiple registry keys would be the best solution. Why should it be all in one key?


Originally posted by Joost Verburg
Writing it into multiple registry keys would be the best solution. Why should it be all in one key?
Mainly because I don't know how to do it in NSIS (short of writing a plugin). Is there an example of an easy way to read an arbitrary sized bunch of registry strings and then remove them?


Thanks for the reply.

Zilch

You don't have to write a plug-in.

One solution would be to use numbers: key 1 contains folder 1, key 2 contains folder 2 etc.