Skip to content

Commit 865a27c

Browse files
committed
Updated batch file for compiling via command line an executable Pronterface file for Windows 10.
1 parent 2f75973 commit 865a27c

File tree

1 file changed

+150
-4
lines changed

1 file changed

+150
-4
lines changed

release_windows.bat

+150-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,152 @@
1-
d:\python27\python.exe setup_win.py py2exe -v
2-
xcopy images dist\images\ /Y /E
1+
echo off
2+
cls
3+
4+
rem *************************************************************************
5+
rem **************** ---> New batch file starts here <--- *****************
6+
rem ** **
7+
rem ** This batch will compile automated via command line an executable **
8+
rem ** Pronterface file for Windows 10. **
9+
rem ** **
10+
rem ** Steps that are automated: **
11+
rem ** **
12+
rem ** 1. clean up previous compilations (directory .\dist) **
13+
rem ** 2. check for virtual environment called v3 and generate it, if **
14+
rem ** not available (start from scratch) **
15+
rem ** 3. install all needed additional modules via pip **
16+
rem ** 4. check for outdated modules that need to be updated and **
17+
rem ** update them **
18+
rem ** 5. Check if virtual environment needs an update and do it **
19+
rem ** 6. check for existing variants of gcoder_line.cp??-win_amd??.pyd **
20+
rem ** and delete them (to prevent errors and incompatibilities) **
21+
rem ** 7. compile Pronterface.exe **
22+
rem ** 8. copy localization files to .\dist **
23+
rem ** 9. go to directory .\dist, list files and ends the activity **
24+
rem ** **
25+
rem ** Steps, you need to do manually before running this batch: **
26+
rem ** **
27+
rem ** 1. install python 3.7.9 **
28+
rem ** https://www.python.org/downloads/release/python-378/ **
29+
rem ** 2. install C-compiler environment **
30+
rem ** https://wiki.python.org/moin/WindowsCompilers **
31+
rem ** 3. check for latest repository updates at: **
32+
rem ** http://github.com/kliment/Printrun.git **
33+
rem ** **
34+
rem ** Author: DivingDuck, 2021-01-06, Status: working **
35+
rem ** **
36+
rem *************************************************************************
37+
rem *************************************************************************
38+
39+
echo **************************************************
40+
echo ****** Delete files and directory of .\dist ******
41+
echo **************************************************
42+
if exist dist (
43+
DEL /F/Q/S dist > NUL
44+
RMDIR /Q/S dist
45+
)
46+
echo *********************************************
47+
echo ****** Activate virtual environment v3 ******
48+
echo *********************************************
49+
if exist v3 (
50+
call v3\Scripts\activate
51+
) else (
52+
53+
echo **********************************************************************
54+
echo ****** No virtual environment named v3 avaliable ******
55+
echo ****** Will create first a new virtual environment with name v3 ******
56+
echo **********************************************************************
57+
py -3.7 -m venv v3
58+
59+
echo *********************************************
60+
echo ****** Activate virtual environment v3 ******
61+
echo *********************************************
62+
call v3\Scripts\activate
63+
64+
pip install --upgrade pip
65+
pip install --upgrade setuptools
66+
67+
pip install wheel
68+
69+
echo **********************************
70+
echo ****** install requirements ******
71+
echo **********************************
72+
pip install -r requirements.txt
73+
pip install cython
74+
echo ***********************
75+
echo ****** additions ******
76+
echo ***********************
77+
pip install simplejson
78+
79+
rem echo *******************************
80+
rem echo ****** pyinstaller 4 dev ******
81+
rem echo *******************************
82+
rem pyinstaller v3.6 don't work with Windows 10 pip install pyinstaller
83+
rem update 2020-12-13: there is a new version available v4.1.
84+
rem Looks like we don't need this fix any longer
85+
REM pip uninstall pyinstaller
86+
REM pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip
87+
pip install pyinstaller
88+
pip install pypiwin32
89+
pip install polygon3
90+
)
91+
92+
echo ********************************************
93+
echo ****** upgrate virtual environment v3 ******
94+
echo ********************************************
95+
pip install --upgrade virtualenv
96+
97+
echo ****************************************************
98+
echo ****** check for and update outdated modules ******
99+
echo ****************************************************
100+
for /F "skip=2 delims= " %%i in ('pip list --outdated') do pip install --upgrade %%i
101+
102+
rem echo ****************************************************************************************
103+
rem echo ****** --->> Hotfix AGe: solve numpy 1.19.4 problem for x64 windows runtime error ******
104+
rem echo ****************************************************************************************
105+
rem numpy v1.19.4 create an python RuntimeError: The current Numpy installation fails to pass a
106+
rem sanity check due to a bug in the windows runtime. See this issue for more information:
107+
rem https://tinyurl.com/y3dm3h86
108+
rem Temporary workaround is to install 1.19.3 instead.
109+
rem --> ToDo: Need to be checked in 2021 January again
110+
rem update 2021-01-06: There is a new version available
111+
rem --> Solved with version 1.19.5
112+
rem pip uninstall numpy
113+
rem pip install numpy==1.19.3
114+
115+
echo ******************************************************************
116+
echo ****** Compile G-Code parser gcoder_line.cp37-win_amd64.pyd ******
117+
echo ******************************************************************
118+
rem For safety reasons delete existing version first to prevent errors
119+
if exist printrun\gcoder_line.cp??-win_amd??.pyd (
120+
del printrun\gcoder_line.cp??-win_amd??.pyd
121+
echo ********************************************************************************
122+
echo ****** found versions of printrun\gcoder_line.cp??-win_amd??.pyd, deleted ******
123+
echo ********************************************************************************
124+
)
125+
python setup.py build_ext --inplace
126+
127+
echo ****************************************
128+
echo ****** Collect all data for build ******
129+
echo ****************************************
130+
pyi-makespec -F --add-data images/*;images --add-data *.png;. --add-data *.ico;. -w -i pronterface.ico pronterface.py
131+
132+
echo *******************************
133+
echo ****** Build Pronterface ******
134+
echo *******************************
135+
pyinstaller --clean pronterface.spec -y
136+
137+
echo ********************************
138+
echo ****** Add language files ******
139+
echo ********************************
3140
xcopy locale dist\locale\ /Y /E
4-
xcopy Slic3r dist\Slic3r\ /Y /E
5-
copy MSVCP90.DLL dist\
141+
142+
echo ***************************************************************
143+
echo ****** Batch finalizes ******
144+
echo ****** ******
145+
echo ****** Happy printing with Pronterface for Windows! ******
146+
echo ****** ******
147+
echo ****** You will find Pronterface and localizations here: ******
148+
echo ***************************************************************
149+
cd dist
150+
dir .
6151
pause
152+
echo on

0 commit comments

Comments
 (0)