
@echo off
ver|findstr "[^0-9.]5\.0\." > NUL && goto TAB_Win2K
ver|findstr "[^0-9.]5\.1\." > NUL && goto TAB_WinXP
ver|findstr "[^0-9.]5\.2\." > NUL && goto TAB_WinXP_64Bit
ver|findstr "[^0-9.]6\.0\." > NUL && goto TAB_WinVista

for /f "tokens=1,2,*" %%a in ('reg query "HKEY_CURRENT_USER\Software\LAND\LANDCore\Information" ^| find /i "RunDir"') do set CoreDir=%%c
for /f "tokens=1,2,*" %%a in ('reg query "HKEY_CURRENT_USER\Software\LAND\LANDCore\Information" ^| find /i "VersionStr"') do set CoreVer=%%c
echo.

if "%CoreDir:~-1%" NEQ "\"  (
  echo 未找到默认的的目标路径，启用备用的目标路径[for LANDdt]
  for /f "tokens=1,2,*" %%a in ('reg query "HKEY_CURRENT_USER\Software\LAND\LANDdt\Information" ^| find /i "RunDir"') do set CoreDir=%%c
  set CoreVer=\
)

echo 请核对目标路径：%CoreDir%
echo       当前版本：%CoreVer%
echo.

if "%CoreDir:~-1%" NEQ "\"  (echo   目标路径异常 & goto TAB_Err )
if "%CoreDir%"=="%CD%"      (echo   当前路径与目标路径重合 & goto TAB_Err )
if "%CoreDir%"=="%CD%\"     (echo   当前路径与目标路径重合 & goto TAB_Err )

@rem --------------------

if NOT exist "%CoreDir%"    (echo   目标路径不存在 & goto TAB_Err )

echo 按任意键开始升级... & pause>nul
echo.

echo 正在升级中，请稍等... 
echo.

Tools\LANDBoy.exe -UPGY -VER1
@rem start "" "Tools\LANDBoy.exe" -UPGY -VER1

:TAB_End
echo 升级结束，升级结果请查看LANDBoy.log
echo.
echo 结束. 按任意键退出... & pause>nul
goto:eof

@rem -------------------------------------------------------------------

:TAB_Err
echo.
echo 失败! 按任意键退出... & pause>nul
goto:eof

@rem -------------------------------------------------------------------

:TAB_Win2K
:TAB_WinXP
:TAB_WinXP_64Bit
:TAB_WinVista
echo.
ver
echo Windows版本过低；请选择 Windows 7(含) 以上的系统。 按任意键退出... & pause>nul

@rem -------------------------------------------------------------------
