mirror of
https://github.com/soxoj/maigret.git
synced 2026-05-06 22:19:01 +00:00
Update Installer.bat (#1994)
Greatly improved the installer overall and fixed issue of newer versions of pip not installing packages
This commit is contained in:
+68
-78
@@ -1,85 +1,61 @@
|
|||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
REM check if running as admin
|
|
||||||
|
|
||||||
goto check_Permissions
|
goto check_Permissions
|
||||||
|
|
||||||
:check_Permissions
|
:check_Permissions
|
||||||
echo Administrative permissions required. Detecting permissions...
|
|
||||||
|
|
||||||
net session >nul 2>&1
|
net session >nul 2>&1
|
||||||
if %errorLevel% == 0 (
|
if %errorLevel% == 0 (
|
||||||
goto 1
|
echo Success: Elevated permissions granted.
|
||||||
) else (
|
) else (
|
||||||
cls
|
echo Failure: Requires elevated permissions.
|
||||||
echo Failure: You MUST run this as administator, otherwise commands will fail.
|
pause >nul
|
||||||
)
|
)
|
||||||
|
|
||||||
pause >nul
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
REM Step 2: Check if Python and pip3 are installed
|
|
||||||
python --version >nul 2>&1
|
|
||||||
if %errorlevel% neq 0 (
|
|
||||||
echo Python is not installed. Please install Python 3.8 or higher.
|
|
||||||
pause
|
|
||||||
exit /b
|
|
||||||
)
|
|
||||||
|
|
||||||
pip3 --version >nul 2>&1
|
|
||||||
if %errorlevel% neq 0 (
|
|
||||||
echo pip3 is not installed. Please install pip3.
|
|
||||||
pause
|
|
||||||
exit /b
|
|
||||||
)
|
|
||||||
|
|
||||||
REM Step 3: Check Python version
|
|
||||||
python -c "import sys; exit(0) if sys.version_info >= (3,8) else exit(1)"
|
|
||||||
if %errorlevel% neq 0 (
|
|
||||||
echo Python version 3.8 or higher is required.
|
|
||||||
pause
|
|
||||||
exit /b
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
:1
|
|
||||||
cls
|
cls
|
||||||
:::===============================================================
|
echo --------------------------------------------------------
|
||||||
::: ______ __ __ _ _
|
|
||||||
::: | ____| | \/ | (_) | |
|
|
||||||
::: | |__ __ _ ___ _ _ | \ / | __ _ _ __ _ _ __ ___| |_
|
|
||||||
::: | __| / _` / __| | | | | |\/| |/ _` | |/ _` | '__/ _ \ __|
|
|
||||||
::: | |___| (_| \__ \ |_| | | | | | (_| | | (_| | | | __/ |_
|
|
||||||
::: |______\__,_|___/\__, | |_| |_|\__,_|_|\__, |_| \___|\__|
|
|
||||||
::: __/ | __/ |
|
|
||||||
::: |___/ |___/
|
|
||||||
:::
|
|
||||||
:::===============================================================
|
|
||||||
echo.
|
|
||||||
for /f "delims=: tokens=*" %%A in ('findstr /b ::: "%~f0"') do @echo(%%A
|
|
||||||
echo.
|
|
||||||
echo ----------------------------------------------------------------
|
|
||||||
echo Python 3.8 or higher and pip3 required.
|
echo Python 3.8 or higher and pip3 required.
|
||||||
echo ----------------------------------------------------------------
|
echo --------------------------------------------------------
|
||||||
echo Press [I] to begin installation.
|
echo Press [I] to begin installation.
|
||||||
echo Press [R] If already installed.
|
echo Press [R] If already installed.
|
||||||
echo ----------------------------------------------------------------
|
echo --------------------------------------------------------
|
||||||
choice /c IR
|
choice /c IR
|
||||||
if %errorlevel%==1 goto install1
|
if %errorlevel%==1 goto check_python
|
||||||
if %errorlevel%==2 goto after
|
if %errorlevel%==2 goto after
|
||||||
|
|
||||||
|
:check_python
|
||||||
|
cls
|
||||||
|
for /f "tokens=2 delims= " %%i in ('python --version 2^>nul') do (
|
||||||
|
for /f "tokens=1,2 delims=." %%j in ("%%i") do (
|
||||||
|
if %%j GEQ 3 (
|
||||||
|
if %%k GEQ 8 (
|
||||||
|
goto check_pip
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
echo Python 3.8 or higher is required. Please install it first.
|
||||||
|
pause
|
||||||
|
exit /b
|
||||||
|
|
||||||
|
:check_pip
|
||||||
|
pip --version 2>nul | findstr /r /c:"pip" >nul
|
||||||
|
if %errorlevel% neq 0 (
|
||||||
|
echo pip is required. Please install it first.
|
||||||
|
pause
|
||||||
|
exit /b
|
||||||
|
)
|
||||||
|
goto install1
|
||||||
|
|
||||||
:install1
|
:install1
|
||||||
cls
|
cls
|
||||||
echo ========================================================
|
echo ========================================================
|
||||||
echo Maigret Installation Script
|
echo Maigret Installation
|
||||||
echo ========================================================
|
echo ========================================================
|
||||||
echo.
|
echo.
|
||||||
echo --------------------------------------------------------
|
echo --------------------------------------------------------
|
||||||
echo If your pip installation is outdated, it could cause
|
echo If your pip installation is outdated, it could cause
|
||||||
echo cryptography to fail on installation.
|
echo cryptography to fail on installation.
|
||||||
echo --------------------------------------------------------
|
echo --------------------------------------------------------
|
||||||
echo check for and install pip updates now?
|
echo Check for and install pip 23.3.2 now?
|
||||||
echo --------------------------------------------------------
|
echo --------------------------------------------------------
|
||||||
choice /c YN
|
choice /c YN
|
||||||
if %errorlevel%==1 goto install2
|
if %errorlevel%==1 goto install2
|
||||||
@@ -87,42 +63,56 @@ if %errorlevel%==2 goto install3
|
|||||||
|
|
||||||
:install2
|
:install2
|
||||||
cls
|
cls
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip==23.3.2
|
||||||
goto:install3
|
if %errorlevel% neq 0 (
|
||||||
|
echo Failed to update pip to version 23.3.2. Please check your installation.
|
||||||
|
pause
|
||||||
|
exit /b
|
||||||
|
)
|
||||||
|
goto install3
|
||||||
|
|
||||||
:install3
|
:install3
|
||||||
cls
|
cls
|
||||||
echo ========================================================
|
echo ========================================================
|
||||||
echo Maigret Installation Script
|
echo Maigret Installation
|
||||||
echo ========================================================
|
echo ========================================================
|
||||||
echo.
|
echo.
|
||||||
echo --------------------------------------------------------
|
echo --------------------------------------------------------
|
||||||
echo Install requirements and maigret?
|
echo Installing Maigret...
|
||||||
echo --------------------------------------------------------
|
python -m pip install maigret
|
||||||
choice /c YN
|
if %errorlevel% neq 0 (
|
||||||
if %errorlevel%==1 goto install4
|
echo Failed to install Maigret. Please check your installation.
|
||||||
if %errorlevel%==2 goto 1
|
pause
|
||||||
|
exit /b
|
||||||
:install4
|
)
|
||||||
cls
|
echo.
|
||||||
pip install .
|
echo +------------------------------------------------------+
|
||||||
pip install maigret
|
echo Maigret installed successfully.
|
||||||
goto:after
|
echo +------------------------------------------------------+
|
||||||
|
pause
|
||||||
|
goto after
|
||||||
|
|
||||||
:after
|
:after
|
||||||
cls
|
cls
|
||||||
echo ========================================================
|
echo ========================================================
|
||||||
echo Maigret Background Search
|
echo Maigret Usage
|
||||||
echo ========================================================
|
echo ========================================================
|
||||||
echo.
|
echo.
|
||||||
echo --------------------------------------------------------
|
echo +--------------------------------------------------------+
|
||||||
echo Please Enter Username / Email
|
echo To use Maigret, you can run the following command:
|
||||||
echo --------------------------------------------------------
|
|
||||||
set /p input=
|
|
||||||
maigret %input%
|
|
||||||
echo.
|
echo.
|
||||||
|
echo maigret [options] [username]
|
||||||
echo.
|
echo.
|
||||||
|
echo For example, to search for a username:
|
||||||
echo.
|
echo.
|
||||||
|
echo maigret example_username
|
||||||
echo.
|
echo.
|
||||||
|
echo For more options and usage details, refer to the Maigret documentation.
|
||||||
|
echo.
|
||||||
|
echo https://github.com/soxoj/maigret/blob/5b3b81b4822f6deb2e9c31eb95039907f25beb5e/README.md
|
||||||
|
echo +--------------------------------------------------------+
|
||||||
|
echo.
|
||||||
|
cmd
|
||||||
pause
|
pause
|
||||||
goto:after
|
exit /b
|
||||||
|
exit /b
|
||||||
|
|||||||
Reference in New Issue
Block a user