Skip to content

Commit 726380e

Browse files
authored
EasyInstaller bat added (soxoj#1212)
1 parent 90599ea commit 726380e

File tree

1 file changed

+128
-0
lines changed

1 file changed

+128
-0
lines changed

Installer.bat

+128
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
@echo off
2+
3+
REM check if running as admin
4+
5+
goto check_Permissions
6+
7+
:check_Permissions
8+
echo Administrative permissions required. Detecting permissions...
9+
10+
net session >nul 2>&1
11+
if %errorLevel% == 0 (
12+
goto 1
13+
) else (
14+
cls
15+
echo Failure: You MUST run this as administator, otherwise commands will fail.
16+
)
17+
18+
pause >nul
19+
20+
21+
22+
REM Step 2: Check if Python and pip3 are installed
23+
python --version >nul 2>&1
24+
if %errorlevel% neq 0 (
25+
echo Python is not installed. Please install Python 3.8 or higher.
26+
pause
27+
exit /b
28+
)
29+
30+
pip3 --version >nul 2>&1
31+
if %errorlevel% neq 0 (
32+
echo pip3 is not installed. Please install pip3.
33+
pause
34+
exit /b
35+
)
36+
37+
REM Step 3: Check Python version
38+
python -c "import sys; exit(0) if sys.version_info >= (3,8) else exit(1)"
39+
if %errorlevel% neq 0 (
40+
echo Python version 3.8 or higher is required.
41+
pause
42+
exit /b
43+
)
44+
45+
46+
:1
47+
cls
48+
:::===============================================================
49+
::: ______ __ __ _ _
50+
::: | ____| | \/ | (_) | |
51+
::: | |__ __ _ ___ _ _ | \ / | __ _ _ __ _ _ __ ___| |_
52+
::: | __| / _` / __| | | | | |\/| |/ _` | |/ _` | '__/ _ \ __|
53+
::: | |___| (_| \__ \ |_| | | | | | (_| | | (_| | | | __/ |_
54+
::: |______\__,_|___/\__, | |_| |_|\__,_|_|\__, |_| \___|\__|
55+
::: __/ | __/ |
56+
::: |___/ |___/
57+
:::
58+
:::===============================================================
59+
echo.
60+
for /f "delims=: tokens=*" %%A in ('findstr /b ::: "%~f0"') do @echo(%%A
61+
echo.
62+
echo ----------------------------------------------------------------
63+
echo Python 3.8 or higher and pip3 required.
64+
echo ----------------------------------------------------------------
65+
echo Press [I] to begin installation.
66+
echo Press [R] If already installed.
67+
echo ----------------------------------------------------------------
68+
choice /c IR
69+
if %errorlevel%==1 goto install1
70+
if %errorlevel%==2 goto after
71+
72+
:install1
73+
cls
74+
echo ========================================================
75+
echo Maigret Installation Script
76+
echo ========================================================
77+
echo.
78+
echo --------------------------------------------------------
79+
echo If your pip installation is outdated, it could cause
80+
echo cryptography to fail on installation.
81+
echo --------------------------------------------------------
82+
echo check for and install pip updates now?
83+
echo --------------------------------------------------------
84+
choice /c YN
85+
if %errorlevel%==1 goto install2
86+
if %errorlevel%==2 goto install3
87+
88+
:install2
89+
cls
90+
python -m pip install --upgrade pip
91+
goto:install3
92+
93+
:install3
94+
cls
95+
echo ========================================================
96+
echo Maigret Installation Script
97+
echo ========================================================
98+
echo.
99+
echo --------------------------------------------------------
100+
echo Install requirements and maigret?
101+
echo --------------------------------------------------------
102+
choice /c YN
103+
if %errorlevel%==1 goto install4
104+
if %errorlevel%==2 goto 1
105+
106+
:install4
107+
cls
108+
pip install -r requirements.txt
109+
pip install maigret
110+
goto:after
111+
112+
:after
113+
cls
114+
echo ========================================================
115+
echo Maigret Background Search
116+
echo ========================================================
117+
echo.
118+
echo --------------------------------------------------------
119+
echo Please Enter Username / Email
120+
echo --------------------------------------------------------
121+
set /p input=
122+
maigret %input%
123+
echo.
124+
echo.
125+
echo.
126+
echo.
127+
pause
128+
goto:after

0 commit comments

Comments
 (0)