How to Make Sure InstallState Files Are Removed After Uninstall?

If you are building setup using Visual Studio and you have several custom actions and you noticed you see one or more .InstallState files in the target path after uninstall, most likely you have added your custom action to the Install custom action, but nothing else.

What you should do is to add the same custom action to the Uninstall custom action, those InstallState files will be gone.