comparison contrib/packaging/hgpackaging/inno.py @ 44769:9ade217b550d stable

packaging: add -python2 to Windows installer filenames We just taught the Windows installers to produce Python 3 variants built with PyOxidizer. Our plan is to publish both Python 2 and Python 3 versions of the installers for Mercurial 5.4. This commit teaches the Inno and WiX installers to add an optional string suffix to the installer name. On Python 2, that suffix is "-python2." We reserve the existing name for the Python 3 installers, which we want to make the default. Differential Revision: https://phab.mercurial-scm.org/D8479
author Gregory Szorc <gregory.szorc@gmail.com>
date Thu, 23 Apr 2020 18:48:36 -0700
parents 94f4f2ec7dee
children d270b9b797a7
comparison
equal deleted inserted replaced
44768:9d441f820c8b 44769:9ade217b550d
109 inno_build_dir, 109 inno_build_dir,
110 staging_dir, 110 staging_dir,
111 iscc_exe, 111 iscc_exe,
112 version, 112 version,
113 arch="x64" if vc_x64 else None, 113 arch="x64" if vc_x64 else None,
114 suffix="-python2",
114 ) 115 )
115 116
116 117
117 def build_with_pyoxidizer( 118 def build_with_pyoxidizer(
118 source_dir: pathlib.Path, 119 source_dir: pathlib.Path,
148 inno_build_dir: pathlib.Path, 149 inno_build_dir: pathlib.Path,
149 staging_dir: pathlib.Path, 150 staging_dir: pathlib.Path,
150 iscc_exe: pathlib.Path, 151 iscc_exe: pathlib.Path,
151 version, 152 version,
152 arch=None, 153 arch=None,
154 suffix="",
153 ): 155 ):
154 """Build an Inno installer from staged Mercurial files. 156 """Build an Inno installer from staged Mercurial files.
155 157
156 This function is agnostic about how to build Mercurial. It just 158 This function is agnostic about how to build Mercurial. It just
157 cares that Mercurial files are in ``staging_dir``. 159 cares that Mercurial files are in ``staging_dir``.
212 214
213 args = [str(iscc_exe)] 215 args = [str(iscc_exe)]
214 216
215 if arch: 217 if arch:
216 args.append('/dARCH=%s' % arch) 218 args.append('/dARCH=%s' % arch)
219 args.append('/dSUFFIX=-%s%s' % (arch, suffix))
220 else:
221 args.append('/dSUFFIX=-x86%s' % suffix)
217 222
218 if not version: 223 if not version:
219 version = read_version_py(source_dir) 224 version = read_version_py(source_dir)
220 225
221 args.append('/dVERSION=%s' % version) 226 args.append('/dVERSION=%s' % version)