forked from tonywu7/feedly-link-aggregator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.bat
67 lines (53 loc) · 1.82 KB
/
install.bat
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
66
67
@echo off
setlocal
setlocal enabledelayedexpansion
echo Installing dependencies...
echo.
python3 -c "exit(65)" > NUL 2>&1
if %ERRORLEVEL% neq 65 (
echo Error: Python 3 not found.
echo Install Python 3 from Microsoft Store, or from https://www.python.org/downloads/release/python-386/
pause
exit 1
)
echo Installing Twisted...
python3 -m pip install Twisted[windows_platform] > NUL 2>&1
if %ERRORLEVEL% neq 0 (
echo Error: failed to install Twisted.
echo Retrying with pre-built binaries...
echo.
reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && set OSVER=32 || set OSVER=_amd64
for /f "delims=" %%i in ('python3 -c "import sys; v = sys.version_info; ver = \"cp\" + str(v[0]) + str(v[1]); print(ver + \"-\" + ver + \"m\" if ver == \"cp37\" else ver + \"-\" + ver)"') do set PYVER=%%i
set ERROR=0
set WHEEL=Twisted-20.3.0-!PYVER!-win!OSVER!.whl
set URL=https://github.com/tonywu7/feedly-link-aggregator/raw/vendor/_wheels/!WHEEL!
echo Downloading !URL!
powershell -Command "(New-Object Net.WebClient).DownloadFile('!URL!', '%CD%\!WHEEL!')"
if !ERRORLEVEL! neq 0 (
echo Fatal: No pre-built binary exists for this Python/Windows version.
set ERROR=1
)
if !ERROR! == 0 (
echo Installing...
python3 -m pip install "%CD%\!WHEEL!" > NUL 2>&1
)
if !ERRORLEVEL! neq 0 (
echo Fatal: failed to install Twisted using pre-built binaries.
echo You must compile Twisted yourself.
echo.
set ERROR=1
)
del "%CD%\!WHEEL!"
if !ERROR! == 1 (
pause
exit 1
)
)
echo.
echo Installing dependencies...
python3 -m pip install Twisted[windows_platform] > NUL 2>&1
python3 -m pip install -r requirements.txt
echo.
echo Successfully installed dependencies.
echo.
pause