-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwindows.bat
More file actions
65 lines (51 loc) · 1.86 KB
/
windows.bat
File metadata and controls
65 lines (51 loc) · 1.86 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
57
58
59
60
61
62
63
64
65
@echo off
REM --- Remote Linux Manager Startup (Windows Self-Fixing Launcher) ---
REM
REM ** NOTE : Python MUST be installed to run this tool **
REM ** Python can be installed from :- **
REM ** https://www.python.org/downloads/windows/ **
REM
SET SCRIPT_DIR=%~dp0
SET SCRIPT_NAME=manager.py
CLS
ECHO --- Remote Linux Manager Startup for Windows ---
ECHO.
REM 1. Check if the Python Launcher (py) is available.
py -h >nul 2>&1
IF ERRORLEVEL 1 GOTO PYTHON_NOT_FOUND
REM 2. Check if required packages are installed. We only need to check for one (paramiko).
ECHO [INFO] Checking for required Python packages (paramiko, cryptography)...
REM 'pip show' command returns ERRORLEVEL 0 if found, 1 if not.
py -m pip show paramiko >nul 2>&1
IF ERRORLEVEL 0 (
ECHO [SUCCESS] Packages are already installed.
GOTO LAUNCH_APP
)
REM 3. Install packages if not found (ERRORLEVEL was 1)
ECHO [WARNING] Packages not found. Attempting to auto-install: paramiko, cryptography
ECHO.
ECHO --- Starting Package Installation via pip ---
ECHO.
REM Run the installation command
py -m pip install paramiko cryptography
IF ERRORLEVEL 1 (
ECHO.
ECHO [FATAL] Installation failed!
ECHO Please check your internet connection and ensure your user has permission to install packages.
GOTO APP_FINISHED
)
ECHO [SUCCESS] Packages installed successfully!
:LAUNCH_APP
ECHO.
ECHO [INFO] Launching %SCRIPT_NAME%...
CALL py "%SCRIPT_DIR%%SCRIPT_NAME%"
GOTO APP_FINISHED
:PYTHON_NOT_FOUND
ECHO.
ECHO [FATAL] The Python Launcher ('py' command) was not found.
ECHO This usually means Python is not installed.
ECHO Please install Python 3 from www.python.org/downloads/windows/ (and ensure 'Add Python to PATH' is checked).
:APP_FINISHED
ECHO.
ECHO Script finished. Press any key to close this window.
PAUSE > nul