This repository was archived by the owner on Dec 29, 2019. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathbuild_executable.cmd
More file actions
75 lines (57 loc) · 1.49 KB
/
Copy pathbuild_executable.cmd
File metadata and controls
75 lines (57 loc) · 1.49 KB
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
@echo off
rem you need PyInstaller for generating the executable.
set version=
set /P version=<VERSION
set oldpwd=%cd%
set builddir=.builds\%version%
echo %builddir%
echo Building %version%.
if exist %builddir% rmdir /s /q %builddir%
mkdir %builddir%
cd %builddir%
where /q pyinstaller
if errorlevel 1 goto no_pyinstaller
set zipexec=zip -j9
set zipexec_move=zip -mj9
where /q 7z.exe
if not errorlevel 1 (
set zipexec=7z a -tzip -mx9 -r
set zipexec_move=7z.exe a -tzip -mx9 -sdel
goto start
)
if exist "%PROGRAMFILES%\7-Zip\7z.exe" (
set zipexec="%PROGRAMFILES%\7-Zip\7z.exe" a -tzip -mx9 -r
set zipexec_move="%PROGRAMFILES%\7-Zip\7z.exe" a -tzip -mx9 -sdel
goto start
)
set zipexec="%oldpwd%\zip" -j9
set zipexec_move="%oldpwd%\zip" -mj9
goto start
:no_pyinstaller
echo PyInstaller not found.
echo.
echo You can obtain it at http://www.pyinstaller.org/downloads.html
echo Follow the instructions there.
echo.
goto byebye
:no_zip
echo zip utility not found.
echo.
echo You can obtain it the https://sourceforge.net/projects/infozip/files/
echo Download the Zip package, extract it somewhere in the PATH.
echo.
goto byebye
:start
pyinstaller --onefile ..\..\rwms_sort.py
copy ..\..\rwms_config.ini dist\
move dist\rwms_sort.exe dist\rwms_sort-%version%.exe
rem -- creating zip archives
rem Windows
cd dist
if exist rwms_sort-%version%-win.zip del rwms_sort-%version%-win.zip
%zipexec_move% rwms_sort-%version%-win.zip rwms_sort-%version%.exe rwms_config.ini
goto byebye
:byebye
dir
cd %oldpwd%
pause