Add install-rehlds-on-windows/en.md
Browse Source
1 changed file
with 81 additions and 0 deletions
install-rehlds-on-windows/en.md
A
| @@ -0,0 +1,81 @@ | ||
| 1 | +--- | |
| 2 | +title: "How to Install ReHLDS on Windows Server" | |
| 3 | +excerpt: "Swap Valve's swds.dll for ReHLDS on a Windows CS 1.6 server, verify the engine actually loaded, and avoid the DLL and antivirus traps." | |
| 4 | +category: "installation" | |
| 5 | +tags: "rehlds, windows" | |
| 6 | +image: "" | |
| 7 | +read_time: "8 min read" | |
| 8 | +--- | |
| 9 | +<p>On Windows the Half-Life engine lives in <code>swds.dll</code>, not <code>engine_i486.so</code>. ReHLDS ships a Windows build of that DLL, so installing it is a file swap — but the failure modes are different from Linux, mostly because of antivirus software and because Windows will happily load a stale DLL from the wrong directory without telling you.</p> | |
| 10 | + | |
| 11 | +<h2>1. Prerequisites</h2> | |
| 12 | +<ul> | |
| 13 | +<li>A working App 90 install that already boots to a map. If you do not have one, follow <a href="/tutorials/install-cs16-dedicated-server-windows">the Windows install guide</a> first.</li> | |
| 14 | +<li>The Microsoft Visual C++ redistributables. ReHLDS is built with MSVC; on a bare Windows Server image the redistributable is frequently missing and the DLL will simply refuse to load.</li> | |
| 15 | +<li>An antivirus exclusion for the server folder. Defender has flagged Metamod and AMXX DLLs as trojans on and off for years. It is a false positive, but a quarantined DLL looks exactly like a broken install.</li> | |
| 16 | +</ul> | |
| 17 | + | |
| 18 | +<h2>2. Download the release</h2> | |
| 19 | +<p>Take the latest ReHLDS release archive from the project's GitHub releases page. Inside, the Windows build contains:</p> | |
| 20 | +<pre>swds.dll | |
| 21 | +hlds.exe (ReHLDS' own launcher; optional but recommended)</pre> | |
| 22 | +<p>Make sure you took the <strong>Windows</strong> directory of the archive. Copying a Linux <code>engine_i486.so</code> onto Windows does nothing at all — the file is simply ignored, the Valve engine keeps running, and you will swear the install "did not work".</p> | |
| 23 | + | |
| 24 | +<h2>3. Stop the server, back up, replace</h2> | |
| 25 | +<p>Shut the server down completely. Windows locks a loaded DLL; overwriting <code>swds.dll</code> while <code>hlds.exe</code> is running fails with <em>Access is denied</em> — and if you force it, you will replace it with a half-written file.</p> | |
| 26 | +<pre>cd /d C:\hlds | |
| 27 | +copy swds.dll swds.dll.valve.bak | |
| 28 | +copy /Y C:\downloads\rehlds\swds.dll C:\hlds\swds.dll | |
| 29 | +copy /Y C:\downloads\rehlds\hlds.exe C:\hlds\hlds.exe</pre> | |
| 30 | +<p>Both files belong in the <strong>server root</strong> — the folder containing <code>hlds.exe</code> and the <code>cstrike\</code> directory. Not inside <code>cstrike\</code>.</p> | |
| 31 | + | |
| 32 | +<h2>4. Start and confirm</h2> | |
| 33 | +<pre>cd /d C:\hlds | |
| 34 | +hlds.exe -console -game cstrike -port 27015 +map de_dust2 +maxplayers 20 +sv_lan 0</pre> | |
| 35 | +<p>In the console:</p> | |
| 36 | +<pre>rehlds_version</pre> | |
| 37 | +<p>Stock HLDS replies <code>Unknown command: rehlds_version</code>. ReHLDS prints its version. That is the only verification that means anything — file dates and folder contents can lie, the cvar cannot.</p> | |
| 38 | + | |
| 39 | +<h2>5. ReHLDS cvars on Windows</h2> | |
| 40 | +<p>Identical to Linux; add them to <code>cstrike\server.cfg</code>:</p> | |
| 41 | +<pre>sv_rehlds_local_gametime 1 | |
| 42 | +sv_rehlds_force_dlmax 1 | |
| 43 | +sv_rehlds_send_mapcycle 0 | |
| 44 | +sv_filterban 1 | |
| 45 | +sv_rcon_maxfailures 5 | |
| 46 | +sv_rcon_minfailures 5 | |
| 47 | +sv_rcon_minfailuretime 30</pre> | |
| 48 | +<p>There is one platform difference that matters: Windows HLDS cannot hit the same server FPS as Linux at the same CPU cost, and <code>sys_ticrate</code> behaves differently under the Windows timer. Do not expect 500 FPS out of a Windows box; 100–200 is the realistic range.</p> | |
| 49 | + | |
| 50 | +<h2>6. The rest of the stack</h2> | |
| 51 | +<p>On Windows the file names change but the order does not:</p> | |
| 52 | +<ol> | |
| 53 | +<li>ReHLDS → <code>swds.dll</code></li> | |
| 54 | +<li><a href="/tutorials/install-regamedll-cs16">ReGameDLL_CS</a> → <code>cstrike\dlls\mp.dll</code></li> | |
| 55 | +<li><a href="/tutorials/install-metamod-r">Metamod-r</a> → <code>cstrike\addons\metamod\metamod.dll</code>, referenced from <code>liblist.gam</code></li> | |
| 56 | +<li><a href="/tutorials/install-amx-mod-x-1-9">AMX Mod X</a> → <code>cstrike\addons\amxmodx\dlls\amxmodx_mm.dll</code>, listed in <code>metamod\plugins.ini</code></li> | |
| 57 | +</ol> | |
| 58 | +<p>In <code>plugins.ini</code>, Windows lines start with <code>win32</code> and Linux lines with <code>linux</code>. A file copied from a Linux server will list <code>.so</code> paths and every plugin will fail. See <a href="/tutorials/metamod-plugins-ini-explained">plugins.ini explained</a>. There is also a combined walkthrough: <a href="/tutorials/install-rehlds-metamod-amxx-windows">full ReHLDS + Metamod-r + AMXX on Windows</a>.</p> | |
| 59 | + | |
| 60 | +<h2>Common errors</h2> | |
| 61 | +<ul> | |
| 62 | +<li><strong>Console flashes and closes</strong> — run it from <code>cmd.exe</code> with a <code>pause</code> at the end of your batch file so you can read the last line.</li> | |
| 63 | +<li><strong><code>The application was unable to start correctly (0xc000007b)</code></strong> — you mixed a 64-bit DLL into a 32-bit process. Everything in a CS 1.6 server is 32-bit; there is no 64-bit build.</li> | |
| 64 | +<li><strong><code>The program can't start because MSVCP140.dll is missing</code></strong> — install the Visual C++ redistributable (x86, not x64).</li> | |
| 65 | +<li><strong><code>rehlds_version</code> is unknown after the swap</strong> — either the DLL was quarantined by antivirus (check the quarantine list), or you copied it next to a <em>different</em> <code>hlds.exe</code> than the one you are launching. Confirm the running path in Task Manager → Details → right-click → <em>Open file location</em>.</li> | |
| 66 | +<li><strong><code>Access is denied</code> copying swds.dll</strong> — the server is still running. Kill <code>hlds.exe</code> in Task Manager first.</li> | |
| 67 | +</ul> | |
| 68 | + | |
| 69 | +<h2>Rollback</h2> | |
| 70 | +<pre>cd /d C:\hlds | |
| 71 | +copy /Y swds.dll.valve.bak swds.dll</pre> | |
| 72 | +<p>Restart and check <code>rehlds_version</code> is unknown again. Alternatively re-run <code>app_update 90 validate</code> in SteamCMD, which restores every stock file it manages — including <code>swds.dll</code>, and <strong>including</strong> anything else you had replaced, so do not reach for validate casually once you have a customised install.</p> | |
| 73 | + | |
| 74 | +<h2>Verification</h2> | |
| 75 | +<ol> | |
| 76 | +<li><code>rehlds_version</code> prints a version.</li> | |
| 77 | +<li><code>status</code> shows the map and slot count.</li> | |
| 78 | +<li>A client can <code>connect YOUR_IP:27015</code> and spawn.</li> | |
| 79 | +<li>If Metamod is installed, <code>meta list</code> shows every plugin as <code>RUN</code>, none as <code>bad load</code>.</li> | |
| 80 | +</ol> | |
| 81 | +<p>All four green means the engine swap is done and the rest of the stack is safe to layer on top.</p> | |
| 0 | 82 |









