windows: retry the first start instead of hiding a Steam setting

The 'Unable to initialize Steam' box comes from the server's first start after
an install, with or without Steam running; the registry workaround was not the fix.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
esefandClaude Opus 5.5 committed 2026-10-15 21:09:54 +03:00
1 parent 153e44b661
commit 1cf0032927
3 files changed
+25 -23

No files matched your search

+1 -1
View File
@@ -90,7 +90,7 @@ The same stack, native instead of Docker: the win32 builds of every part, `hlds.
Things that differ from Linux:
- **Steam installed on the same PC.** The server's `steam_api.dll` finds the Steam client's `steamclient.dll` through `HKCU\Software\Valve\Steam\ActiveProcess\SteamClientDll` and loads that instead of its own, which ends in "Unable to initialize Steam". `Start-CsServer` renames that value until the server answers queries (a few seconds), then puts it back. Steam rewrites it at every start anyway, and every script repairs it on load if a start was interrupted.
- **First start after an install.** The server's Steam part sets itself up on its first run (`hlds\appcache`, `hlds\config`) and the server stops with a "Fatal error: Unable to initialize Steam" box. Every start after that works, with or without the Steam client running. `Start-CsServer` notices that box (window title "Fatal error"), closes the server and starts it once more.
- **Firewall.** Setup adds an allow rule for `hlds\hlds.exe` on all network types (admin prompt) before the first start, so Windows' own popup doesn't appear, and removes block rules Windows made if that popup was ever cancelled. Normal users often can't read firewall rules, so the result is remembered in `secrets\firewall-rule.txt`.
- **Install folder.** `Documents\cs16`, or `%USERPROFILE%\cs16` when Documents is synced by OneDrive, or `C:\cs16` when the user folder has non-ASCII characters (SteamCMD and HLDS can't handle them). The folder is remembered in `%LOCALAPPDATA%\cs16-dm-server\install-folder.txt`, so running a newly downloaded `setup.cmd` updates the existing install.
- **Console log.** `-condebug` writes `hlds\qconsole.log`; setup shows its end when the server doesn't come up.