none
Changing Drivers RRS feed

  • Question

  • Hi Everyone,

    I'm working on the new version of our camera software, and part of that process has been to change the drivers from our existing drivers, to Lib/WinUSB. As part of the installer, I have a batch file which calls dpinst to remove the old drivers (from an .inf file), and then dpinst again to install the new drivers (from a different .inf file in a different directory). This works fine if I have the camera unplugged, but when the camera is connected it struggles (sometimes it works, but not always). This behavior is acceptable as I can inform people to always unplug their camera before running the installer. The real problem occurs when I try to revert back to the old drivers. In this case, I call dpinst to remove the new drivers, then again to install the old drivers. The strange thing is, this only works when the camera is plugged in! I'm struggling to see why the drivers don't update when the camera has been removed. I've tried it multiple times on several machines and the behaviour is the same. I would be happy if the camera always had to be unplugged, and to be fair, I can always add some instructions to tell people what to do. But it would be much better if the behavior was consistent. Does anyone have any idea why this might happen? I'm new to driver development, so I may be overlooking something obvious. I can post code / files here if necessary.

    Chris

    Friday, January 15, 2016 4:42 PM

All replies

  •  The strange thing is, this only works when the camera is plugged in! I'm struggling to see why the drivers don't update when the camera has been removed

    Can you please explain what does NOT work when camera is NOT plugged in? As you wrote, uninstall does work when the camera is not plugged in, so the problem is with re-detection of the camera when user plugs it in? Or a wrong driver somehow persists in the system and  gets installed?

    -- pa

    Sunday, January 17, 2016 11:28 AM
  • Thanks for the reply,

    Apologies, what I should have said was that when it 'fails', the device keeps the previous drivers. So, for example, when I install the new drivers, the drivers only change to the new drivers when the camera is unplugged. When I change back to the old drivers, the drivers only change when the camera is plugged in. When it 'fails', the device keeps the previous drivers. This is both reflected in device manager and in the fact the device doesn't work with the software. This is despite the fact that I also uninstall the previous drivers before installing the next drivers.

    Chris

    Monday, January 18, 2016 9:23 AM