-1

I have a driver installing using DriverPackageInstall, and uninstall DriverPackageUnInstall custom action in WiX installer. It installs and uninstalls successfully.

This driver is being installed by two different installers, keeping same GUID, path etc, and similar custom action in both INSTALLER1 (driver version 1.0.0.0), INSTALLER2 (driver version 2.0.0.0).

If installation / uninstallation sequence is followed in correct order:

  1. Install INSTALLER1
  2. Install INSTALLER2
  3. Uninstall INSTALLER2
  4. Uninstall INSTALLER1

then the uninstall is perfectly clean, but when I change the sequence:

  1. Install INSTALLER1
  2. Install INSTALLER2
  3. Uninstall INSTALLER1
  4. Uninstall INSTALLER2

and check "sc query mydriver" it is still present.

Whereas the component is removed from the registry components list:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\[SID]\Components

SCM registry registry HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\MyDriver is present.

I am not sure why it is not uninstalling the driver.

Is the sequence is important while uninstalling? (uninstall INSTALLER2 and uninstall INSTALLER1).

Stein Åsmul
  • 37,754
  • 24
  • 87
  • 158
user3664223
  • 193
  • 2
  • 13
  • [**Please see this answer and the section on making proper log files**](https://stackoverflow.com/a/51387298/129130). I would enable the automatic logging (See under "Log All MSIs"), and then find the log files for each MSI in the temp folder after they have all run in install- and uninstall-modes. – Stein Åsmul Jul 22 '18 at 00:38
  • Check your windows installer logs as Stein suggested. See if the custom actions did actually run on uninstall. Also check the driver log file here to see if anything occurred: C:\Windows\inf\setupapi.dev.log. And finally see if it could be something quirky with shared components: https://blogs.msdn.microsoft.com/heaths/2009/12/21/about-shared-components/ – Captain_Planet Jul 23 '18 at 12:19
  • @Captain_Planet - Not sure how reference counting works for drivers once you pass control to the driver installation / caching system. I suppose if the two driver versions target the same file names (in the same locations), then uninstalling the older version means the updated file can not be removed? Or the whole system gets confused about what to do. – Stein Åsmul Jul 23 '18 at 15:03
  • @SteinÅsmul Thanks, I have checked logs no error, found uninstallDriver successfully, from registry components its removed but from SCM its not removed. I am not getting how reference counting works in CutomAction. – user3664223 Jul 31 '18 at 09:40
  • This the only helpful comment found in logs "myDriver.sys will not deleted because it is different from file in driver store." – user3664223 Aug 01 '18 at 11:00

0 Answers0