This repository was archived by the owner on Aug 25, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.bat
More file actions
40 lines (35 loc) · 1.32 KB
/
Copy pathinstall.bat
File metadata and controls
40 lines (35 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
@echo off
chcp 65001 > nul
setlocal enabledelayedexpansion
REM ============================================================
REM CK's Pi Code Agent Harness - Flagship Bootstrapper (v3.7.2)
REM Trust / License: MIT licensed open-source project.
REM ============================================================
echo [1/3] Checking environment...
REM --- 1. Find Python ---
python --version >nul 2>&1
if %errorlevel% neq 0 (
echo [!] 找不到 Python。請先安裝 Python 並加入 PATH。
pause
exit /b 1
)
echo [2/3] Confirming installation...
set /p confirm="Continue? (Y/n): "
if /i "!confirm!"=="n" (
echo [*] 已取消安裝。
exit /b 0
)
echo [3/3] Elevating privileges if required...
REM --- 2. Admin Check & Self-Elevation ---
REM Quote the script path (repo may live under a path with spaces), keep the
REM elevated window open (cmd /k) so errors stay visible, and pin the working
REM directory (elevated processes otherwise start in System32).
net session >nul 2>&1
if %errorlevel% neq 0 (
echo [*] 正在請求管理員權限以確保安裝順利...
powershell -Command "Start-Process -FilePath 'cmd.exe' -ArgumentList '/k', 'chcp 65001 >nul && python \"%~dp0scripts\setup.py\"' -WorkingDirectory '%~dp0.' -Verb RunAs"
exit /b 0
)
REM --- 3. Run Setup Brain ---
python "%~dp0scripts\setup.py"
pause