joost
Posts: 3
Joined: Fri Apr 26, 2013 10:31 am

Uninstall fails when SETUPEXEDIR is not available

Thu May 30, 2013 9:28 am

Hi all,

In our installer we use a File Copy/Move operation to copy files that reside next to our setup.exe to the installation folder. Following the How To "How do I install a user specific file?" we created a property SETUPEXEDIR (that gets filled by the EXE bootstrapper) and create a property-based folder from it. This folder is the source directory of the File Copy/Move operation.

This works as expected, until you try to uninstall the program and the original location where setup.exe was is not available anymore (CD-ROM removed, network location unavailable, etc.). Then you get a message during uninstall that the location is not available and Windows Installer stops without doing anything.

When searching these forums for a solution, I only found solutions with custom actions replacing the File Copy/Move operation. But the true problem is not in the File Copy/Move operation, but in the property-based folder. During uninstall Windows Installer will search for all directories in the CreateFolder table of the MSI to be able to remove them when they're empty. Uninstall will fail if any of these directories can't be found.

The solution I used: locate the SETUPEXEDIR component in the Organization section and check the "Do not register this component with Windows Installer" checkbox. Now Windows Installer won't register this component and thus won't look for it during uninstall. Problem solved!

Return to “Common Problems”