@echo off
chcp 65001 >nul
title VC 运行库检测工具
echo.
echo ╔══════════════════════════════════════╗
echo ║    Visual C++ 运行库 检测工具        ║
echo ╚══════════════════════════════════════╝
echo.
echo 正在检测...

set FOUND=0

reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" /s /f "Microsoft Visual C++ 2015-2022 Redistributable" 2>nul | findstr /i "DisplayName" >nul
if %errorlevel%==0 set FOUND=1

reg query "HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall" /s /f "Microsoft Visual C++ 2015-2022 Redistributable" 2>nul | findstr /i "DisplayName" >nul
if %errorlevel%==0 set FOUND=1

if %FOUND%==1 (
    echo.
    echo ✅ 已安装 Microsoft Visual C++ 运行库！
    echo    软件可以正常运行。
    echo.
) else (
    echo.
    echo ❌ 未检测到 VC 运行库！
    echo    软件将无法启动，请下载安装。
    echo.
    echo 下载地址：
    echo https://aka.ms/vs/17/release/vc_redist.x64.exe
    echo.
    start https://aka.ms/vs/17/release/vc_redist.x64.exe
)

echo 按任意键关闭...
pause >nul
