Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Device manager error #1

Closed
DrDillis opened this issue Apr 14, 2021 · 9 comments · Fixed by #28
Closed

Device manager error #1

DrDillis opened this issue Apr 14, 2021 · 9 comments · Fixed by #28
Assignees

Comments

@DrDillis
Copy link

I wonder if anyone else has had issues trying to install this device manually with device manager. I've tried this while running device manager as an administrator and ran the bat file first. Even after rebooting I still get

"An error has occurred during the installation of the device."

I hope something can be done, it'd be lovely to enable a few extra monitors for VR use.

regards

@roshkins
Copy link
Owner

Did you try copying and pasting the text of the bat file into an administrator command prompt with the working directory where the files were extracted? I think that has a better success rate.

@roshkins roshkins self-assigned this Apr 14, 2021
@DrDillis
Copy link
Author

DrDillis commented Apr 14, 2021

Thanks, works now, I think the issue you were having with other people saying it wont install the cert from the .bat was because the bat looked like this;

./CertMgr.exe /add IddSampleDriver.cer /s /r localMachine root

but needed this:

CertMgr.exe /add IddSampleDriver.cer /s /r localMachine root

@robbely
Copy link

robbely commented Jul 19, 2021

I was going to post this as a separate issue, but it relates to the above comment.
Batch file has a typo, second char should be "\" not "/" as it refers to a Windows path.

EDIT: github deleting backslash

@DocFreeman
Copy link

I get this error when trying to install in device manage (it half way succeeds)r:

This device is not working properly because Windows cannot load the drivers required for this device. (Code 31)

@txj-xyz
Copy link

txj-xyz commented Apr 6, 2022

Getting code 31 as well

@txj-xyz
Copy link

txj-xyz commented Apr 6, 2022

This is fixed here

@ChrisSwinchatt
Copy link

You can also get this error by not placing option.txt in C:\IddSampleDriver

@vertigo220
Copy link

vertigo220 commented May 26, 2022

I also had an issue with it not registering the certification, despite running the batch file as admin. When I opened an admin command window in the folder and ran it, it worked. The reason is that when running as admin, the working directory is c:\system32, so the ".\CertMgr.exe" part doesn't work, as it's not in the system32 directory. There's a very easy fix for this, to ensure others don't run into the issue. Simply change it to "%~dp0\CertMgr.exe" or, better yet, to avoid the other issue I had, which is that the install guide here didn't specify this needs to be in C:\iddSampleDriver to work, have the batch file ask the user if it's ok to copy the files there, then do so and then register it.

Here's a batch file that will do this, which will simplify this process and help prevent people having issues:

`@echo off
setlocal enableDelayedExpansion

REM Check if running with admin privileges
net session 1>nul 2>nul
if %errorlevel% neq 0 echo. & echo ERROR: RUN SCRIPT AS ADMINISTRATOR & echo. & pause & goto :eof

REM Check if in directory needed to work
if NOT "%~dp0"=="C:\iddSampleDriver" (
echo. & echo Files are currently in "%~dp0" and need to be in "C:\iddSampleDriver" to properly install and work. Would you like to copy them there and continue?& echo.
choice
if !errorlevel! equ 2 echo. & echo Installation canceled& echo. & pause & goto :eof
if !errorlevel! equ 1 (
if NOT exist "C:\iddSampleDriver" (
mkdir C:\iddSampleDriver 1>nul 2>nul
if !errorlevel! equ 1 echo. & echo ERROR: FAILED TO CREATE DIRECTORY "C:\iddSampleDriver" & echo. & pause & goto :eof
)
robocopy %~dp0 "C:\iddSampleDriver" /mir /is /it /im
if !errorlevel! gtr 7 echo. & echo ERROR COPYING WITH ROBOCOPY & echo. & pause & goto :eof
)
)

cls
C:\iddSampleDriver\certmgr.exe /add C:\iddSampleDriver\IddSampleDriver.cer /s /r localMachine root
if %errorlevel% equ 0 (
echo. & echo SUCCESS^^! & echo. & timeout /t 5
) else (
echo. & pause
)`

I'd also suggest adding in the install steps on the releases page to ensure it's in that directory, even though this updated batch script would do that, just in case.

@sitiom
Copy link
Contributor

sitiom commented Jul 11, 2022

%~dp0 should be appended to the path of the certificate so it finds it relative to the path of the script. The proper command in the bat file should be:

.\CertMgr.exe /add %~dp0IddSampleDriver.cer /s /r localMachine root

Also, See #26. CertMgr.exe is not even needed. Ultimately, installCert.bat should look like this:

@echo off

set CERTIFICATE="%~dp0IddSampleDriver.cer"

certutil -addstore -f root %CERTIFICATE%
certutil -addstore -f TrustedPublisher %CERTIFICATE%

pause

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants