-
Notifications
You must be signed in to change notification settings - Fork 17
/
make_installer.cmd
77 lines (70 loc) · 1.47 KB
/
make_installer.cmd
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
@echo off
SET VERSION=0.17.9
IF "%PROCESSOR_ARCHITECTURE%"=="x86" (
SET NSIS="%ProgramFiles%\NSIS\makensis.exe"
SET PYTHON32="c:\python26\python.exe"
) ELSE (
SET NSIS="%ProgramFiles(x86)%\NSIS\makensis.exe"
SET PYTHON32="c:\python27 (x86)\python.exe"
SET PYTHON64="c:\python27 (x64)\python.exe"
)
cd %~dp0
IF [%1]==[] GOTO error
IF [%2]==[] GOTO error
IF "%1"=="all" (
IF "%PROCESSOR_ARCHITECTURE%"=="x86" (
set ARCH=x86
) ELSE (
set ARCH=x86 x64
)
) ELSE (
set ARCH=%1
)
IF "%2"=="all" (
CALL :build clean
CALL :build make_py
CALL :build make_installer
) ELSE (
CALL :build %2
)
GOTO :eof
:: function build(Target)
:build
SETLOCAL
SET TARGET=%1
for %%k in (%ARCH%) do (
echo ###################################
echo running %TARGET% for %%k
CALL :%TARGET% %%k
echo done
echo ###################################
)
ENDLOCAL
GOTO :eof
:clean
SETLOCAL
SET ARCH=%1
rd /s /q dist-%ARCH%
rd /s /q build-%ARCH%
ENDLOCAL
GOTO :eof
:make_py
SETLOCAL
SET ARCH=%1
if "%ARCH%"=="x86" (
%PYTHON32% setup.py py2exe
) ELSE (
%PYTHON64% setup.py py2exe
)
move dist dist-%ARCH%
move build build-%ARCH%
ENDLOCAL
GOTO :eof
:make_installer
SETLOCAL
SET ARCH=%1
%NSIS% /DPLATFORM=%ARCH% -DVERSION=%VERSION% %~dp0\Wpkg-GP.nsi
ENDLOCAL
GOTO :eof
:error
echo "Usage: %~nx0 [x86|x64|all] [clean|make_py|make_installer|all]"