I had to do a similar thing recently due to a plug-in we'd outsourced for development. It is possible to do in MSI but as Bob says it will only work for the user running the uninstall which for your average non-commercial user is fine but it's liable not to work for everyone else as the user installing or uninstalling your MSI can quite often be someone who will never use your software. I ended up modifying the plug-in code to use a directory in C:\Documents and Settings\All Users\Application Data\ (aka CommonAppDataFolder) rather than C:\Documents and Settings\user.name\Application Data\ (aka AppDataFolder) for it's temporary files as then I can make my MSI do whatever I need to those files on install/upgrade/reinstall/uninstall etc.
My current code looks something like this: <?xml version="1.0" encoding="UTF-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <Fragment> <DirectoryRef Id="CommonAppDataFolder"> <Directory Id="TempDir" Name="TempDir"> <Component Id="TempDir" DiskId="1" Guid="myguid"> <RemoveFile Id="CleanTempDir" Name="*" On="both"/> <RemoveFolder Id="RemoveTempDir" On="both"/> </Component> </DirectoryRef> </Fragment> </Wix> You can change the DirectoryRef from "CommonAppDataFolder" to "AppDataFolder" but you'll need to add RegistryValue's to your Components as Keypaths to pass ICE validation & as noted by Bob this only works for the current user running the uninstall, not all users who have ran your software which is fine if your software is a per-user install but not if it is a per-machine install. It's one of those "setup driven development" things that Rob M talks furiously about (see http://msdn.microsoft.com/en-us/library/aa302186.aspx if you've never heard of this) Palbinder Sandher Software Deployment and IT Administrator T: +44 (0) 141 945 8500 F: +44 (0) 141 945 8501 http://www.iesve.com **Design, Simulate + Innovate with the <Virtual Environment>** Integrated Environmental Solutions Limited. Registered in Scotland No. SC151456 Registered Office - Helix Building, West Of Scotland Science Park, Glasgow G20 0SP Email Disclaimer -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bob Arnson Sent: 04 September 2008 03:50 To: General discussion for Windows Installer XML toolset. Subject: Re: [WiX-users] Removing User Generated Files Daniel Newmarch wrote: > I have a working WiX installer, which is pretty plain, just > installs/uninstalls files. However, the application that it installs > creates data in the users My Documents and Local Settings\Application > Data when it is run, and I have been asked to remove this data on > uninstall. I was wondering if anybody could tell me firstly whether > it's possible to remove known folders under these paths for each user > of the system, and if it is possible how I could do it? > It's not possible to remove files for all users, only for the user doing the uninstall. (Even running as admin, the installer doesn't necessary have rights to the files in other users' profiles. So MSI doesn't offer the option.) -- sig://boB http://joyofsetup.com/ ------------------------------------------------------------------------ - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users