| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- @echo off
- setlocal enabledelayedexpansion
- cd /d "%~dp0"
- echo ========================================
- echo Game Configuration Tool - Auto Deploy
- echo ========================================
- echo.
- echo This script will automatically:
- echo 1. Check Python environment
- echo 2. Install required dependencies
- echo 3. Launch configuration tool
- echo.
- echo Starting deployment...
- echo.
- :: Check Python environment
- echo [Step 1/3] Checking Python environment...
- echo.
- set PYTHON_CMD=
- for %%i in (python py python3) do (
- %%i --version >nul 2>&1
- if !errorlevel! equ 0 (
- set PYTHON_CMD=%%i
- goto :python_found
- )
- )
- echo [ERROR] Python not found!
- echo Please visit https://www.python.org/downloads/ to install Python
- echo Make sure to check "Add Python to PATH" during installation
- echo.
- goto :error_exit
- :python_found
- echo [SUCCESS] Python environment check passed
- %PYTHON_CMD% --version
- echo.
- :: Check dependencies
- echo [Step 2/3] Checking and installing dependencies...
- echo.
- :: Check pandas
- echo Checking pandas...
- %PYTHON_CMD% -c "import pandas" >nul 2>&1
- if errorlevel 1 (
- echo pandas not found, installing...
- %PYTHON_CMD% -m pip install pandas>=1.3.0
- if errorlevel 1 (
- echo [ERROR] pandas installation failed! Trying Chinese mirror...
- %PYTHON_CMD% -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pandas>=1.3.0
- if errorlevel 1 (
- echo [ERROR] Failed to install pandas!
- goto :error
- )
- )
- echo [SUCCESS] pandas installed
- ) else (
- echo [SUCCESS] pandas already installed
- )
- :: Check openpyxl
- echo Checking openpyxl...
- %PYTHON_CMD% -c "import openpyxl" >nul 2>&1
- if errorlevel 1 (
- echo openpyxl not found, installing...
- %PYTHON_CMD% -m pip install openpyxl>=3.0.0
- if errorlevel 1 (
- echo [ERROR] openpyxl installation failed! Trying Chinese mirror...
- %PYTHON_CMD% -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple openpyxl>=3.0.0
- if errorlevel 1 (
- echo [ERROR] Failed to install openpyxl!
- goto :error
- )
- )
- echo [SUCCESS] openpyxl installed
- ) else (
- echo [SUCCESS] openpyxl already installed
- )
- echo.
- echo [SUCCESS] All dependencies check completed!
- echo.
- :: Launch configuration tool
- echo [Step 3/3] Launching configuration tool...
- echo.
- if not exist "config_manager.py" (
- echo [ERROR] config_manager.py file not found!
- echo Please make sure to run this script in the correct directory
- pause
- exit /b 1
- )
- echo Starting configuration management tool...
- echo.
- echo ========================================
- echo Tool started successfully! Please operate in the popup window
- echo ========================================
- echo.
- echo Instructions:
- echo 1. Select Excel configuration files on the left
- echo 2. Click "Preview Selected Files" to view content
- echo 3. Click "Import Configuration" to complete data import
- echo.
- echo Closing this window will also close the configuration tool
- echo.
- %PYTHON_CMD% config_manager.py
- echo.
- echo Configuration tool closed
- pause
- exit /b 0
- :error
- echo.
- echo ========================================
- echo [ERROR] Deployment failed!
- echo ========================================
- echo.
- echo Possible solutions:
- echo 1. Check network connection
- echo 2. Manual installation:
- echo %PYTHON_CMD% -m pip install pandas openpyxl
- echo 3. Use Chinese mirror:
- echo %PYTHON_CMD% -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pandas openpyxl
- echo 4. Contact technical support
- echo.
- pause
- exit /b 1
- :error_exit
- pause
- exit /b 1
|