summaryrefslogtreecommitdiff
path: root/tools/steamfix.bat
diff options
context:
space:
mode:
authorGravatar Michael Smith <mikesmiffy128@gmail.com> 2025-06-04 23:27:56 +0100
committerGravatar Michael Smith <mikesmiffy128@gmail.com> 2025-06-04 23:27:56 +0100
commit78325572c1b2ae617dd5502ab726bfded1fd0506 (patch)
tree948ce8aa81770f4ed0a9170670b439a9ef912f85 /tools/steamfix.bat
parent4aebf7cc9ce07dfb20db217274a45680b3cb00ed (diff)
downloadsst-78325572c1b2ae617dd5502ab726bfded1fd0506.tar.gz
sst-78325572c1b2ae617dd5502ab726bfded1fd0506.zip
Add some WinDbg helpers and tidy up the README
Diffstat (limited to 'tools/steamfix.bat')
-rw-r--r--tools/steamfix.bat27
1 files changed, 27 insertions, 0 deletions
diff --git a/tools/steamfix.bat b/tools/steamfix.bat
new file mode 100644
index 0000000..d0a77c2
--- /dev/null
+++ b/tools/steamfix.bat
@@ -0,0 +1,27 @@
+:: This file is dedicated to the public domain.
+@echo off
+
+:: In several old L4D2 builds, we currently have some weird black magic we don't
+:: fully understand to do what looks like DRM circumvention or... something.
+:: Annoyingly, that black magic manages to break regular use of Steam after the
+:: game exits. This is fixed by setting a registry key back to Steam's PID.
+
+:: The scripts used to launch those builds already do this, of course, but if
+:: you're launching L4D2 under a debugger, you can use this script instead.
+
+:: By the way, if anyone wants to look into solving the root cause so that none
+:: of this is needed any more, that would be cool!
+
+set REG=%SYSTEMROOT%\SysWOW64\reg.exe
+if not exist "%REG%" set REG=%SYSTEMROOT%\System32\reg.exe
+set steampid=
+for /F "usebackq skip=1 delims=" %%I in (
+ `wmic process where "name='steam.exe'" get processid 2^>nul`
+) do ( set steampid=%%I & goto :ok)
+:ok
+if not %steampid%=="" (
+ %REG% add "HKCU\SOFTWARE\Valve\Steam\ActiveProcess" /f /t REG_DWORD ^
+/v pid /d %steampid%>nul
+)
+
+:: vi: sw=4 ts=4 noet tw=80 cc=80