Delete application r/w data on uninstall

H

- HAL9000

When un-installing an application...

Is it normal practice to write a special program that erases all the
files and folders for all the users of an application that reads and
writes to SpecialFolder.ApplicationData (C:\Documents and
Settings\Username\Application Data) ?

Or, is there some way to get the ms installer to do this for you?

Is there some way to use Application.UserAppDataPath to ease finding
all the folders that might need to be erased?

Thanks...
 
M

Michael Nemtsev

Hello - HAL9000,

Hadn't the standard installers do it for u?

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

-> When un-installing an application...
->
-> Is it normal practice to write a special program that erases all the
-> files and folders for all the users of an application that reads and
-> writes to SpecialFolder.ApplicationData (C:\Documents and
-> Settings\Username\Application Data) ?
->
-> Or, is there some way to get the ms installer to do this for you?
->
-> Is there some way to use Application.UserAppDataPath to ease finding
-> all the folders that might need to be erased?
->
-> Thanks...
->
 
H

- HAL9000

Installing is not the problem. The problem is uninstalling.

If one writes a file to the SpecialFolder.ApplicationData folder (a
folder created by the installer) then the uninstaller will not delete
the installer created folder. That is, if the folder is empty then
the folder will be deleted by the uninstaller. If the folder is not
empty then the folder will *not* be deleted by the installer.

Of course the file contains needed per user persistent data.

Further, because of multiple users, an application has no way of
easily iterating through all users of a machine to delete the above
mentioned (application) files.

Best I can tell, one has to deduce the SpecialFolder.ApplicationData
paths of all the users that might have used the (installed)
application.

For example, one has to go through and delete all files in these
paths.

C:\Documents and Settings\UserJohn\Application Data\MyAppName\*.*
C:\Documents and Settings\UserFred\Application Data\MyAppName\*.*
C:\Documents and Settings\UserMary\Application Data\MyAppName\*.*

at uninstall - by a special program.
 
M

Michael Nemtsev

Hello - HAL9000,

So, you need the Custom action into your installer, which remove all custom
files, so the installer could remove the folder

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

-> Installing is not the problem. The problem is uninstalling.
->
-> If one writes a file to the SpecialFolder.ApplicationData folder (a
-> folder created by the installer) then the uninstaller will not delete
-> the installer created folder. That is, if the folder is empty then
-> the folder will be deleted by the uninstaller. If the folder is not
-> empty then the folder will *not* be deleted by the installer.
->
-> Of course the file contains needed per user persistent data.
->
-> Further, because of multiple users, an application has no way of
-> easily iterating through all users of a machine to delete the above
-> mentioned (application) files.
->
-> Best I can tell, one has to deduce the SpecialFolder.ApplicationData
-> paths of all the users that might have used the (installed)
-> application.
->
-> For example, one has to go through and delete all files in these
-> paths.
->
-> C:\Documents and Settings\UserJohn\Application Data\MyAppName\*.*
-> C:\Documents and Settings\UserFred\Application Data\MyAppName\*.*
-> C:\Documents and Settings\UserMary\Application Data\MyAppName\*.*
->
-> at uninstall - by a special program.
->
-> On Fri, 25 May 2007 19:47:54 +0000 (UTC), Michael Nemtsev
-> said:
Hello - HAL9000,

Hadn't the standard installers do it for u?

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/
"The greatest danger for most of us is not that our aim is too high
and we miss it, but that it is too low and we reach it" (c)
Michelangelo

-> When un-installing an application...
->
-> Is it normal practice to write a special program that erases all
the
-> files and folders for all the users of an application that reads
and
-> writes to SpecialFolder.ApplicationData (C:\Documents and
-> Settings\Username\Application Data) ?
->
-> Or, is there some way to get the ms installer to do this for you?
->
-> Is there some way to use Application.UserAppDataPath to ease
finding
-> all the folders that might need to be erased?
->
-> Thanks...
->
 
H

- HAL9000

Thanks for your help.

Right, I'm going down that path now - custom uninstall action. I was
hoping there was an easier way which is why I asked.

It just seems as though the installer creating folders for me is
useless if I always have to manually delete them (at least the files
in the folders) on uninstall.


Hello - HAL9000,

So, you need the Custom action into your installer, which remove all custom
files, so the installer could remove the folder

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

-> Installing is not the problem. The problem is uninstalling.
->
-> If one writes a file to the SpecialFolder.ApplicationData folder (a
-> folder created by the installer) then the uninstaller will not delete
-> the installer created folder. That is, if the folder is empty then
-> the folder will be deleted by the uninstaller. If the folder is not
-> empty then the folder will *not* be deleted by the installer.
->
-> Of course the file contains needed per user persistent data.
->
-> Further, because of multiple users, an application has no way of
-> easily iterating through all users of a machine to delete the above
-> mentioned (application) files.
->
-> Best I can tell, one has to deduce the SpecialFolder.ApplicationData
-> paths of all the users that might have used the (installed)
-> application.
->
-> For example, one has to go through and delete all files in these
-> paths.
->
-> C:\Documents and Settings\UserJohn\Application Data\MyAppName\*.*
-> C:\Documents and Settings\UserFred\Application Data\MyAppName\*.*
-> C:\Documents and Settings\UserMary\Application Data\MyAppName\*.*
->
-> at uninstall - by a special program.
->
-> On Fri, 25 May 2007 19:47:54 +0000 (UTC), Michael Nemtsev
-> said:
Hello - HAL9000,

Hadn't the standard installers do it for u?

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/
"The greatest danger for most of us is not that our aim is too high
and we miss it, but that it is too low and we reach it" (c)
Michelangelo

-> When un-installing an application...
->
-> Is it normal practice to write a special program that erases all
the
-> files and folders for all the users of an application that reads
and
-> writes to SpecialFolder.ApplicationData (C:\Documents and
-> Settings\Username\Application Data) ?
->
-> Or, is there some way to get the ms installer to do this for you?
->
-> Is there some way to use Application.UserAppDataPath to ease
finding
-> all the folders that might need to be erased?
->
-> Thanks...
->
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top