fix(windows): bundle vigembus instead of downloading it (#4088)
This commit is contained in:
20
src_assets/windows/misc/gamepad/install-gamepad.ps1
Normal file
20
src_assets/windows/misc/gamepad/install-gamepad.ps1
Normal file
@@ -0,0 +1,20 @@
|
||||
# Check if a compatible version of ViGEmBus is already installed (1.17 or later)
|
||||
try {
|
||||
$vigemBusPath = "$env:SystemRoot\System32\drivers\ViGEmBus.sys"
|
||||
$fileVersion = (Get-Item $vigemBusPath).VersionInfo.FileVersion
|
||||
|
||||
if ($fileVersion -ge [System.Version]"1.17") {
|
||||
Write-Information "The installed version is 1.17 or later, no update needed. Exiting."
|
||||
exit 0
|
||||
}
|
||||
}
|
||||
catch {
|
||||
Write-Information "ViGEmBus driver not found or inaccessible, proceeding with installation."
|
||||
}
|
||||
|
||||
# Install Virtual Gamepad
|
||||
$scriptPath = Split-Path -Parent $MyInvocation.MyCommand.Path
|
||||
$installerPath = Join-Path $scriptPath "vigembus_installer.exe"
|
||||
Start-Process `
|
||||
-FilePath $installerPath `
|
||||
-ArgumentList "/passive", "/promptrestart"
|
||||
Reference in New Issue
Block a user