0
0
mirror of https://github.com/yeongpin/cursor-free-vip.git synced 2025-04-24 08:25:23 +00:00
cursor-free-vip/build.bat
yeongpin d852bcff50 feat: Enhance Multilingual Support and System Language Detection
- Add automatic system language detection for Windows and Unix-like systems
- Update localization files with new translation keys
- Improve language handling in various modules
- Translate more UI messages to English
- Add GitHub link to logo display
- Bump version to 1.4.04
2025-02-25 10:46:36 +08:00

62 lines
1.7 KiB
Batchfile
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@echo off
chcp 65001 > nul
cls
:: Check if running with administrator privileges
net session >nul 2>&1
if %errorLevel% == 0 (
:: If running with administrator privileges, create virtual environment and then run with normal user privileges
if not exist venv (
echo 正在創建虛擬環境...
python -m venv venv
)
:: Run remaining steps with normal user privileges
echo 以普通用戶權限繼續...
powershell -Command "Start-Process -FilePath '%comspec%' -ArgumentList '/c cd /d %cd% && %~f0 run' -Verb RunAs:NO"
exit /b
) else (
:: Check if running in second stage
if "%1"=="run" (
goto RUN_BUILD
) else (
:: If running with normal privileges and creating virtual environment is required, request administrator privileges
if not exist venv (
echo ⚠️ Requires administrator privileges to create virtual environment
echo Requesting administrator privileges...
powershell -Command "Start-Process -Verb RunAs -FilePath '%comspec%' -ArgumentList '/c cd /d %cd% && %~f0'"
exit /b
) else (
goto RUN_BUILD
)
)
)
:RUN_BUILD
echo Starting virtual environment...
call venv\Scripts\activate.bat
if errorlevel 1 (
echo ❌ Failed to start virtual environment
pause
exit /b 1
)
:: Check and install missing dependencies
echo Checking dependencies...
for /f "tokens=1" %%i in (requirements.txt) do (
pip show %%i >nul 2>&1 || (
echo Installing %%i...
pip install %%i
)
)
echo Starting build...
python build.py
if errorlevel 1 (
echo ❌ Build failed
pause
exit /b 1
)
echo ✅ Completed!
pause