Skip to content

Instantly share code, notes, and snippets.

@dangreene0
Created November 8, 2022 20:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dangreene0/c099b09bc5e5e2705d787c407dd77540 to your computer and use it in GitHub Desktop.
Save dangreene0/c099b09bc5e5e2705d787c407dd77540 to your computer and use it in GitHub Desktop.
Batch Script to update TF2Vintage
@echo off
rem This is the location of the script
SET scriptdir=%~dp0
rem This checks to see if 7-Zip is installed
FOR /F "tokens=2* skip=2" %%a in ('reg query "HKEY_CURRENT_USER\Software\7-Zip" /v "Path"') do set zippath=%%b
reg query HKEY_CURRENT_USER\Software\7-Zip /v Path
if %ERRORLEVEL% EQU 0 (goto INSTALL) else (goto ERRORNOZIP)
:INSTALL
echo 7-Zip location: "%zippath%"
echo Script location: "%scriptdir:~0,-1%"
if exist tf2vintage\ (echo Found existing tf2vintage location, continuing with update.) else (goto ERRORNOINSTALL)
echo Downloading latest build.
echo Do not close this window until the game has fully downloaded. It is a quiet download...
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://nightly.link/TF2V/TF2Vintage/workflows/release/3.6/tf2vintage.zip', 'tf2vintage.zip')"
echo Preserving gameinfo
cd tf2vintage
rename gameinfo.txt temp-gameinfo.txt
cd ..
echo Extracting files with full overwrite
rem If you wish to have skip over existing files change it to `-aos`
"%zippath%\7z.exe" x tf2vintage.zip -aoa
"%zippath%\7z.exe" x tf2vintage.7z -aoa
cd tf2vintage
del /q gameinfo.txt
rename temp-gameinfo.txt gameinfo.txt
cd ..
rem Garbage collection
del /q tf2vintage.zip
del /q tf2vintage.7z
echo Update has finished, have a good day!
pause
exit /b
:ERRORNOZIP
echo 7-Zip was not found, please download and install 7-Zip before running this script.
echo https://www.7-zip.org/download.html
pause
exit /b
:ERRORNOINSTALL
echo No existing tf2vintage location was found, please manually install the game first.
echo https://nightly.link/TF2V/TF2Vintage/workflows/release/3.6/tf2vintage.zip
pause
exit /b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment