Installation failed with error message: "UpdateDriverForPlugAndPlayDevices err=2"
Your Windows registry is corrupted probably due to uninstallation of certain program. If you are familiar with registry, you can create the following folder in your registry to fix this: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
I basically got a box in com2com that stated UpdateDriverForPlugAndPlayDevices() could not be called or had an error, and Exception 0x00000002: Could not find file location. Or something.
I figured out how to resolved it by going to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion
and adding a new Key 'RunOnce'.
For whatever reason my computer only had RunOnceEx. At anyrate to avoid this you might be able to check for 'RunOnce' key in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion
If its there great and proceed if not create the key for the user. And user should never see the error.
You can reproduce the problem by getting rid of the RunOnce Key.
So that you don't have to do too much work here is the code segment that should fix the problem:
if(RegCreateKey(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce"), &handle))
:Finally, UpdateDriverForPlugAndPlayDevices() is used in both devutils.cpp & setup.cpp. So I would suggest placing the code segment somewhere before either of the calls are made.
I hope this make your software more stable and user-friendly, so someone else does not have to go through the same hoops I did.
- Michael A. Smith
If you have any questions just e-mail CoyoteWAN@gmail.com
Log in to post a comment.