Advertisement
aveyo

steamwebhelper_min.bat

Jul 6th, 2023 (edited)
1,529
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 5.68 KB | Gaming | 0 0
  1. @(set '(=)||' <# lean and mean cmd / powershell hybrid #> @'
  2.  
  3. @set /a STEAMWEBHELPER_OFFLINE=0
  4. @set /a USE_NEW_INGAME_OVERLAY=0
  5.  
  6. :: makes 2 Desktop shortcuts: Steam_min - use with auto-login; Steam_login - use if auto-login is not enabled and dialog is black
  7. @echo off & title steamwebhelper_min || AveYo 2023.08.02
  8. if 1%STEAMWEBHELPER_OFFLINE% gtr 10 (set OFFLINE=--proxy-server=localhost) else (set OFFLINE=--disable-background-networking)
  9. if 1%USE_NEW_INGAME_OVERLAY% gtr 10 (set OVERLAY=) else (set OVERLAY=-vgui)
  10. set ARGS_CEF=--enable-low-end-device-mode --disable-low-res-tiling \"--renderer-process-limit=1\" --aggressive %OFFLINE%
  11. set ARGS_LNK=-cef-disable-breakpad -cef-disable-gpu -skipinitialbootstrap -quicklogin %OVERLAY% -oldtraymenu -silent
  12. set ARGS_LNK_MIN=-cef-single-process %ARGS_LNK%
  13. set ARGS_LNK_LOGIN=-cef-in-process-gpu -userchooser %ARGS_LNK%
  14. for /f "tokens=2*" %%R in ('reg query HKCU\SOFTWARE\Valve\Steam /v SteamPath 2^>nul') do for %%A in ("%%~S") do set "STEAM=%%~fA"
  15. set "CEF32=%STEAM%\bin\cef\cef.win7" & set "CEF64=%STEAM%\bin\cef\cef.win7x64"
  16. pushd "%STEAM%\bin\cef" & (for /f "delims=" %%A in ('dir steamwebhelper.exe /a:-D /b /s /oD') do set "CEF=%%~dpA") & popd
  17. if not exist "%CEF64%\steamwebhelper.exe" set "CEF64=%CEF:~0,-1%"
  18. if not exist "%CEF64%\steamwebhelper.exe" if not exist "%CEF32%\steamwebhelper.exe" echo; Steam CEF not found! & pause & exit /b
  19. goto setup
  20.  
  21. :changelog
  22. 2023.07.13: remove -noshaders
  23. 2023.07.17: add --disable-gpu to fix --enable-low-end-device-mode after last steam update
  24. 2023.07.24: add Steam_login shortcut to fix black dialog when auto-login is not used - vgui but disables single-process so +100MB
  25.           : disable useless breakpad reporting process, valve does not give a damn about high memory usage issue
  26. 2023.08.02: rip -vgui and 32bit cef, must use old client for it! this script will help both    
  27.  
  28. :setup
  29. ::# elevate with native shell by AveYo
  30. >nul reg add hkcu\software\classes\.Admin\shell\runas\command /f /ve /d "cmd /x /d /r set \"f0=%%2\"& call \"%%2\" %%3"& set _= %*
  31. >nul fltmc|| if "%f0%" neq "%~f0" (cd.>"%temp%\runas.Admin" & start "%~n0" /high "%temp%\runas.Admin" "%~f0" "%_:"=""%" & exit /b)
  32.  
  33. ::# lean xp+ color macros by AveYo:  %<%:af " hello "%>>%  &  %<%:cf " w\"or\"ld "%>%   for single \ / " use .%|%\  .%|%/  \"%|%\"
  34. for /f "delims=:" %%s in ('echo;prompt $h$s$h:^|cmd /d') do set "|=%%s"&set ">>=\..\c nul&set /p s=%%s%%s%%s%%s%%s%%s%%s<nul&popd"
  35. set "<=pushd "%appdata%"&2>nul findstr /c:\ /a" &set ">=%>>%&echo;" &set "|=%!!|%" &set /p s=\<nul>"%appdata%\c"
  36.  
  37. ::# toggle when launched without arguments, else jump to arguments: "install" or "remove"
  38. set CLI=%*& (set IFEO=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options)
  39. if /i "%CLI%"=="" reg query "%IFEO%\steamwebhelper.exe\0" /v Debugger >nul 2>nul && goto remove || goto install
  40. if /i "%~1"=="install" (goto install) else if /i "%~1"=="remove" goto remove
  41.  
  42. :install
  43. reg add "%IFEO%\steamwebhelper.exe" /f /v UseFilter /d 1 /t reg_dword >nul
  44. reg add "%IFEO%\steamwebhelper.exe\0" /f /v FilterFullPath /d "%CEF64%\steamwebhelper.exe" >nul
  45. reg add "%IFEO%\steamwebhelper.exe\0" /f /v Debugger /d "\"%CEF64%\steamwebhelper_min.exe\" %ARGS_CEF% --ignore=" >nul
  46. reg add "%IFEO%\steamwebhelper.exe\1" /f /v FilterFullPath /d "%CEF32%\steamwebhelper.exe" >nul
  47. reg add "%IFEO%\steamwebhelper.exe\1" /f /v Debugger /d "\"%CEF32%\steamwebhelper_min.exe\" %ARGS_CEF% --ignore=" >nul
  48. reg add "%IFEO%\steamerrorreporter.exe" /f /v UseFilter /d 1 /t reg_dword >nul
  49. reg add "%IFEO%\steamerrorreporter.exe\0" /f /v FilterFullPath /d "%STEAM%\steamerrorreporter.exe" >nul
  50. reg add "%IFEO%\steamerrorreporter.exe\0" /f /v Debugger /d "%SystemRoot%\System32\systray.exe" >nul
  51. reg add "%IFEO%\steamerrorreporter64.exe" /f /v UseFilter /d 1 /t reg_dword >nul
  52. reg add "%IFEO%\steamerrorreporter64.exe\0" /f /v FilterFullPath /d "%STEAM%\steamerrorreporter64.exe" >nul
  53. reg add "%IFEO%\steamerrorreporter64.exe\0" /f /v Debugger /d "%SystemRoot%\System32\systray.exe" >nul
  54. tasklist /fi "imagename eq Steam.exe" | findstr /i Steam.exe >nul && start "s" "%STEAM%\Steam.exe" -shutdown
  55. if not exist "%CEF64%\steamwebhelper_min.exe" mklink /h "%CEF64%\steamwebhelper_min.exe" "%CEF64%\steamwebhelper.exe" >nul
  56. if not exist "%CEF32%\steamwebhelper_min.exe" mklink /h "%CEF32%\steamwebhelper_min.exe" "%CEF32%\steamwebhelper.exe" >nul
  57. set lnk_min1= $l=join-path ([Environment]::GetFolderPath('Desktop')) '\Steam_min.lnk';
  58. set lnk_min2= $s=(new-object -ComObject WScript.Shell).CreateShortcut($l);
  59. set lnk_min3= $s.TargetPath=join-path $env:STEAM '\Steam.exe'; $s.Arguments=$env:ARGS_LNK_MIN; $s.Save();
  60. set lnk_login1= $l=join-path ([Environment]::GetFolderPath('Desktop')) '\Steam_login.lnk';
  61. set lnk_login2= $s=(new-object -ComObject WScript.Shell).CreateShortcut($l);
  62. set lnk_login3= $s.TargetPath=join-path $env:STEAM '\Steam.exe'; $s.Arguments=$env:ARGS_LNK_LOGIN; $s.Save();
  63. powershell -nop -c %lnk_min1% %lnk_min2% %lnk_min3% %lnk_login1% %lnk_login2% %lnk_login3%
  64. echo;
  65. %<%:f0 " steamwebhelper_min 2023.08.02 "%>>% & %<%:2f " INSTALLED "%>>% & %<%:f0 " run again to remove "%>%
  66. if /i "%CLI%"=="" timeout /t 7
  67. exit /b
  68.  
  69. :remove
  70. reg delete "%IFEO%\steamwebhelper.exe" /f >nul 2>nul
  71. reg delete "%IFEO%\steamerrorreporter.exe" /f >nul 2>nul
  72. reg delete "%IFEO%\steamerrorreporter64.exe" /f >nul 2>nul
  73. del /f /q "%CEF32%\steamwebhelper_min.exe" "%CEF64%\steamwebhelper_min.exe"  >nul 2>nul
  74. echo;
  75. %<%:f0 " steamwebhelper_min 2023.08.02 "%>>% & %<%:df " REMOVED "%>>% & %<%:f0 " run again to install "%>%
  76. if /i "%CLI%"=="" timeout /t 7
  77. exit /b
  78.  
  79. '@); $0 = "$env:temp\steamwebhelper_min.bat"; ${(=)||} -split "\r?\n" | out-file $0 -encoding default -force; & $0
  80. # press enter
  81.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement