-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.bat
125 lines (100 loc) · 3.49 KB
/
setup.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
pushd "%CD%"
CD /D "%~dp0"
set currentDir=%cd%
Del %USERPROFILE%\AppData\Local\Microsoft\WindowsApps\python.exe
Del %USERPROFILE%\AppData\Local\Microsoft\WindowsApps\python3.exe
start /b "" cscript setupmessage.vbs
python --version 2>NUL
if errorlevel 1 goto errorNoPython
pip install tk
pip install Pillow
pip install requests
pip install sv-ttk
pip install pypresence
pip install discord.py
pip install nest-asyncio
pip install pywin32
pip install psutil
pip install -e "%currentDir%\infi_systray_modified"
pip install darkdetect
taskkill /F /FI "WINDOWTITLE eq Setting up your app" /T
python settingssetup.pyw
python tray.py
pause
goto:eof
:errorNoPython
@echo off
set PYTHON_VERSION=3.10.7
set PYTHON_MSI=python-%PYTHON_VERSION%-amd64.exe
set PYTHON_EXE=c:\Python310\python.exe
set PYTHON_PATH=c:\Python310;c:\Python310\Scripts
set PYTHON_APPDATA=c:\Python310\AppData
set PYWIN_BUILD=218
set PYWIN_EXE=pywin32-%PYWIN_BUILD%.win32-py2.7.exe
echo,
echo ------------------------------------------------------------------
echo Download Python
echo ------------------------------------------------------------------
echo,
if not exist %PYTHON_EXE% (
if not exist %PYTHON_MSI% (
curl -L -O http://python.org/ftp/python/%PYTHON_VERSION%/%PYTHON_MSI%
)
)
echo,
echo ------------------------------------------------------------------
echo Install Python
echo ------------------------------------------------------------------
echo,
if not exist %PYTHON_EXE% (
if exist %PYTHON_MSI% (
%PYTHON_MSI% /quiet InstallAllUsers=1 PrependPath=1 TargetDir=c:\Python310 Include_pip=1
) else (
echo Python installer package didn't seem to download correctly.
exit /b 1
)
)
echo,
echo ------------------------------------------------------------------
echo Add Python to PATH
echo ------------------------------------------------------------------
echo,
rem Add the PYTHON_PATH to the PATH environment variable.
rem reg add "HKCU\Environment" /v PATH /t REG_EXPAND_SZ /d "%PYTHON_PATH%"
rem reg add "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v PATH /t REG_EXPAND_SZ /d "%PATH%;c:\Python310;c:\Python310\Scripts"
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /f /v PATH /t REG_EXPAND_SZ /d "%PATH%;%PYTHON_PATH%"
rem Set LOCALAPPDATA to APPDATA, otherwise distlib will throw errors.
rem See: https://vilimpoc.org/blog/2014/01/18/time-robbing-python-errors/
mkdir %PYTHON_APPDATA%
reg add "HKLM\System\CurrentControlSet\Control\Session Manager\Environment" /f /v LOCALAPPDATA /t REG_SZ /d "%PYTHON_APPDATA%"
rem Temporarily set LOCALAPPDATA.
set LOCALAPPDATA=%PYTHON_APPDATA%
rem Temporarily set the path, so we can use the python command.
set PATH=%PATH%;%PYTHON_PATH%
echo,
echo ------------------------------------------------------------------
echo Install Dependencies
echo ------------------------------------------------------------------
echo,
pip install tk
pip install Pillow
pip install requests
pip install sv-ttk
pip install pypresence
pip install discord.py
pip install nest-asyncio
pip install pywin32
pip install darkdetect
pip install psutil
pip install -e "%currentDir%\infi_systray_modified"
Del %PYTHON_MSI%
echo,
echo ------------------------------------------------------------------
echo Python %PYTHON_VERSION%, easy_install, pip, and all the
echo Dependencies of the project are now installed!
echo ------------------------------------------------------------------
echo,
taskkill /F /FI "WINDOWTITLE eq Setting up your app" /T
python settingssetup.pyw
python tray.py
pause