X Tutup
Skip to content

Commit 070077a

Browse files
committed
multiple-installer options support
1 parent 975e926 commit 070077a

File tree

3 files changed

+35
-14
lines changed

3 files changed

+35
-14
lines changed

generate_a_winpython_distro.bat

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ rem Override other scripts (simpler maintenance)
2323
set my_buildenv=C:\winpython-64bit-3.4.3.7Qt5
2424

2525
rem handle alpha
26-
if "%my_release_level%"=="" set my_release_level=
26+
if "%my_release_level%"=="" set my_release_level=b2
2727

2828
if %my_python_target%==27 set my_release=2
2929

@@ -121,8 +121,8 @@ call %my_buildenv%\scripts\env.bat
121121

122122
rem build with this
123123
cd /D %~dp0
124-
echo python.exe -c "from make import *;make_all(%my_release%, '%my_release_level%', pyver='%my_pyver%', basedir=r'%my_basedir%', verbose=True, architecture=%my_arch%, flavor='%my_flavor%', requirements=r'%my_requirements%', install_options=r'%my_install_options%', find_links=r'%my_find_links%', source_dirs=r'%my_source_dirs%', toolsdirs=r'%my_toolsdirs%', docsdirs=r'%my_docsdirs%', create_installer=%my_create_installer%)">>%my_archive_log%
125-
python.exe -c "from make import *;make_all(%my_release%, '%my_release_level%', pyver='%my_pyver%', basedir=r'%my_basedir%', verbose=True, architecture=%my_arch%, flavor='%my_flavor%', requirements=r'%my_requirements%', install_options=r'%my_install_options%', find_links=r'%my_find_links%', source_dirs=r'%my_source_dirs%', toolsdirs=r'%my_toolsdirs%', docsdirs=r'%my_docsdirs%', create_installer=%my_create_installer%)">>%my_archive_log%
124+
echo python.exe -c "from make import *;make_all(%my_release%, '%my_release_level%', pyver='%my_pyver%', basedir=r'%my_basedir%', verbose=True, architecture=%my_arch%, flavor='%my_flavor%', requirements=r'%my_requirements%', install_options=r'%my_install_options%', find_links=r'%my_find_links%', source_dirs=r'%my_source_dirs%', toolsdirs=r'%my_toolsdirs%', docsdirs=r'%my_docsdirs%', create_installer='%my_create_installer%')">>%my_archive_log%
125+
python.exe -c "from make import *;make_all(%my_release%, '%my_release_level%', pyver='%my_pyver%', basedir=r'%my_basedir%', verbose=True, architecture=%my_arch%, flavor='%my_flavor%', requirements=r'%my_requirements%', install_options=r'%my_install_options%', find_links=r'%my_find_links%', source_dirs=r'%my_source_dirs%', toolsdirs=r'%my_toolsdirs%', docsdirs=r'%my_docsdirs%', create_installer='%my_create_installer%')">>%my_archive_log%
126126

127127
echo ===============>>%my_archive_log%
128128
echo END OF creation>>%my_archive_log%

make.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ def get_nsis_exe():
4747
):
4848
for subdirname in ('.', 'App'):
4949
exe = osp.join(dirname, subdirname, 'NSIS', 'makensis.exe')
50-
include = osp.join(dirname, subdirname, 'NSIS', 'include')
5150
if osp.isfile(exe):
5251
return exe
5352
else:
@@ -67,7 +66,6 @@ def get_iscc_exe():
6766
):
6867
for subdirname in ('.', 'App'):
6968
exe = osp.join(dirname, subdirname, 'Inno Setup 5', 'iscc.exe')
70-
# include = osp.join(dirname, subdirname, 'Inno Setup 5', 'include')
7169
if osp.isfile(exe):
7270
return exe
7371
else:
@@ -507,7 +505,7 @@ def create_installer_inno(self):
507505
build_iss('installer_INNO.iss', fname, data)
508506
self._print_done()
509507

510-
def create_installer_7zip(self):
508+
def create_installer_7zip(self, installer_option=''):
511509
"""Create installer with 7-ZIP"""
512510
self._print("Creating WinPython installer 7-ZIP")
513511
portable_dir = osp.join(osp.dirname(osp.abspath(__file__)), 'portable')
@@ -519,6 +517,7 @@ def create_installer_7zip(self):
519517
('VERSION_INSTALL', '%s%d' % (self.python_fullversion.replace(
520518
'.' , ''), self.build_number)),
521519
('RELEASELEVEL', self.release_level),)
520+
data += (('INSTALLER_OPTION', installer_option),)
522521
build_7zip('installer_7zip.bat', fname, data)
523522
self._print_done()
524523

@@ -1639,10 +1638,18 @@ def make_all(build_number, release_level, pyver, architecture,
16391638
dist.make(remove_existing=remove_existing, requirements=requirements,
16401639
my_winpydir=my_winpydir)
16411640
# ,find_links=osp.join(basedir, 'packages.srcreq'))
1642-
if create_installer and not simulation:
1643-
#dist.create_installer() # NSIS installer (can't handle big build)
1644-
dist.create_installer_inno() # INNO Setup 5 (not 7zip friendly)
1645-
#dist.create_installer_7zip() # 7-zip (no licence splash screen)
1641+
if str(create_installer).lower() != 'false' and not simulation:
1642+
if 'nsis' in str(create_installer).lower():
1643+
dist.create_installer() # NSIS installer (can't handle big build)
1644+
if 'inno' in str(create_installer).lower() or (
1645+
str(create_installer).lower() == 'true'):
1646+
dist.create_installer_inno() # INNO Setup 5 (not 7zip friendly)
1647+
if '7zip' in str(create_installer).lower():
1648+
dist.create_installer_7zip('.exe') # 7-zip (no licence splash screen)
1649+
if '.7z' in str(create_installer).lower():
1650+
dist.create_installer_7zip('.7z') # 7-zip (no licence splash screen)
1651+
if '.zip' in str(create_installer).lower():
1652+
dist.create_installer_7zip('.zip') # 7-zip (no licence splash screen)
16461653
return dist
16471654

16481655

portable/installer_7zip.bat

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
rem Copyright © 2018 WinPython team
1+
rem Copyright © 2018 WinPython team
22
rem Licensed under the terms of the MIT License
33
rem (see winpython/__init__.py for details)
44

@@ -18,6 +18,7 @@ set VERSION_INSTALL=3670
1818

1919
set RELEASELEVEL=beta3
2020
set PORTABLE_DIR=C:\WinPython-64bit-3.4.3.7Qt5\winpython_github20181029\portable
21+
set INSTALLER_OPTION=.exe
2122

2223
rem ================================================================
2324
rem these lines are static definitions
@@ -43,15 +44,28 @@ rem 7-zip uncompress the directory compressed %DISTDIR% (no option to change it
4344
echo %time%
4445

4546
rem compression + include auto_extract in GUI mode
46-
"%SEVENZIP_EXE%" -mx5 a "%MyBinaryOutputDir%\%OutputBaseFilename%.exe" %DISTDIR% -sfx7z.sfx
47+
if "%INSTALLER_OPTION%"==".exe" (
48+
"%SEVENZIP_EXE%" -mx5 a "%MyBinaryOutputDir%\%OutputBaseFilename%.exe" %DISTDIR% -sfx7z.sfx
49+
echo autoextract using command line options
50+
echo "%MyBinaryOutputDir%\%OutputBaseFilename%.exe" -y -o%MyBinaryOutputDir%\zz > NUL
51+
)
4752

53+
if "%INSTALLER_OPTION%"==".7z" (
54+
"%SEVENZIP_EXE%" -mx5 a "%MyBinaryOutputDir%\%OutputBaseFilename%.7z" %DISTDIR%
55+
echo no autoextract
56+
)
57+
if "%INSTALLER_OPTION%"==".zip" (
58+
"%SEVENZIP_EXE%" -tzip -mx5 a "%MyBinaryOutputDir%\%OutputBaseFilename%.zip" %DISTDIR%
59+
echo no autoextract
60+
)
4861

4962

50-
echo autoextract using command line options
51-
echo "%MyBinaryOutputDir%\%OutputBaseFilename%.exe" -y -o%MyBinaryOutputDir%\zz > NUL
5263

5364
rem -mx1 = speed fastest
5465
rem -mx3 = speed fast
5566
rem -mx5 = speed normal
5667
rem -mx7 = compress maximum
5768
rem -mx9 = compress ultra
69+
70+
rem -t7z = [by default] 7 zip compression , the only choice with auto-extract
71+
rem -tzip = Zip compatible compression.

0 commit comments

Comments
 (0)
X Tutup