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

Notes on installation #26

Open
sitiom opened this issue Jul 11, 2022 · 5 comments
Open

Notes on installation #26

sitiom opened this issue Jul 11, 2022 · 5 comments

Comments

@sitiom
Copy link
Contributor

sitiom commented Jul 11, 2022

Certificates

You certainly don't need certmgr.exe to install the certificates (I'm not even sure if you are even allowed to bundle that). Here is a command that equivalently works using builtin Windows commands:

certutil -addstore -f root IddSampleDriver.cer
certutil -addstore -f TrustedPublisher IddSampleDriver.cer

@roshkins Please remove certmgr.exe next time. You can replace the contents of installCert.bat with this:

@echo off

set CERTIFICATE="%~dp0IddSampleDriver.cer"

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

pause

Silent installation

I have found out that nefcon allows you to do this, adding the proper device node and then installing the driver all in the command line (Perhaps I can use devcon to do this, but they don't provide publically available binaries and bundle it instead in the WDK). Example:

# alternatively you can use nefconw for no output
nefconc --create-device-node --hardware-id ROOT\iddsampledriver --class-name Display --class-guid 4d36e968-e325-11ce-bfc1-08002be10318
nefconc --install-driver --inf-path IddSampleDriver.inf

Installation Script

Now we can combine both of those to provide a single, easy-to-use script that sets up everything for you:

# Install certificates
certutil -addstore -f root IddSampleDriver.cer
certutil -addstore -f TrustedPublisher IddSampleDriver.cer

# Copy option.txt to C:\IddSampleDriver if it does not exist
if (!(Test-Path "C:\IddSampleDriver\option.txt")) {
    Write-Host -Foreground Yellow "'C:\IddSampleDriver\option.txt' not found. Creating..."
    mkdir -force "C:\IddSampleDriver" | Out-Null
    Copy-Item -Path option.txt -Destination "C:\IddSampleDriver"
}

# Install driver
nefconw --create-device-node --hardware-id ROOT\iddsampledriver --class-name Display --class-guid 4d36e968-e325-11ce-bfc1-08002be10318
nefconw --install-driver --inf-path IddSampleDriver.inf

I have added @ge9's IddSampleDriver to Scoop (ScoopInstaller/Nonportable#26). Installation is as easy as doing scoop bucket add nonportable and scoop install iddsampledriver-ge9-np -g in an elevated prompt. If anyone is interested in making a Chocolatey package, feel free to look here.

Ping @ge9, can you open the issues tab on your fork? People shouldn't be reporting installation issues from your fork in here.

@sitiom
Copy link
Contributor Author

sitiom commented Jul 11, 2022

Hopefully, this fixes all the other issues here about installation failures caused by not properly following the instructions.

@ge9
Copy link
Contributor

ge9 commented Jul 11, 2022

I opened the issue tab now! Thank you for your advice (actually I didn't know the issue tab was not activated by default).
Certificates can also be installed by double-clicking the .cer file and following the wizard, so I agree that certmgr.exe is not necesssary.

@sitiom
Copy link
Contributor Author

sitiom commented Jul 11, 2022

I opened the issue tab now! Thank you for your advice (actually I didn't know the issue tab was not activated by default). Certificates can also be installed by double-clicking the .cer file and following the wizard, so I agree that certmgr.exe is not necesssary.

@ge9 Thanks. Can you also check out my PR on your fork (ge9#3)? I see that you are not watching your own repo.

@ge9
Copy link
Contributor

ge9 commented Jul 11, 2022

Thank you! I merged your PR.

@Alispezzate
Copy link

Alispezzate commented Jul 17, 2022

I have added @ge9's IddSampleDriver to Scoop (ScoopInstaller/Nonportable#26). Installation is as easy as doing scoop install iddsampledriver-ge9-np -g in an elevated prompt. If anyone is interested in making a Chocolatey package, feel free to look here.

I tried using scoop to install it as you said but it gives me an error:
Couldn't find manifest for 'iddsampledriver-ge9-np'.
Edit: fixed by using these commands:
scoop bucket add nonportable
scoop bucket add extras

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

No branches or pull requests

3 participants