Problem: Application remnants remain after uninstall.

After uninstalling a particular MSI some remnants remain of the application files in the ProgramFiles folder.

Reason: Application is updated in situe.

The application is a standard client/server setup with application updates being applied to the server which then disseminate to all clients which means files are present on the client that weren't put there by the MSI itself. Natively an MSI will only remove files that were installed by itself...............or if they've been added to the removefiles table, however we have no idea of the name of the files that will need to be removed so we need a catch all solution.

Fix: Script the removal of the folder during uninstall.

I decided on a vbscript in a custom action to the remove the folder and all it's contents, triggered when the application is uninstalled.


Create a VBScript Custom Action that is stored within the CA and complete as per below, you can find the VBScript here.

*Action*  
Return Processing
Synchronous (Check exit code)
In-Script Execution Deferred Execution in System Context
Key Installer\Products\<GUID>
Name Transforms
Component ISRegistryValue
*Sequence* - Install Exec After RemoveFolders
Install Exec Condition
REMOVE="ALL"