Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WiX v3.7 - How to remove file in uninstall that was created after installation

I'm creating an installer for a program using WiX. The program creates a log file and a .dat file in the program directory during the configuration process (after complete installation). How do I tell WiX to remove these files during the uninstallation process if they are not present during the installation process?

Any suggestions would be greatly appreciated.

like image 686
user2437443 Avatar asked Aug 31 '25 05:08

user2437443


1 Answers

One way is to define the problem out of existence by installing those files. That is, create and install an empty log file and a dat file—initialized to whatever empty or default is for it.

Another way is to put RemoveFile elements under the Component element that is most closely associated with the use those files (e.g., the program exe).


Are you sure you want writable files in the same directory as the program? Usually, programs are installed so that only administrators can change them. If the program uses data that any user can change to affect all users, the data would be stored under the ALLUSERS profile. And, data that a user can change that affects only that user would be stored under that user's profile.

When data is stored that way, it is a question as to when or even whether such data should be deleted. A user might want that data preserved for the next installation of the program even if the user doesn't know how the data is persisted.

like image 135
Tom Blodget Avatar answered Sep 04 '25 02:09

Tom Blodget