forked from Appalbarry/Gmail-Backup
-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.bat
95 lines (70 loc) · 2.28 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
@echo off
::Set personal Path to the Apps:
set PythonEXE="C:\Python26\python.exe"
set PYTHONHOME=C:\Python26
set SevenZipEXE="C:\Program Files\7-Zip\7z.exe"
set MakeNSIS="C:\Program Files\NSIS\makensis.exe"
:: Compress=1 - Use CompressFiles
:: Compress=0 - Don't CompressFiles
set Compress=0
if not exist %PythonEXE% call :FileNotFound %PythonEXE%
if not exist %SevenZipEXE% call :FileNotFound %SevenZipEXE%
if not exist %MakeNSIS% call :FileNotFound %MakeNSIS%
::Compile the Python-Script
%PythonEXE% setup.py py2exe
if not "%errorlevel%"=="0" (
echo Py2EXE Error!
pause
goto:eof
)
:: Copy the Py2EXE Results to the SubDirectory and Clean Py2EXE-Results
rd "dist_EXE" /s /q
rd build /s /q
xcopy dist\*.* "dist_EXE\" /d /y
rd dist /s /q
::copy gmb.ico "dist_EXE\" /d /y
rem copy %PYTHONHOME%\Lib\site-packages\wx-2.8-msw-unicode\wx\msvcp71.dll "dist_EXE\" /d /y
rem copy %SystemRoot%\msvcp71.dll "dist_EXE\" /d /y
md dist_EXE\messages
md dist_EXE\messages\cs_CZ
md dist_EXE\messages\cs_CZ\LC_MESSAGES
md dist_EXE\messages\ru_RU
md dist_EXE\messages\ru_RU\LC_MESSAGES
md dist_EXE\messages\nl
md dist_EXE\messages\nl\LC_MESSAGES
md dist_EXE\messages\da
md dist_EXE\messages\da\LC_MESSAGES
copy gmail-backup.pot dist_EXE\messages
xcopy messages\cs_CZ\LC_MESSAGES\*.* "dist_EXE\messages\cs_CZ\LC_MESSAGES" /d /y
xcopy messages\ru_RU\LC_MESSAGES\*.* "dist_EXE\messages\ru_RU\LC_MESSAGES" /d /y
xcopy messages\nl\LC_MESSAGES\*.* "dist_EXE\messages\nl\LC_MESSAGES" /d /y
xcopy messages\da\LC_MESSAGES\*.* "dist_EXE\messages\da\LC_MESSAGES" /d /y
if "%Compress%"=="1" call:CompressFiles
echo.
echo.
echo Done: "dist_EXE\"
echo.
mkdir "inst_EXE"
%MakeNSIS% installer.nsi
echo Done: MakeNSIS
pause
goto:eof
:CompressFiles
%SevenZipEXE% -aoa x "dist_EXE\library.zip" -o"dist_EXE\library\"
del "dist_EXE\library.zip"
cd dist_EXE\library\
%SevenZipEXE% a -tzip -mx9 "..\library.zip" -r
cd ..\..
rd "dist_EXE\library" /s /q
cd dist_EXE\
goto:eof
:FileNotFound
echo.
echo Error, File not found:
echo [%1]
echo.
echo Check Path in %~nx0???
echo.
pause
exit
goto:eof