cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
hjsunj
Level 6

How to delete user-files in an uninstallation?

In a basic msi project, how to add support to delete user-files(typically stored in CSIDL_LOCAL_APPDATA)
Labels (1)
0 Kudos
(3) Replies
KathyMorey
Level 10

If you don't need to confirm with or notify the user, you can probably use the RemoveFile table.

Otherwise, you'll probably have to write a custom action of some sort.
0 Kudos
hjsunj
Level 6

thx, and how to use the RemoveFile table? can you give an example?
0 Kudos
vijayakumar
Level 6

For Instance, you would require to delete a file named "test_file.txt", follow the steps below:
1. Go to Direct Editor -> RemoveFile Table.
2. Clik on the empty row to add a new entry
3. The first column 'FileKey' enter any unique value or leave it default(it generates a unique value)
4. In the 'Component_' column, choose the component which is associated with ur file.
PS : The file gets removed when this component is removed. If u have any doubts in choosing the component, choose the component which contains the main exe file.
5. In the 'FileName' column, give the file name you want to delete. If u required to delete multiple file, u can also use '*.txt' like that.
6. If u want to delete the file during uninstall set the value in 'InstallMode' columd to 2.

Hope this helps.
0 Kudos