Skip to content

Commit

Permalink
Add windows drivers for nano esp32 dfu
Browse files Browse the repository at this point in the history
  • Loading branch information
facchinm authored and pillo79 committed Jul 9, 2024
1 parent 5e19e08 commit 6bd741f
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/scripts/on-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ cp -f "$GITHUB_WORKSPACE/package.json" "$PKG_DIR/"
cp -f "$GITHUB_WORKSPACE/programmers.txt" "$PKG_DIR/"
cp -Rf "$GITHUB_WORKSPACE/cores" "$PKG_DIR/"
cp -Rf "$GITHUB_WORKSPACE/libraries" "$PKG_DIR/"
cp -f "$GITHUB_WORKSPACE/post_install.bat" "$PKG_DIR/"
cp -Rf "$GITHUB_WORKSPACE/drivers" "$PKG_DIR/"
cp -f "$GITHUB_WORKSPACE/tools/espota.exe" "$PKG_DIR/tools/"
cp -f "$GITHUB_WORKSPACE/tools/espota.py" "$PKG_DIR/tools/"
cp -f "$GITHUB_WORKSPACE/tools/gen_esp32part.py" "$PKG_DIR/tools/"
Expand Down
Binary file added drivers/dpinst-amd64.exe
Binary file not shown.
Binary file added drivers/dpinst-x86.exe
Binary file not shown.
Binary file added drivers/nanoesp32.cat
Binary file not shown.
59 changes: 59 additions & 0 deletions drivers/nanoesp32.inf
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
;
;
; Installs WinUsb
;

[Version]
Signature = "$Windows NT$"
Class = USBDevice
ClassGUID = {88BAE032-5A81-49f0-BC3D-A4FF138216D6}
Provider = %ManufacturerName%
CatalogFile = nanoesp32.cat
DriverVer = 03/03/2020,10.48.00.000

; ========== Manufacturer/Models sections ===========

[Manufacturer]
%ManufacturerName% = Standard,NTamd64

[Standard.NTamd64]
%DeviceName% =USB_Install, USB\VID_2341&PID_0070&MI_00

; ========== Class definition ===========

[ClassInstall32]
AddReg = ClassInstall_AddReg

[ClassInstall_AddReg]
HKR,,,,%ClassName%
HKR,,NoInstallClass,,1
HKR,,IconPath,%REG_MULTI_SZ%,"%systemroot%\system32\setupapi.dll,-20"
HKR,,LowerLogoVersion,,5.2

; =================== Installation ===================

[USB_Install]
Include = winusb.inf
Needs = WINUSB.NT

[USB_Install.Services]
Include = winusb.inf
Needs = WINUSB.NT.Services

[USB_Install.HW]
AddReg=Dev_AddReg

[Dev_AddReg]
HKR,,DeviceInterfaceGUIDs,0x10000,"{51de5bfa-d59d-4f3e-9b36-0b4b210dd53f}"

; [DestinationDirs]
; If your INF needs to copy files, you must not use the DefaultDestDir directive here.
; You must explicitly reference all file-list-section names in this section.

; =================== Strings ===================

[Strings]
ManufacturerName="Arduino"
ClassName="Universal Serial Bus devices"
DeviceName="Nano ESP32 DFU"
REG_MULTI_SZ = 0x00010000
28 changes: 28 additions & 0 deletions post_install.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
@echo off
set ARGS=/SE /SW /SA
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" (
drivers\dpinst-amd64.exe %ARGS%
) ELSE IF "%PROCESSOR_ARCHITEW6432%" == "AMD64" (
drivers\dpinst-amd64.exe %ARGS%
) ELSE (
drivers\dpinst-x86.exe %ARGS%
)

@echo off
setlocal
for /f "tokens=4-5 delims=[.] " %%i in ('ver') do @(if %%i==Version (set VERSION=%%j) else (set VERSION=%%i))
if %VERSION% GEQ 10 (
exit /b 0
)
endlocal

REM dpinst /PATH has problems with relative paths, so use absolute path.
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" (
drivers\dpinst-amd64.exe /PATH %cd%\drivers\prewin10 %ARGS%
) ELSE IF "%PROCESSOR_ARCHITEW6432%" == "AMD64" (
drivers\dpinst-amd64.exe /PATH %cd%\drivers\prewin10 %ARGS%
) ELSE (
drivers\dpinst-x86.exe /PATH %cd%\drivers\prewin10 %ARGS%
)

exit /b 0

0 comments on commit 6bd741f

Please sign in to comment.