Need WiX/difx driver upgrade to scan for new hardware

My .msi installer built using WiX works fine as long as my hardware has been detected. That is, I need to scan for new hardware BEFORE running the installer.

That’s fine, but if version of my driver is installed and I go to install version, I have it setup to uninstall previous versions first, then install the new version. The problem is that I need the installer to “scan for new hardware” after uninstalling the previous version and before installation of the new version. Otherwise the device has not been enumerated yet and the driver installation doesn’t pair up with the hardware.

Is my only option to create a standalone program doing something like this (, and call that program from a custom action in my installer?

How are other people getting around this problem? If this is too WiX specific feel free to tell me to piss off.

My .msi is an installer for my driver package. The driver installs a multiportserial adapter, which generates a bunch of children and each of their drivers gets loaded.

When I do an uninstall of my .msi from “Add or Remove Programs” all my COM ports get removed from the Device Manager as expected, but the ComDB value from the HKLM\SYSTEM\CurrentControlSet\Control\COM Name Arbiter doesn’t get updated appropriately.

So, let’s say I have an 8 port adapter that gobbles up COM3-10 during install. If I uninstall, then immediately reinstall, it gobbles up 11-18. If I don’t use the “uninstaller” and remove each port from device manager by hand, the ComDB get updated just fine.

Any ideas?