Skip to content

Instantly share code, notes, and snippets.

@asuras-coding
Last active August 2, 2021 20:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save asuras-coding/b845c64e7ef5bcbf233bb8f6c2e6ee69 to your computer and use it in GitHub Desktop.
Save asuras-coding/b845c64e7ef5bcbf233bb8f6c2e6ee69 to your computer and use it in GitHub Desktop.
Guild Wars 2 arcdps - update script
@ECHO OFF
:: MIT License
::
:: Copyright (c) 2018 DevineDestiny.1209
::
:: Permission is hereby granted, free of charge, to any person obtaining a copy
:: of this software and associated documentation files (the "Software"), to deal
:: in the Software without restriction, including without limitation the rights
:: to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
:: copies of the Software, and to permit persons to whom the Software is
:: furnished to do so, subject to the following conditions:
::
:: The above copyright notice and this permission notice shall be included in all
:: copies or substantial portions of the Software.
::
:: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
:: IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
:: FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
:: AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
:: LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
:: OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
:: SOFTWARE.
:: This is an update-script for arcdps. (arcdps requires 64-Bit Gw2)
:: It will compare your arcdps file with the arcdps file on the deltaconnected-server
:: and update your file if both files are not the same. It will also update your
:: buildtemplate and/or reshade-chainload dll-files if configured to do so.
::
:: In most cases you will only need configure the User Config-section. If the file
:: location on the server changes, you can update the Path Config-section to fix the
:: script
::
:: You can reach me in-game: DevineDestiny.1209
:: This script is MIT licensed.
:: User Config
SET GW2_PATH=C:\Path\To\Guild Wars 2
SET CHAINLOAD=no
SET START_GW=no
SET COMBAT_MECHANICS=no
SET KILLPROOF_ME=no
SET BOONTABLE=no
:: Path Config
SET URL_ARC=https://www.deltaconnected.com/arcdps/x64/
SET URL_ARC_DLL=%URL_ARC%/d3d9.dll
SET URL_ARC_MD5=%URL_ARC%/d3d9.dll.md5sum
SET URL_ARC_CHAINLOAD=%URL_ARC%/reshade_loader/d3d9_chainload.dll
SET URL_COMBAT=https://github.com/knoxfighter/GW2-ArcDPS-Mechanics-Log/releases/latest/download
SET URL_COMBAT_DLL=%URL_COMBAT%/d3d9_arcdps_mechanics.dll
SET URL_COMBAT_SHA256=%URL_COMBAT%/d3d9_arcdps_mechanics.sha
SET URL_KP_ME=https://github.com/knoxfighter/arcdps-killproof.me-plugin/releases/latest/download
SET URL_KP_ME_DLL=%URL_KP_ME%/d3d9_arcdps_killproof_me.dll
SET URL_KP_ME_SHA256=%URL_KP_ME%/d3d9_arcdps_killproof_me.sha
SET URL_BOONTABLE=https://github.com/knoxfighter/GW2-ArcDPS-Boon-Table/releases/latest/download
SET URL_BOONTABLE_DLL=%URL_BOONTABLE%/d3d9_arcdps_table.dll
SET URL_BOONTABLE_SHA256=%URL_BOONTABLE%/d3d9_arcdps_table.sha
:: Script
SETLOCAL enabledelayedexpansion
ECHO updating arcdps and plugins...
SET FILE_ARC_DLL="%GW2_PATH%\bin64\d3d9.dll"
:: >> Set this to d3d9_chainload_noex.dll if using noex
SET FILE_CHAINLOAD_DLL="%GW2_PATH%\bin64\d3d9_chainload.dll"
SET FILE_COMBAT_DLL="%GW2_PATH%\bin64\d3d9_arcdps_mechanics.dll"
SET FILE_KP_ME_DLL="%GW2_PATH%\bin64\d3d9_arcdps_killproof_me.dll"
SET FILE_BOONTABLE_DLL="%GW2_PATH%\bin64\d3d9_arcdps_table.dll"
:: - Download latest md5 for arcdps
ECHO - checking for arcdps update...
ECHO - download latest md5
FOR /f %%i IN ('curl -s %URL_ARC_MD5%') DO SET "ARC_MD5_REMOTE=%%i"
:: - Calculate md5 from local arcdps-file
ECHO - comparing md5 from local arcdps-file and downloaded md5
FOR /f %%a IN ('certutil -hashfile %FILE_ARC_DLL% MD5 ^| findstr /v "hash"') DO SET "ARC_MD5_LOCAL=%%a"
SET "ARC_MD5_LOCAL=%ARC_MD5_LOCAL: =%"
:: - compare both md5 and re-download arcdps if necessary
IF /I NOT %ARC_MD5_LOCAL% == %ARC_MD5_REMOTE% (
ECHO - arcdps outdated, downloading new version
curl -s %URL_ARC_DLL% > %FILE_ARC_DLL%
IF %CHAINLOAD% == yes (
ECHO - downloading chainload
curl -s %URL_ARC_CHAINLOAD% > %FILE_CHAINLOAD_DLL%
)
)
IF %COMBAT_MECHANICS% == yes (
ECHO - checking for combat mechanics update...
ECHO - downloading latest sha256
FOR /f %%i IN ('curl -L -s %URL_COMBAT_SHA256% ^| more') DO SET "MEC_SHA_REMOTE=%%i"
ECHO - comparing sha256 from local combat-mechanics-file and downloaded sha256
FOR /f %%a IN ('certutil -hashfile %FILE_COMBAT_DLL% SHA256 ^| findstr /v "hash"') DO SET "MEC_SHA_LOCAL=%%a"
IF /I NOT !MEC_SHA_LOCAL! == !MEC_SHA_REMOTE! (
ECHO - combat-mechanics outdated, downloading new version
curl -L -s %URL_COMBAT_DLL% > %FILE_COMBAT_DLL%
)
)
IF %KILLPROOF_ME% == yes (
ECHO - checking for Killproof.me-plugin update...
ECHO - downloading latest sha256
:: - for some reason the sha256 is interpreted as binary. piping through more fixes this
FOR /f %%i IN ('curl -L -s %URL_KP_ME_SHA256% ^| more') DO SET "KP_SHA_REMOTE=%%i"
ECHO - comparing sha256 from local killproof.me-file and downloaded sha256
FOR /f %%a IN ('certutil -hashfile %FILE_KP_ME_DLL% SHA256 ^| findstr /v "hash"') DO SET "KP_SHA_LOCAL=%%a"
IF /I NOT !KP_SHA_LOCAL! == !KP_SHA_REMOTE! (
ECHO - killproof.me-plugin outdated, downloading new version
curl -L -s %URL_KP_ME_DLL% > %FILE_KP_ME_DLL%
)
)
IF %BOONTABLE% == yes (
ECHO - checking for Boontable-plugin update...
ECHO - downloading latest sha256
:: - for some reason the sha256 is interpreted as binary. piping through more fixes this
FOR /f %%i IN ('curl -L -s %URL_BOONTABLE_SHA256% ^| more') DO SET "BOONTABLE_SHA_REMOTE=%%i"
ECHO - comparing sha256 from local Boontable-file and downloaded sha256
FOR /f %%a IN ('certutil -hashfile %FILE_BOONTABLE_DLL% SHA256 ^| findstr /v "hash"') DO SET "BOONTABLE_SHA_LOCAL=%%a"
IF /I NOT !BOONTABLE_SHA_LOCAL! == !BOONTABLE_SHA_REMOTE! (
ECHO - Boontable-plugin outdated, downloading new version
curl -L -s %URL_BOONTABLE_DLL% > %FILE_BOONTABLE_DLL%
)
)
ECHO everything up-to-date!
IF %START_GW% == yes (
ECHO Starting Guild Wars 2...
START "" "%GW2_PATH%\Gw2-64.exe"
)
endlocal
@asuras-coding
Copy link
Author

asuras-coding commented Apr 28, 2019

You need windows cmd and curl for it to work. Should run on most win10-64bit machines after settings paths & variables in the script

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment