Skip to content

Commit 3769c54

Browse files
authored
Merge pull request #209 from SNWCreations/feat/dl-steamcmd
- UPDATED: Download SteamCMD automatically if it is missing on Windows platform
2 parents c9bb77a + c7f2e75 commit 3769c54

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,9 @@ If you have git installed; it is recommended to use git and clone the repo `git
446446

447447
All the following instructions will use the repo folder location as the root.
448448

449-
Create a folder `steamcmd` and [download SteamCMD](https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip) and extract it inside `steamcmd` so you should have `\steamcmd\steamcmd.exe`.
449+
~~Create a folder `steamcmd` and [download SteamCMD](https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip) and extract it inside `steamcmd` so you should have `\steamcmd\steamcmd.exe`.~~
450+
451+
* Manual download of SteamCMD is no longer necessary as the startup script will handle it for you now.
450452

451453
To download maps from the workshop, your server [needs access](https://developer.valvesoftware.com/wiki/Counter-Strike:_Global_Offensive/Dedicated_Servers#Steam_Workshop) to the Steam Web API. To allow this, open `\win.ini` and set `cs_api_key` to your [Steam Web API Key](http://steamcommunity.com/dev/apikey).
452454

win.bat

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ echo If you want to quit, close the CS2 window and type Y followed by Enter.
1919

2020
:: Ensure steamcmd exists
2121
if not exist "%ROOT_DIR%steamcmd\steamcmd.exe" (
22-
echo steamcmd\steamcmd.exe does not exist!
23-
goto end
22+
mkdir "%ROOT_DIR%steamcmd"
23+
echo Downloading SteamCMD
24+
powershell -Command "Invoke-WebRequest -Uri https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip -OutFile '%ROOT_DIR%steamcmd\steamcmd.zip'"
25+
powershell -Command "Expand-Archive -Path '%ROOT_DIR%steamcmd\steamcmd.zip' -DestinationPath '%ROOT_DIR%steamcmd'"
26+
del "%ROOT_DIR%steamcmd\steamcmd.zip"
2427
)
2528

2629
:: Use SteamCMD to download CS2

0 commit comments

Comments
 (0)