Skip to content

Commit

Permalink
Don't install/update ViGEmBus if 1.17 or later is already installed (#…
Browse files Browse the repository at this point in the history
…1953)

Co-authored-by: ReenigneArcher <[email protected]>
  • Loading branch information
cgutman and ReenigneArcher authored Dec 31, 2023
1 parent 66e31a2 commit a6ffeb4
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src_assets/windows/misc/gamepad/install-gamepad.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@
@echo off
setlocal enabledelayedexpansion

rem Check if a compatible version of ViGEmBus is already installed (1.17 or later)
set Version=
for /f "usebackq delims=" %%a in (`wmic product where "name='ViGEm Bus Driver' or name='Nefarius Virtual Gamepad Emulation Bus Driver'" get Version /format:Textvaluelist`) do (
for /f "delims=" %%# in ("%%a") do set "%%#"
)

rem Extract Major and Minor versions
for /f "tokens=1,2 delims=." %%a in ("%Version%") do (
set "MajorVersion=%%a"
set "MinorVersion=%%b"
)

rem Compare the version to 1.17
if /i !MajorVersion! gtr 1 goto skip
if /i !MajorVersion! equ 1 (
if /i !MinorVersion! geq 17 (
goto skip
)
)
goto continue

:skip
echo "The installed version is %Version%, no update needed. Exiting."
exit /b 0

:continue
rem Get temp directory
set temp_dir=%temp%/Sunshine

Expand Down

0 comments on commit a6ffeb4

Please sign in to comment.