12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- @echo off
- ::由于cmd环境的不同,utf8字符集的文件在命令行中执行时中文会出现乱码
- ::因此所有的回显内容都使用英文
- ::CODER BY Mr.Yu POWERD BY iBAT
- ::date: 2022/07/13
- set RegPath=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
- reg query %RegPath% |findstr /c:"Steam App 221100">nul 2>nul
- if %errorlevel% neq 0 (
- goto :findSteamPath
- )
- for /f "tokens=1,2 delims=:" %%i in ('reg query "%RegPath%\Steam App 221100" /v "InstallLocation" ^|find "InstallLocation"') do (
- set desc=From Regedit
- set Device=%%i
- set "DayzPath=%%j"
- )
- set DayzPath=%Device:~-1%:%DayzPath%
- goto :next
- :findSteamPath
- if "%PROCESSOR_ARCHITECTURE%" == "AMD64" (
- set RegPath=HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Valve\Steam
- ) else (
- goto :notFind
- )
- for /f "tokens=3 delims= " %%i in ('reg query "%RegPath%" /v "InstallPath"') do (
- set "SteamPath=%%i"
- )
- set "libraryPath=%SteamPath%\steamapps\libraryfolders.vdf"
- for /f "delims=" %%i in ('type "%libraryPath%" ^|find "path"') do (
- for /f "tokens=2 delims= " %%j in ('echo %%i') do (
- if exist %%j\steamapps\common\DayZ (
- set desc=From config
- set "DayzPath=%%~j\steamapps\common\DayZ"
- goto :next
- )
- )
- )
- goto :notFind
- :next
- set DayzPath=%DayzPath:\\=\%
- @REM echo GamePath = [%desc%: %DayzPath%]
- call .\SetUp.bat "%DayzPath%"
- goto :eof
- :notFind
- cls
- if Exist ".\tmp\dayzInstallPath.tmp" (
- set "DayzPath="
- for /f "delims=" %%i in ('type .\tmp\dayzInstallPath.tmp') do set "DayzPath=%%i"
- goto :continue
- )
- set desc=Get it manually
- echo [No installation directory for DayZ was found, please set it manually!]
- echo.
- @REM 请将dayz的安装目录文件夹拖动到此窗口
- set /p "DayzPath=Please drag and drop the DayZ folder to this window:"
- :continue
- if "%DayzPath%" equ "" (
- echo [Fail]The path is empty, end the run, press any key to exit!
- pause >nul 2>nul
- goto :eof
- ) else if not exist "%DayzPath%" (
- echo [Fail]The path you entered does not exist, please re-enter it!
- choice /t 3 /c ync /d y >nul
- del /F/Q ".\tmp\dayzInstallPath.tmp"
- goto :notFind
- )
- echo %DayzPath%|findstr /E "DayZ" 2>nul >nul
- if %errorlevel% neq 0 (
- echo [Fail]The path you entered is not the game installation directory, please re-enter it!
- choice /t 3 /c ync /d y >nul
- del /F/Q ".\tmp\dayzInstallPath.tmp"
- goto :notFind
- )
- @REM echo [Successful] enjoy it!
- echo %DayzPath%>".\tmp\dayzInstallPath.tmp"
- goto :next
|