I am using WiX 3.6 to create an msi that copies a few exe’s and dll’s, installs a number of windows services and adds and deletes a few registry entries.
WiX is brilliant and using it’s built in features and custom actions in an associated .net managed dll I have been able to do everything I need to very easily.
One annoying problem has recently started happening though.
Installs proceed with no errors and do exactly what I expect, but when I uninstall, either from the Program Features control panel, or from a command line, the product entry remains in the Program Features list. All other files, services and folders are removed as expected, and the uninstall completes with no errors reported!
If I run the uninstall a second time, the Program Features entry is removed!
I have used verbose logging of the install and uninstall and viewed both through the Windows Installer Verbose Log Analyzer from the platform SDK, and it reports no errors.
I am puzzled!
I am sure it was uninstalling correctly before, but I cannot identify what I have done to make it start exhibiting this behaviour.
Any ideas would be appreciated.
PS I am running on Windows 7 64 bit machine, and generating a 32 bit installer.
PPS Log is too big to include here. Can anyone advise which entries I need to look at that controls the removal of the entry from the Program Features list?
Further clarification;
I had already checked the link from Christopher’s answer below, but the situation did not match mine.
After the first uninstall, the entry disappears from the Program Features list but reappears in the list if it is refreshed or exit the control panel and come back to it. The registry entry is still present (I have checked) and so this is why it still appears in the list.
The second uninstall removes the entry from the registry, and thus from the list too.
I have retraced the changes I have made to the msi recently and have discovered the change I made that caused the uninstall to behave strangely.
I created a feature that deletes a few old registry entries, and I only needed to do that during the initial install, so I put a condition on the feature as follows;
If I have no condition, the msi installs and uninstalls as expected.
With the above condition, it installs correctly and deletes the registry keys, but the uninstall leaves the entry in Add Remove Programs and I need to uninstall again to remove it fully.
If I use the following condition, the msi installs and uninstalls as expected;
I didn’t cater for the uninstall initially because I don’t need to do anything on uninstall with these registry keys. Although this fixes the issue I had, I don’t understand why the first condition not evaluating to 1 causes the msi not to uninstall as expected, but I guess that is another question…
See the MSDN topic Condition Table (Windows) (Remarks Section)