Hi, As some of you have probably noticed, there has been some discussion recently regarding problems with DIFxApp causing rollbacks. I did some more investigation and was able to reliably reproduce the issue and come up with a very good idea on what is causing the problem. All investigation was done with the version of DIFxApp included with Windows DDK version 7600.16385.1; note that this will also reproduce with the version included with WiX 3.0 / 3.5. It was done on a clean Windows XP SP2 virtual machine with .NET Framework 2.0; however we have observed the same problems on Windows 7.
As far as I can tell, this is a bug in the DIFxApp DLLs and/or the WiX extension for DIFxApp. If anyone knows some good workarounds, or how to report this to the proper channels and get it fixed it would be much appreciated! From what I can tell, there exist situations in any DIFxApp setup program doing an upgrade where if the user cancels the setup at a certain point (or there is an error in the installation of the new product) then the user's system will be hosed and they would be unable to uninstall the product without some involved technical support. If the bug can't be fixed or worked around, I don't see how DIFxApp is suitable for use in a commercial product that needs to support upgrades (i.e. all products). And since DIFxApp isn't open source, I can't go in and just fix the problem. Very frustrating! The problem is that DIFxApp does not restore the system to a correct state after a failed major upgrade when installing the new product/driver. The following sequence of events on a product will reproduce the problem when doing a major upgrade: 1. RemoveExistingProducts action is started to uninstall the old product. The following actions run in the context of uninstalling the old version of the product/driver. 2. MsiProcessDrivers runs to schedule the MsiUninstallDrivers action. 3. MsiUninstallDrivers runs and successfully removes the old driver from the computer. 4. MsiCleanupOnSuccess runs and does its cleanup tasks. 5. RemoveExistingProducts action is completed successfully. The following actions run in the context of installing the new version of the product/driver: (note that at this point the system has been completely purged of the old driver) 6. MsiProcessDrivers runs and schedules the driver installation. 7. MsiInstallDrivers runs to install the new driver. Suppose this new driver installation is NOT successful. In this example, an unsigned driver was used and so the user was asked whether or not to install it. The user declines. 8. The setup is now in a failing state because MsiInstallDrivers wasn't able to load the new driver. 9. MsiRollbackInstall runs but does nothing since the new driver wasn't installed. 10. The setup concludes by continuing to rollback all other changes (installed files, etc.). The old version of the product is now supposedly in place as it was before, since canceling a Windows Installer setup should roll back all changes that were made since the start of setup. 11. At this point, DIFxApp should run MsiInstallDrivers again to install the old driver that was previously uninstalled, but it does not. At this point, DIFxApp should have restored the old version of the driver as part of a rollback. Unfortunately, it does not. The resulting state of the DIFx portion of the computer is as if an uninstall had been performed. No DIFxApp keys exist in the registry for the old driver, even though the old version of the product is still installed. The old driver is not in the driver store, either. This results in a frustrating experience for the user when they try to uninstall. The MsiUninstallDrivers requires the presence of DIFxApp registry keys for the component in the registry and when it does not find these, it results in an error and a failed uninstall. Also, because the system is in an incomplete state, the user isn't able to use the hardware device either, since the driver was uninstalled and never restored as part of the rollback. While signing the driver would have obviously "fixed" the problem in this case, this is not the root problem. The root problem is that DIFxApp does not install the old driver as part of a rollback when the installation of the new product fails. For example, merely clicking the "Cancel" button at any time after RemoveExistingProducts has completed will reproduce the problem. This was tested and reproduced by canceling setup after the DIFxApp registry keys were removed by the uninstallation of the old product (by constantly pressing F5 to refresh in Registry Editor). After the upgrade setup was canceled at that point, I was unable to uninstall the old product. I have included excerpts from the MSI log file taken during the major upgrade, as shown below. I also showed the log file entry that shows up when trying (and failing) to uninstall the old product. Notes on reading the log: * Some information was sanitized; for example the GUID of the driver component is shown as "{driver component GUID}" because I removed the actual GUID from this public e-mail list. * Large portions of the log file were removed; only relevant data was included. Line numbers are sometimes indicated as "Line XYZ:". * If lines were removed, this is indicated by "<.hundreds of lines.>" Best regards, James Johnston Log files below. Attempts to uninstall after upgrade: DIFXAPP: ERROR 0x2 encountered while opening persistent-info key for component '{driver component GUID}' DIFXAPP: UninstallDriverPackages failed with error 0x2 DIFXAPP: RETURN: UninstallDriverPackages() 2 (0x2) Upgrade: Line 226: Action start 22:26:17: RemoveExistingProducts. <.hundreds of lines.> Action 22:26:22: MsiProcessDrivers. Action start 22:26:22: MsiProcessDrivers. DIFXAPP: ENTER: ProcessDriverPackages() DIFXAPP: INFO: 'Component' is 'MyDriverComponent' DIFXAPP: INFO: Component state 0x3 -> 0x2 DIFXAPP: INFO: 'ComponentId' is {driver component GUID} DIFXAPP: INFO: 'Flags' is 10 DIFXAPP: INFO: component path is DIFXAPP: INFO: user SID of user performing the install is 'S-1-5-21-1644491937-2147298945-839522115-1003'. DIFXAPP: INFO: creating HKEY_USERS\S-1-5-21-1644491937-2147298945-839522115-1003\Software\Microsoft\ Windows\CurrentVersion\DIFxApp\Components\{driver component GUID} (User's SID: 'S-1-5-21-1644491937-2147298945-839522115-1003') ... Action 22:26:22: MsiUninstallDrivers. Action start 22:26:22: MsiUninstallDrivers. MsiUninstallDrivers: Action ended 22:26:22: MsiUninstallDrivers. Return value 1. DIFXAPP: RETURN: ProcessDriverPackages() 0 (0x0) Line 460: Action ended 22:26:22: MsiProcessDrivers. Return value 1. <.hundreds of lines.> Action 22:26:28: MsiUninstallDrivers. DIFXAPP: UninstallDriverPackages() DIFXAPP: 'CustomActionData' property 'DIFxApp Version' is 2.1. DIFXAPP: 'CustomActionData' property 'UI Level' is 5. DIFXAPP: 'CustomActionData' property 'componentId' is {driver component GUID}. DIFXAPP: 'CustomActionData' property 'flags' is 0xA. DIFXAPP: 'CustomActionData' property 'ProductName' is My Product. DIFXAPP: 'CustomActionData' property 'ManufacturerName' is My Company. DIFXAPP: INFO: user SID of user performing the install is 'S-1-5-21-1644491937-2147298945-839522115-1003'. DIFXAPP: INFO: opening HKEY_USERS\S-1-5-21-1644491937-2147298945-839522115-1003\Software\Microsoft\ Windows\CurrentVersion\DIFxApp\Components\{driver component GUID} (User's SID: 'S-1-5-21-1644491937-2147298945-839522115-1003') ... DIFXAPP: INFO: ENTER: DriverPackageUninstallW DIFXAPP: INFO: Uninstalling driver package C:\WINDOWS\system32\DRVSTORE\productbus_some_big_guid_here\productbus.inf... DIFXAPP: INFO: Successfully removed 'C:\WINDOWS\INF\oem8.inf'. DIFXAPP: INFO: No devices found for C:\WINDOWS\system32\DRVSTORE\productbus_some_big_guid_here\productbus.inf uninstall. DIFXAPP: INFO: Driver store entry 'C:\WINDOWS\system32\DRVSTORE\productbus_some_big_guid_here\productbus.inf' removed. DIFXAPP: SUCCESS:Uninstall completed. DIFXAPP: INFO: RETURN: DriverPackageUninstallW (0x0) DIFXAPP: INFO: driver store 'C:\WINDOWS\system32\DRVSTORE\productbus_some_big_guid_here\productbus.inf' uninstalled. DIFXAPP: INFO: deleted add remove programs key for 'C:\WINDOWS\system32\DRVSTORE\productbus_some_big_guid_here\productbus.inf'. DIFXAPP: A reboot is not needed to uninstall the driver package '{driver component GUID}'. 2186: DIFXAPP: RETURN: UninstallDriverPackages() 0 (0x0) <.hundreds of lines.> Action 22:26:49: MsiCleanupOnSuccess. Action start 22:26:49: MsiCleanupOnSuccess. DIFXAPP: ENTER: CleanupOnSuccess() DIFXAPP: INFO: 'Component' is 'MyDriverComponent' DIFXAPP: INFO: 'ComponentId' is {driver component GUID} DIFXAPP: INFO: user SID of user performing the install is 'S-1-5-21-1644491937-2147298945-839522115-1003'. DIFXAPP: INFO: opening HKEY_USERS\S-1-5-21-1644491937-2147298945-839522115-1003\Software\Microsoft\ Windows\CurrentVersion\DIFxApp\Components\{driver component GUID} (User's SID: 'S-1-5-21-1644491937-2147298945-839522115-1003') ... DIFXAPP: RETURN: CleanupOnSuccess() 0 (0x0) 8765: Action ended 22:26:49: MsiCleanupOnSuccess. Return value 1. <.hundreds of lines.> 9332: Action ended 22:26:50: RemoveExistingProducts. Return value 1. Action 22:26:51: MsiProcessDrivers. Action start 22:26:51: MsiProcessDrivers. DIFXAPP: ENTER: ProcessDriverPackages() DIFXAPP: INFO: 'Component' is 'MyDriverComponent' DIFXAPP: INFO: Component state 0x2 -> 0x3 DIFXAPP: INFO: 'ComponentId' is {driver component GUID} DIFXAPP: INFO: 'Flags' is 10 DIFXAPP: INFO: component path is C:\Program Files\My Product\Product-CDM-Bus\ DIFXAPP: INFO: user SID of user performing the install is 'S-1-5-21-1644491937-2147298945-839522115-1003'. DIFXAPP: INFO: creating HKEY_USERS\S-1-5-21-1644491937-2147298945-839522115-1003\Software\Microsoft\ Windows\CurrentVersion\DIFxApp\Components\{driver component GUID} (User's SID: 'S-1-5-21-1644491937-2147298945-839522115-1003') ... Action 22:26:52: MsiRollbackInstall. Action start 22:26:52: MsiRollbackInstall. MsiRollbackInstall: Action ended 22:26:52: MsiRollbackInstall. Return value 1. Action 22:26:52: MsiInstallDrivers. Action start 22:26:52: MsiInstallDrivers. MsiInstallDrivers: Action ended 22:26:52: MsiInstallDrivers. Return value 1. DIFXAPP: RETURN: ProcessDriverPackages() 0 (0x0) 9402: Action ended 22:26:52: MsiProcessDrivers. Return value 1. <.hundreds of lines.> Action 22:27:14: MsiRollbackInstall. Action 22:27:14: MsiInstallDrivers. DIFXAPP: ENTER: InstallDriverPackages() DIFXAPP: INFO: 'CustomActionData' property 'DIFxApp Version' is '2.1'. DIFXAPP: INFO: 'CustomActionData' property 'UI Level' is '5'. DIFXAPP: INFO: 'CustomActionData' property 'componentId' is '{driver component GUID}'. DIFXAPP: INFO: 'CustomActionData' property 'componentPath' is 'C:\Program Files\My Product\Product-CDM-Bus\'. DIFXAPP: INFO: 'CustomActionData' property 'flags' is 0xA. DIFXAPP: INFO: 'CustomActionData' property 'installState' is '2'. DIFXAPP: INFO: 'CustomActionData' property 'ProductName' is 'My Product'. DIFXAPP: INFO: 'CustomActionData' property 'ManufacturerName' is 'My Company'. DIFXAPP: INFO: user SID of user performing the install is 'S-1-5-21-1644491937-2147298945-839522115-1003'. DIFXAPP: INFO: opening HKEY_USERS\S-1-5-21-1644491937-2147298945-839522115-1003\Software\Microsoft\ Windows\CurrentVersion\DIFxApp\Components\{driver component GUID} (User's SID: 'S-1-5-21-1644491937-2147298945-839522115-1003') ... DIFXAPP: INFO: ENTER: DriverPackageInstallW DIFXAPP: INFO: Copied 'productbus.inf' to driver store... DIFXAPP: INFO: Copied 'productbus.cat' to driver store... DIFXAPP: INFO: Commiting queue... DIFXAPP: INFO: Copied file: 'C:\Program Files\My Product\Product-CDM-Bus\i386\ftd2xx.dll' -> 'C:\WINDOWS\system32\DRVSTORE\productbus_some_big_guid_here\i386\ftd2xx.dll' . DIFXAPP: INFO: Copied file: 'C:\Program Files\My Product\Product-CDM-Bus\i386\FTLang.Dll' -> 'C:\WINDOWS\system32\DRVSTORE\productbus_some_big_guid_here\i386\FTLang.Dll' . DIFXAPP: INFO: Copied file: 'C:\Program Files\My Product\Product-CDM-Bus\i386\ftdibus.sys' -> 'C:\WINDOWS\system32\DRVSTORE\productbus_some_big_guid_here\i386\ftdibus.sys '. DIFXAPP: INFO: Copied file: 'C:\Program Files\My Product\Product-CDM-Bus\i386\ftbusui.dll' -> 'C:\WINDOWS\system32\DRVSTORE\productbus_some_big_guid_here\i386\ftbusui.dll '. DIFXAPP: WARNING:Skipping copy of file ftd2xx64.dll. File is referenced in productbus.inf but not listed in section . DIFXAPP: ERROR: Invalid signature. Possibly rejected by user. (Error code 0x800B0110: The certificate is not valid for the requested usage.) DIFXAPP: INFO: Removed driver package from store. DIFXAPP: INFO: Successfully removed '{driver component GUID}' from reference list of driver store entry '' DIFXAPP: INFO: RETURN: DriverPackageInstallW (0x800B0110) DIFXAPP: ERROR: encountered while installing driver package 'C:\Program Files\My Product\Product-CDM-Bus\productbus.inf' DIFXAPP: ERROR: InstallDriverPackages failed with error 0x800B0110 DIFXAPP: RETURN: InstallDriverPackages() 2148204816 (0x800B0110) Action ended 22:27:18: InstallFinalize. Return value 3. Action 22:27:18: Rollback. Rolling back action: Rollback: MsiInstallDrivers Rollback: MsiRollbackInstall DIFXAPP: ENTER: RollbackInstall() DIFXAPP: INFO: 'CustomActionData' property 'DIFxApp Version' is '2.1'. DIFXAPP: INFO: 'CustomActionData' property 'componentId' is '{driver component GUID}'. DIFXAPP: INFO: 'CustomActionData' property 'flags' is 0xA. DIFXAPP: INFO: 'CustomActionData' property 'installState' is '2'. DIFXAPP: INFO: 'CustomActionData' property 'ProductName' is 'My Product'. DIFXAPP: INFO: 'CustomActionData' property 'ManufacturerName' is 'My Company'. DIFXAPP: INFO: user SID of user performing the install is 'S-1-5-21-1644491937-2147298945-839522115-1003'. DIFXAPP: INFO: This was the component where the install failure occurred. The rollback for this component must have already occurred at the time of failure. No need to rollback again DIFXAPP: ERROR: Rollback failed with error 0x2 10938: DIFXAPP: RETURN: RollbackInstall() 2 (0x2) ------------------------------------------------------------------------------ _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users