comparison contrib/packaging/hgpackaging/wix.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 234882d17814
children 439ce34d81e6
comparison
equal deleted inserted replaced
44768:9d441f820c8b 44769:9ade217b550d
356 staging_dir, 356 staging_dir,
357 arch, 357 arch,
358 version=version, 358 version=version,
359 python2=True, 359 python2=True,
360 msi_name=msi_name, 360 msi_name=msi_name,
361 suffix="-python2",
361 extra_wxs=extra_wxs, 362 extra_wxs=extra_wxs,
362 extra_features=extra_features, 363 extra_features=extra_features,
363 signing_info=signing_info, 364 signing_info=signing_info,
364 ) 365 )
365 366
413 staging_dir: pathlib.Path, 414 staging_dir: pathlib.Path,
414 arch: str, 415 arch: str,
415 version: str, 416 version: str,
416 python2: bool, 417 python2: bool,
417 msi_name: typing.Optional[str] = "mercurial", 418 msi_name: typing.Optional[str] = "mercurial",
419 suffix: str = "",
418 extra_wxs: typing.Optional[typing.Dict[str, str]] = None, 420 extra_wxs: typing.Optional[typing.Dict[str, str]] = None,
419 extra_features: typing.Optional[typing.List[str]] = None, 421 extra_features: typing.Optional[typing.List[str]] = None,
420 signing_info: typing.Optional[typing.Dict[str, str]] = None, 422 signing_info: typing.Optional[typing.Dict[str, str]] = None,
421 ): 423 ):
422 """Invokes WiX to package up a built Mercurial. 424 """Invokes WiX to package up a built Mercurial.
487 defines['MercurialExtraFeatures'] = ';'.join(extra_features) 489 defines['MercurialExtraFeatures'] = ';'.join(extra_features)
488 490
489 run_candle(wix_path, build_dir, source, source_build_rel, defines=defines) 491 run_candle(wix_path, build_dir, source, source_build_rel, defines=defines)
490 492
491 msi_path = ( 493 msi_path = (
492 source_dir / 'dist' / ('%s-%s-%s.msi' % (msi_name, orig_version, arch)) 494 source_dir
495 / 'dist'
496 / ('%s-%s-%s%s.msi' % (msi_name, orig_version, arch, suffix))
493 ) 497 )
494 498
495 args = [ 499 args = [
496 str(wix_path / 'light.exe'), 500 str(wix_path / 'light.exe'),
497 '-nologo', 501 '-nologo',