Created
November 19, 2019 14:58
-
-
Save M0r13n/0bb715d3fd721e2e5a7075dd47dc6dfd to your computer and use it in GitHub Desktop.
Install a Python project offline without any internet connection.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
:: Basic welcome message | |
echo Dieses Skript wird die grundlegenden Bestandteile installieren. | |
echo Nach der Installation sollte sich das Programm ohne Probleme nutzen lassen. | |
echo. | |
:: Are you sure prompt | |
setlocal | |
:PROMPT | |
SET /P AREYOUSURE=Möchtest du mit der Installation beginnen (Y/[N])? | |
IF /I "%AREYOUSURE%" NEQ "Y" GOTO EOF | |
endlocal | |
:: Check if Python is installed | |
>nul 2>nul assoc .py && echo [32mPython ist installiert![0m || (echo [31mPython scheint nicht installiert zu sein[0m & GOTO ERROR_EXIT) | |
:: Install virtualenv | |
if exist %cd%\ext\virtualenv\virtualenv-*.whl ( | |
echo Instllationsdatei feur Virtualenv gefunden. Starte installation. | |
for /F "usebackq delims=" %%A in (`where /r %cd%\ext\virtualenv *.whl`) do pip install %%A || echo [Virtualenv konnte nicht installiert werden.[0m | |
) else ( | |
echo [31m Die Installationsdatei fuer Virtualenv fehlt.[0m | |
goto ERROR_EXIT | |
) | |
echo [32mVirtualenv erfolgreich installiert![0m | |
:: Create a new Virtual environment with offline packages provided by venv | |
virtualenv --extra-search-dir %cd%\ext\virtualenv\ --no-download venv || goto ERROR_EXIT | |
echo [32mVirtuelle Umgebung erfolgreich erstellt![0m | |
:: Finally install jira and all of it's dependencies offline into the newly created virtual environment | |
CALL %cd%\venv\Scripts\activate.bat || ([31mVirtuelle Umgebung konnte nicht aktiviert werden!.[0m & goto ERROR_EXIT ) | |
echo [32mVirtuelle Umgebung erfolgreich aktiviert![0m | |
pip install --no-index --find-links %cd%\ext\dependencies -r requirements.txt | |
:NORMAL_EXIT | |
echo [32mInstallation erfolgreich[0m | |
Pause | |
goto EOF | |
:ERROR_EXIT | |
echo [31mAutomate Jira konnte nicht installiert werden.[0m | |
Pause | |
goto EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment