-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInstall.bat
More file actions
56 lines (48 loc) · 1.22 KB
/
Copy pathInstall.bat
File metadata and controls
56 lines (48 loc) · 1.22 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
@echo off
setlocal enabledelayedexpansion
cd /d "%~dp0"
:: Check Git
git --version >nul 2>&1
if %errorlevel% NEQ 0 (
echo Error: Git is not installed or not in PATH.
pause
exit /B 1
)
:: Pull latest
echo Pulling latest updates...
git pull
if %errorlevel% NEQ 0 (
echo Error: git pull failed.
pause
exit /B 1
)
:: Check Python
python --version >nul 2>&1
if %errorlevel% NEQ 0 (
echo Error: Python is not installed or not in PATH.
pause
exit /B 1
)
:: Install deps
echo Installing dependencies...
python -m pip install -r requirements.txt
if %errorlevel% NEQ 0 (
echo Error: pip install failed.
pause
exit /B 1
)
:: Desktop shortcut
echo.
set /p CREATE_SHORTCUT="Create a Desktop Shortcut? (y/n): "
if /i "%CREATE_SHORTCUT%" NEQ "y" goto Done
powershell -ExecutionPolicy Bypass -Command "$ws = New-Object -ComObject WScript.Shell; $s = $ws.CreateShortcut([IO.Path]::Combine([Environment]::GetFolderPath('Desktop'), 'WinFunct.lnk')); $s.TargetPath = '%~dp0Run.bat'; $s.WorkingDirectory = '%~dp0'; $s.IconLocation = '%~dp0WinFunct.ico'; $s.Save()"
if %errorlevel% NEQ 0 (
echo Failed to create shortcut.
) else (
echo Shortcut created.
)
:Done
echo.
echo Installation complete.
pause
exit /B 0