Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add libusbK-based contrib driver package
- Loading branch information
1 parent
eeddb11
commit 76f3a30
Showing
7 changed files
with
84 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# | ||
# Twili Driver Bootstrap Script | ||
# | ||
# This script downloads support tooling and libusbK, to set up the | ||
# on-disk hierarchy to support driver installation via twili.inf | ||
# | ||
|
||
$LibusbkUrl = "https://sourceforge.net/projects/libusbk/files/libusbK-release/3.0.7.0/libusbK-3.0.7.0-bin.7z/download" | ||
$LibusbkPrefix = "libusbK-3.0.7.0" | ||
$7zipUrl = "https://www.7-zip.org/a/7z1805.msi" | ||
|
||
New-Item -ItemType Directory tools -ErrorAction Stop | Out-Null | ||
$env:Path += ";.\tools" | ||
|
||
# # # | ||
Write-Output "• Staging 7-Zip" | ||
|
||
$WorkingFilename = [IO.Path]::GetRandomFileName() | ||
$WorkingDirectory = [IO.Path]::GetRandomFileName() | ||
Invoke-WebRequest $7zipUrl -OutFile $WorkingFilename | ||
Start-Process msiexec.exe -Wait -NoNewWindow -ArgumentList @( | ||
"/q","/a",$WorkingFilename,"TARGETDIR=$((Get-Item -Path '.\' -Verbose).FullName)\$WorkingDirectory") | ||
Move-Item .\$WorkingDirectory\Files\7-Zip\7z.??? .\tools | ||
Remove-Item .\$WorkingFilename | ||
Remove-Item .\$WorkingDirectory -Recurse | ||
|
||
# # # | ||
Write-Output "• Staging libusbk" | ||
|
||
New-Item -ItemType Directory @("amd64", "x86") -ErrorAction Stop | Out-Null | ||
$WorkingFilename = [IO.Path]::GetRandomFileName() | ||
$WorkingDirectory = [IO.Path]::GetRandomFileName() | ||
Invoke-WebRequest $LibusbkUrl -OutFile $WorkingFilename -MaximumRedirection 3 -UserAgent "PowerShell/Windows" | ||
Start-Process 7z.exe -Wait -ArgumentList @("x", $WorkingFilename, "-i!*\bin\dll", "-i!*\bin\sys", "-o$WorkingDirectory") | ||
|
||
# # # | ||
Write-Output "• Creating driver directory hierarchy" | ||
Move-Item .\$WorkingDirectory\$LibusbkPrefix-bin\bin\*\x86\* .\x86 | ||
Move-Item .\$WorkingDirectory\$LibusbkPrefix-bin\bin\*\amd64\* .\amd64 | ||
|
||
# # # | ||
Write-Output "• Cleaning up" | ||
Remove-Item .\$WorkingFilename | ||
Remove-Item .\$WorkingDirectory -Recurse | ||
|
||
# # # | ||
Write-Output "✓ Done" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Twili USB Driver Package | ||
|
||
This driver package associates the libtransistor USB device, and its interfaces, with libusbK for use with Twili. | ||
|
||
## Usage | ||
|
||
Before the driver package can be installed, you must download libusbk, create a catalog of its files, and digitally sign the catalog. | ||
|
||
You have two options here: | ||
|
||
1. Use the provided self-signed driver package. | ||
2. Catalog and sign the driver package yourself. | ||
|
||
Pick only one of these options. Temporary internet access is required during bootstrap. | ||
|
||
### Using the provided self-signed driver package | ||
|
||
1. Right-click `Bootstrap.ps1` and click Run with PowerShell. | ||
2. Double-click `twili.cer` and click the Install Certificate button. | ||
3. Follow the Certificate Import Wizard steps to install the certificate into the Local Machine `Trusted Root Certification Authorities` store. | ||
4. Open Device Manager and double-click any of the `TransistorUSB` devices listed under the `Other devices` heading. | ||
5. Click the Update Driver button and browse to the folder containing the provided driver package. | ||
6. Follow on-screen instructions to complete the install. | ||
7. Repeat steps 3-5 for any remaining `TransistorUSB` devices. | ||
|
||
### Catalog and sign the driver package yourself | ||
|
||
1. Right-click `Bootstrap.ps1` and click Run with PowerShell. | ||
2. Download the [Enterprise Windows Driver Kit (EWDK)](https://docs.microsoft.com/en-us/windows-hardware/drivers/develop/using-the-enterprise-wdk) (13GB) | ||
3. Mount the Enterprise WDK image and start a new **elevated** build environment (`LaunchBuildEnv.cmd`). | ||
4. In that environment, navigate to the driver package location in the source tree and execute the signing script (`SignDrivers.cmd`). | ||
5. Follow self-signed driver package installation steps 4-6. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
inf2cat /os:7_X86,7_X64,8_X86,8_X64,10_X64,10_X86 /driver:. | ||
makecert -r -pe -ss My -n "CN=ReSwitched (self-signed)" -eku 1.3.6.1.5.5.7.3.3 twili.cer | ||
certmgr.exe /add twili.cer /s /r localMachine root | ||
signtool sign /n ReSwitched twili.cat |
Binary file not shown.
Binary file not shown.
Binary file not shown.