Skip to content

Commit

Permalink
fix(installer): update vigembus
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher committed Oct 3, 2023
1 parent 366c5ab commit 76f86c4
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
branch = master
[submodule "third-party/ViGEmClient"]
path = third-party/ViGEmClient
url = https://github.com/ViGEm/ViGEmClient
url = https://github.com/nefarius/ViGEmClient
branch = master
[submodule "third-party/miniupnp"]
path = third-party/miniupnp
Expand Down
22 changes: 11 additions & 11 deletions cmake/packaging/windows.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/misc/autostart/"
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/misc/firewall/"
DESTINATION "scripts"
COMPONENT firewall)
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/misc/vigembus/"
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/misc/gamepad/"
DESTINATION "scripts"
COMPONENT vigembus)
COMPONENT gamepad)

# Sunshine assets
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/"
Expand Down Expand Up @@ -61,7 +61,7 @@ SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\migrate-config.bat\\\"'
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\add-firewall-rule.bat\\\"'
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\install-service.bat\\\"'
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\install-vigembus.bat\\\"'
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\install-gamepad.bat\\\"'
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\autostart-service.bat\\\"'
NoController:
")
Expand All @@ -74,10 +74,10 @@ set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\uninstall-service.bat\\\"'
nsExec::ExecToLog '\\\"$INSTDIR\\\\sunshine.exe\\\" --restore-nvprefs-undo'
MessageBox MB_YESNO|MB_ICONQUESTION \
'Do you want to remove ViGEmBus)?' \
/SD IDNO IDNO NoVigem
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\uninstall-vigembus.bat\\\"'; skipped if no
NoVigem:
'Do you want to remove Virtual Gamepad)?' \
/SD IDNO IDNO NoGamepad
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\uninstall-gamepad.bat\\\"'; skipped if no
NoGamepad:
MessageBox MB_YESNO|MB_ICONQUESTION \
'Do you want to remove $INSTDIR (this includes the configuration, cover images, and settings)?' \
/SD IDNO IDNO NoDelete
Expand Down Expand Up @@ -149,7 +149,7 @@ set(CPACK_COMPONENT_FIREWALL_DISPLAY_NAME "Add Firewall Exclusions")
set(CPACK_COMPONENT_FIREWALL_DESCRIPTION "Scripts to enable or disable firewall rules.")
set(CPACK_COMPONENT_FIREWALL_GROUP "Scripts")

# vigembus scripts
set(CPACK_COMPONENT_VIGEMBUS_DISPLAY_NAME "Virtual Gamepad Support")
set(CPACK_COMPONENT_VIGEMBUS_DESCRIPTION "Scripts to install and uninstall ViGEmBus for virtual gamepad support.")
set(CPACK_COMPONENT_VIGEMBUS_GROUP "Scripts")
# gamepad scripts
set(CPACK_COMPONENT_GAMEPAD_DISPLAY_NAME "Virtual Gamepad")
set(CPACK_COMPONENT_GAMEPAD_DESCRIPTION "Scripts to install and uninstall Virtual Gamepad.")
set(CPACK_COMPONENT_GAMEPAD_GROUP "Scripts")
2 changes: 1 addition & 1 deletion docs/source/about/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ Configure autostart service
Windows
^^^^^^^
For gamepad support, install `ViGEmBus <https://github.com/ViGEm/ViGEmBus/releases/latest>`__
For gamepad support, install `Nefarius Virtual Gamepad <https://github.com/nefarius/ViGEmBus/releases/latest>`__

Sunshine firewall
**Add rule**
Expand Down
2 changes: 1 addition & 1 deletion docs/source/troubleshooting/windows.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ Windows

No gamepad detected
-------------------
#. Verify that you've installed `ViGEmBus <https://github.com/ViGEm/ViGEmBus/releases/latest>`__.
#. Verify that you've installed `Nefarius Virtual Gamepad <https://github.com/nefarius/ViGEmBus/releases/latest>`__.
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ for /f "tokens=3" %%a in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVer
if !ProxyEnable! equ 0x1 (
for /f "tokens=3" %%a in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" ^| find /i "ProxyServer"') do (
set proxy=%%a
echo Using system proxy !proxy! to download ViGEmBus
echo Using system proxy !proxy! to download Virtual Gamepad
set proxy=-x !proxy!
)
) else (
rem Proxy is not enabled.
)
)

rem get browser_download_url from asset 0 of https://api.github.com/repos/vigem/vigembus/releases/latest
set latest_release_url=https://api.github.com/repos/vigem/vigembus/releases/latest
rem get browser_download_url from asset 0 of https://api.github.com/repos/nefarius/vigembus/releases/latest
set latest_release_url=https://api.github.com/repos/nefarius/vigembus/releases/latest

rem Use curl to get the api response, and find the browser_download_url
for /F "tokens=* USEBACKQ" %%F in (`curl -s !proxy! -L %latest_release_url% ^| findstr browser_download_url`) do (
Expand All @@ -40,10 +40,10 @@ set browser_download_url=%browser_download_url:browser_download_url: =%
echo %browser_download_url%

rem Download the exe
curl -s -L !proxy! -o "%temp_dir%\vigembus.exe" %browser_download_url%
curl -s -L !proxy! -o "%temp_dir%\virtual_gamepad.exe" %browser_download_url%

rem Install vigembus
%temp_dir%\vigembus.exe /passive /promptrestart
rem Install Virtual Gamepad
%temp_dir%\virtual_gamepad.exe /passive /promptrestart

rem Delete temp directory
rmdir /S /Q "%temp_dir%"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@echo off

rem Use wmic to get the uninstall ViGEmBus
rem Use wmic to get the uninstall Virtual Gamepad
wmic product where name="ViGEm Bus Driver" call uninstall

0 comments on commit 76f86c4

Please sign in to comment.