Uninstalling Files Created by the Application

Files that are installed as part of your InstallMate project are automatically removed from the customer's computer when your application is uninstalled. However, some applications create additional files after installation that should be removed as well. The current topic describes how to deal with these files.

Note - You should never remove the customer's documents, i.e., the files that your customer created and saved while working with your application – whether it be text documents, images, multi-media files, or whatever other kind of files your application is designed to manipulate. The current topic concerns only auxiliary files created and used by your application such as scratch files, caches, and perhaps configuration files.

Tip - InstallMate automatically removes certain files that are created by Windows on behalf of your application, for example:

You do not have to specify removal rules for these file types.

How to uninstall files created by your application

To specify files that must be removed when your application is uninstalled, even if they were not installed by InstallMate, act as follows.

  1. Select the Files and folders project page in the navigation panel on the left.
  2. Decide in which folders your application creates the files that must be uninstalled. Do NOT use hard-coded paths such as C:\Program Files\MyApp, but find the appropriate folder in the folders tree.
  3. If necessary, create the required folders by right-clicking on the parent folder, then choosing New Folder or New Special Folder.
  4. Right-click on the installation folder of your choice, then choose New File.
  5. Adjust the settings of the newly created file as follows:

    • Source path - (leave empty)
    • Install name - Enter the name of the file that must be removed. Do not enter a full path; only specify the file name proper (the path is taken care of by the installation folder in which the file resides). If you want to use wildcard patterns, then enter the pattern here.
    • Install action - Set to Do not install.
    • Remove action - Set to Remove always.
    • Registration - Set as appropriate. In most cases, you should select No self-registration because your application probably does not register this kind of file. For wildcard patterns, set this to No self-registration.
    • Shared file - Check or clear as appropriate. In most cases, you should clear this option because your application probably does not set the SharedDlls reference count for this kind of file. For wildcard patterns, clear this box.
    • Keep during updates - Check this box to ensure that files are not removed if the application is merely updated, and not removed completely.
    • No rollback - Check this box if you are using a wildcard pattern; leave it cleared otherwise.
    • Leave all other file attributes as-is.
  6. You may have to associate the new file with a component (right-click on the file, then select Assign to Component) if the file is associated with a particular feature of your product.
  7. Repeat steps 4-6 as required for other files.

Wildcard file specification

If you need to remove a variable number of files, the names of which you do not know in advance, you can use wildcards in the Install name specification in step 5. For example, to remove all backup files during uninstallation, specify *.bak. This is subject to the following restrictions: