@echo off
setlocal enableDelayedExpansion
set exefile=0
set CURRENTPATH=%cd%
for /f "delims=.- tokens=1" %%i in (z_ExeChoosenState) do (set exefile=%%i
findstr /i "!exefile!:" ".\ShaderFixes\z_GameProfileList"
if !errorlevel! EQU 0 goto GameProfileFound)
copy /y ".\ShaderFixes\AUTOHUDUICONFIGS\DEFAULT" ".\ShaderFixes\AutoDepthUIHUD.ini" >nul 2>nul
set DefaultProfileActive=1
goto NoGameProfileFound
:GameProfileFound
set DefaultProfileActive=0
copy /y ".\ShaderFixes\AUTOHUDUICONFIGS\!exefile!" ".\ShaderFixes\AutoDepthUIHUD.ini" >nul 2>nul
cd ShaderFixes
cd AUTOHUDUICONFIGS
cd "!exefile!_FILES"
for /f "delims=" %%i in ('dir /b /a-d *') do copy /y %%i ".\..\..\%%i" >nul 2>nul
cd..
cd..
cd..
set filegroesse=0
cd /d %CURRENTPATH%
cd ShaderFixes
findstr /x /r /i ".*$$.*" "auto_convergence.ini" >nul 2>nul
if !errorlevel! EQU 0 (powershell -Command "(gc '"auto_convergence.ini"') -replace '\$\$', '$' | Out-File -encoding ASCII '"auto_convergence.ini"'")
if not exist .\..\configured (if exist d3dx_user.ini copy /y d3dx_user.ini .\..\d3dx_user.ini >nul 2>nul
echo OK>.\..\configured)
if exist d3dx.ini copy /y d3dx.ini .\..\d3dx.ini >nul 2>nul
if exist d3dxdm.ini copy /y d3dxdm.ini .\..\d3dxdm.ini >nul 2>nul
if exist d3dx_user.ini del /q d3dx_user.ini >nul 2>nul
if exist d3dx.ini del /q d3dx.ini >nul 2>nul
if exist d3dxdm.ini del /q d3dxdm.ini >nul 2>nul
if "%CallFromGeo11Start%" EQU "1" (cd /d %CURRENTPATH%
cd ShaderFixes
findstr /x /r /i ".*$dm_.*" "auto_convergence.ini" >nul 2>nul
if %errorlevel% EQU 0 (powershell -Command "(gc '"auto_convergence.ini"') -replace '\$dm_', 'dm_' | Out-File -encoding ASCII '"auto_convergence.ini"'")
findstr /x /r /i "global.dm_.*" "auto_convergence.ini" >nul 2>nul
if %errorlevel% EQU 0 (powershell -Command "(gc '"auto_convergence.ini"') -replace 'global dm_', ';global dm_' | Out-File -encoding ASCII '"auto_convergence.ini"'")
findstr /x /r /i ";dm_auto_convergence.*" "keys4.ini" >nul 2>nul
if %errorlevel% EQU 0 (powershell -Command "(gc '"keys4.ini"') -replace ';.*m_auto_convergence', 'dm_auto_convergence' | Out-File -encoding ASCII '"keys4.ini"'")
findstr /x /r /i ".*$$.*" "auto_convergence.ini" >nul 2>nul
if !errorlevel! EQU 0 (powershell -Command "(gc '"auto_convergence.ini"') -replace '\$\$', '$' | Out-File -encoding ASCII '"auto_convergence.ini"'")
findstr /x /r /i ";;global.*dm_.*" "auto_convergence.ini" >nul 2>nul
if !errorlevel! EQU 0 (powershell -Command "(gc '"auto_convergence.ini"') -replace ';;global', ';global' | Out-File -encoding ASCII '"auto_convergence.ini"'")
cd..
powershell -Command "(gc '"d3dx.ini"') -replace '.*GET_dm_popout_bias\=dm_popout_bias', '$GET_dm_popout_bias=dm_popout_bias' | Out-File -encoding ASCII '"d3dx.ini"'"
powershell -Command "(gc '"d3dx.ini"') -replace '.*GET_dm_auto_convergence\=dm_auto_convergence', '$GET_dm_auto_convergence=dm_auto_convergence' | Out-File -encoding ASCII '"d3dx.ini"'"
powershell -Command "(gc '"d3dx.ini"') -replace '.*GET_dm_convergence\=dm_convergence', '$GET_dm_convergence=dm_convergence' | Out-File -encoding ASCII '"d3dx.ini"'"
powershell -Command "(gc '"d3dx.ini"') -replace '.*GET_dm_separation\=\$GET_separation', '$GET_dm_separation=$GET_separation' | Out-File -encoding ASCII '"d3dx.ini"'"
powershell -Command "(gc '"d3dx.ini"') -replace '.*m_separation \= \$GET_separation', 'dm_separation = $GET_separation' | Out-File -encoding ASCII '"d3dx.ini"'")
if "%CallFromMIGOTOStart%" EQU "1" (cd /d %CURRENTPATH%
cd ShaderFixes
findstr /x /r /i ".*dm_.*" "auto_convergence.ini" >nul 2>nul
if %errorlevel% EQU 0 (powershell -Command "(gc '"auto_convergence.ini"') -replace 'dm_', '$dm_' | Out-File -encoding ASCII '"auto_convergence.ini"'")
findstr /x /r /i ";global.$dm_.*" "auto_convergence.ini" >nul 2>nul
if %errorlevel% EQU 0 (powershell -Command "(gc '"auto_convergence.ini"') -replace ';global \$dm_', 'global $dm_' | Out-File -encoding ASCII '"auto_convergence.ini"'")
findstr /x /r /i ";global.$$dm_.*" "auto_convergence.ini" >nul 2>nul
if %errorlevel% EQU 0 (powershell -Command "(gc '"auto_convergence.ini"') -replace ';global \$\$dm_', 'global $dm_' | Out-File -encoding ASCII '"auto_convergence.ini"'")
powershell -Command "(gc '"auto_convergence.ini"') -replace '\$\$', '$' | Out-File -encoding ASCII '"auto_convergence.ini"'"
findstr /x /r /i "dm_auto_convergence.*" "keys4.ini" >nul 2>nul
if %errorlevel% EQU 0 (powershell -Command "(gc '"keys4.ini"') -replace 'dm_auto_convergence', ';dm_auto_convergence' | Out-File -encoding ASCII '"keys4.ini"'")
findstr /x /r /i ".*$$.*" "auto_convergence.ini" >nul 2>nul
if !errorlevel! EQU 0 (powershell -Command "(gc '"auto_convergence.ini"') -replace '\$\$', '$' | Out-File -encoding ASCII '"auto_convergence.ini"'")
findstr /x /r /i ";;global.*dm_.*" "auto_convergence.ini" >nul 2>nul
if !errorlevel! EQU 0 (powershell -Command "(gc '"auto_convergence.ini"') -replace ';;global', 'global' | Out-File -encoding ASCII '"auto_convergence.ini"'")
cd..
cd /d %CURRENTPATH%
powershell -Command "(gc '"d3dx.ini"') -replace '.*GET_dm_popout_bias\=dm_popout_bias', ';$GET_dm_popout_bias=dm_popout_bias' | Out-File -encoding default '"d3dx.ini"'"
powershell -Command "(gc '"d3dx.ini"') -replace '.*GET_dm_auto_convergence\=dm_auto_convergence', ';$GET_dm_auto_convergence=dm_auto_convergence' | Out-File -encoding default '"d3dx.ini"'"
powershell -Command "(gc '"d3dx.ini"') -replace '.*GET_dm_convergence\=dm_convergence', ';$GET_dm_convergence=dm_convergence' | Out-File -encoding default '"d3dx.ini"'"
powershell -Command "(gc '"d3dx.ini"') -replace '.*GET_dm_separation\=\$GET_separation', ';$GET_dm_separation=$GET_separation' | Out-File -encoding default '"d3dx.ini"'"
powershell -Command "(gc '"d3dx.ini"') -replace '.*m_separation \= \$GET_separation', ';dm_separation = $GET_separation' | Out-File -encoding default '"d3dx.ini"'")
:NoGameProfileFound
if %DefaultProfileActive% EQU 0 goto SkippChanges
cd /d %CURRENTPATH%
cd ShaderFixes
if "%CallFromGeo11Start%" EQU "1" (
cd /d %CURRENTPATH%
cd ShaderFixes
findstr /x /r /i ".*$dm_.*" "auto_convergence.ini" >nul 2>nul
if %errorlevel% EQU 0 (powershell -Command "(gc '"auto_convergence.ini"') -replace '\$dm_', 'dm_' | Out-File -encoding ASCII '"auto_convergence.ini"'")
findstr /x /r /i "global.dm_.*" "auto_convergence.ini" >nul 2>nul
if %errorlevel% EQU 0 (powershell -Command "(gc '"auto_convergence.ini"') -replace 'global dm_', ';global dm_' | Out-File -encoding ASCII '"auto_convergence.ini"'")
findstr /x /r /i ";dm_auto_convergence.*" "keys4.ini" >nul 2>nul
if %errorlevel% EQU 0 (powershell -Command "(gc '"keys4.ini"') -replace ';.*m_auto_convergence', 'dm_auto_convergence' | Out-File -encoding ASCII '"keys4.ini"'")
findstr /x /r /i ".*$$.*" "auto_convergence.ini" >nul 2>nul
if !errorlevel! EQU 0 (powershell -Command "(gc '"auto_convergence.ini"') -replace '\$\$', '$' | Out-File -encoding ASCII '"auto_convergence.ini"'")
findstr /x /r /i ";;global.*dm_.*" "auto_convergence.ini" >nul 2>nul
if !errorlevel! EQU 0 (powershell -Command "(gc '"auto_convergence.ini"') -replace ';;global', ';global' | Out-File -encoding ASCII '"auto_convergence.ini"'")
cd..
cd /d %CURRENTPATH%
powershell -Command "(gc '"d3dx.ini"') -replace '.*GET_dm_popout_bias\=dm_popout_bias', '$GET_dm_popout_bias=dm_popout_bias' | Out-File -encoding ASCII '"d3dx.ini"'"
powershell -Command "(gc '"d3dx.ini"') -replace '.*GET_dm_auto_convergence\=dm_auto_convergence', '$GET_dm_auto_convergence=dm_auto_convergence' | Out-File -encoding ASCII '"d3dx.ini"'"
powershell -Command "(gc '"d3dx.ini"') -replace '.*GET_dm_convergence\=dm_convergence', '$GET_dm_convergence=dm_convergence' | Out-File -encoding ASCII '"d3dx.ini"'"
powershell -Command "(gc '"d3dx.ini"') -replace '.*GET_dm_separation\=\$GET_separation', '$GET_dm_separation=$GET_separation' | Out-File -encoding ASCII '"d3dx.ini"'"
powershell -Command "(gc '"d3dx.ini"') -replace '.*m_separation \= \$GET_separation', 'dm_separation = $GET_separation' | Out-File -encoding ASCII '"d3dx.ini"'")
if "%CallFromMIGOTOStart%" EQU "1" (
cd /d %CURRENTPATH%
cd ShaderFixes
findstr /x /r /i ".*dm_.*" "auto_convergence.ini" >nul 2>nul
if %errorlevel% EQU 0 (powershell -Command "(gc '"auto_convergence.ini"') -replace 'dm_', '$dm_' | Out-File -encoding ASCII '"auto_convergence.ini"'")
findstr /x /r /i ";global.$dm_.*" "auto_convergence.ini" >nul 2>nul
if %errorlevel% EQU 0 (powershell -Command "(gc '"auto_convergence.ini"') -replace ';global \$dm_', 'global $dm_' | Out-File -encoding ASCII '"auto_convergence.ini"'")
findstr /x /r /i ";global.$$dm_.*" "auto_convergence.ini" >nul 2>nul
if %errorlevel% EQU 0 (powershell -Command "(gc '"auto_convergence.ini"') -replace ';global \$\$dm_', 'global $dm_' | Out-File -encoding ASCII '"auto_convergence.ini"'")
powershell -Command "(gc '"auto_convergence.ini"') -replace '\$\$', '$' | Out-File -encoding ASCII '"auto_convergence.ini"'"
findstr /x /r /i "dm_auto_convergence.*" "keys4.ini" >nul 2>nul
if %errorlevel% EQU 0 (powershell -Command "(gc '"keys4.ini"') -replace 'dm_auto_convergence', ';dm_auto_convergence' | Out-File -encoding ASCII '"keys4.ini"'")
findstr /x /r /i ".*$$.*" "auto_convergence.ini" >nul 2>nul
if !errorlevel! EQU 0 (powershell -Command "(gc '"auto_convergence.ini"') -replace '\$\$', '$' | Out-File -encoding ASCII '"auto_convergence.ini"'")
findstr /x /r /i ";;global.*dm_.*" "auto_convergence.ini" >nul 2>nul
if !errorlevel! EQU 0 (powershell -Command "(gc '"auto_convergence.ini"') -replace ';;global', 'global' | Out-File -encoding ASCII '"auto_convergence.ini"'")
cd..
cd /d %CURRENTPATH%
powershell -Command "(gc '"d3dx.ini"') -replace '.*GET_dm_popout_bias\=dm_popout_bias', ';$GET_dm_popout_bias=dm_popout_bias' | Out-File -encoding default '"d3dx.ini"'"
powershell -Command "(gc '"d3dx.ini"') -replace '.*GET_dm_auto_convergence\=dm_auto_convergence', ';$GET_dm_auto_convergence=dm_auto_convergence' | Out-File -encoding default '"d3dx.ini"'"
powershell -Command "(gc '"d3dx.ini"') -replace '.*GET_dm_convergence\=dm_convergence', ';$GET_dm_convergence=dm_convergence' | Out-File -encoding default '"d3dx.ini"'"
powershell -Command "(gc '"d3dx.ini"') -replace '.*GET_dm_separation\=\$GET_separation', ';$GET_dm_separation=$GET_separation' | Out-File -encoding default '"d3dx.ini"'"
powershell -Command "(gc '"d3dx.ini"') -replace '.*m_separation \= \$GET_separation', ';dm_separation = $GET_separation' | Out-File -encoding default '"d3dx.ini"'")
:SkippChanges
findstr /x /r /i "\$\\shaderfixes\\auto_convergence\.ini\\auto_convergence_enableddm.=.1" "d3dx_user.ini" >nul 2>nul
if %errorlevel% EQU 0 echo DMAC_chain>DMAC_chain
if NOT exist geo11_chain if exist DMAC_chain (
powershell -Command "(gc '"d3dx_user.ini"') -replace '\$\\shaderfixes\\auto_convergence\.ini\\auto_convergence_enableddm \= 1', '$\shaderfixes\auto_convergence.ini\auto_convergence_enableddm = 0' | Out-File -encoding ASCII '"d3dx_user.ini"'"
powershell -Command "(gc '"d3dx_user.ini"') -replace '\$\\shaderfixes\\auto_convergence\.ini\\auto_convergence_enabled \= 0', '$\shaderfixes\auto_convergence.ini\auto_convergence_enabled = 1' | Out-File -encoding ASCII '"d3dx_user.ini"'"
)
if exist geo11_chain if exist DMAC_chain (
powershell -Command "(gc '"d3dx_user.ini"') -replace '\$\\shaderfixes\\auto_convergence\.ini\\auto_convergence_enableddm \= 0', '$\shaderfixes\auto_convergence.ini\auto_convergence_enableddm = 1' | Out-File -encoding ASCII '"d3dx_user.ini"'"
powershell -Command "(gc '"d3dx_user.ini"') -replace '\$\\shaderfixes\\auto_convergence\.ini\\auto_convergence_enabled \= 1', '$\shaderfixes\auto_convergence.ini\auto_convergence_enabled = 0' | Out-File -encoding ASCII '"d3dx_user.ini"'"
)
