# HG changeset patch # User Gregory Szorc # Date 2020-04-24 01:48:36 # Node ID 9ade217b550d14e71ea106f8db63a62291ee0b40 # Parent 9d441f820c8ba1b86df11b60397f4a6a114a1d53 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 diff --git a/contrib/automation/hgautomation/windows.py b/contrib/automation/hgautomation/windows.py --- a/contrib/automation/hgautomation/windows.py +++ b/contrib/automation/hgautomation/windows.py @@ -108,10 +108,10 @@ WHEEL_FILENAME_PYTHON37_X64 = 'mercurial WHEEL_FILENAME_PYTHON38_X86 = 'mercurial-{version}-cp38-cp38-win32.whl' WHEEL_FILENAME_PYTHON38_X64 = 'mercurial-{version}-cp38-cp38-win_amd64.whl' -X86_EXE_FILENAME = 'Mercurial-{version}.exe' -X64_EXE_FILENAME = 'Mercurial-{version}-x64.exe' -X86_MSI_FILENAME = 'mercurial-{version}-x86.msi' -X64_MSI_FILENAME = 'mercurial-{version}-x64.msi' +X86_EXE_FILENAME = 'Mercurial-{version}-x86-python2.exe' +X64_EXE_FILENAME = 'Mercurial-{version}-x64-python2.exe' +X86_MSI_FILENAME = 'mercurial-{version}-x86-python2.msi' +X64_MSI_FILENAME = 'mercurial-{version}-x64-python2.msi' MERCURIAL_SCM_BASE_URL = 'https://mercurial-scm.org/release/windows' diff --git a/contrib/packaging/hgpackaging/inno.py b/contrib/packaging/hgpackaging/inno.py --- a/contrib/packaging/hgpackaging/inno.py +++ b/contrib/packaging/hgpackaging/inno.py @@ -111,6 +111,7 @@ def build_with_py2exe( iscc_exe, version, arch="x64" if vc_x64 else None, + suffix="-python2", ) @@ -150,6 +151,7 @@ def build_installer( iscc_exe: pathlib.Path, version, arch=None, + suffix="", ): """Build an Inno installer from staged Mercurial files. @@ -214,6 +216,9 @@ def build_installer( if arch: args.append('/dARCH=%s' % arch) + args.append('/dSUFFIX=-%s%s' % (arch, suffix)) + else: + args.append('/dSUFFIX=-x86%s' % suffix) if not version: version = read_version_py(source_dir) diff --git a/contrib/packaging/hgpackaging/wix.py b/contrib/packaging/hgpackaging/wix.py --- a/contrib/packaging/hgpackaging/wix.py +++ b/contrib/packaging/hgpackaging/wix.py @@ -358,6 +358,7 @@ def build_installer_py2exe( version=version, python2=True, msi_name=msi_name, + suffix="-python2", extra_wxs=extra_wxs, extra_features=extra_features, signing_info=signing_info, @@ -415,6 +416,7 @@ def run_wix_packaging( version: str, python2: bool, msi_name: typing.Optional[str] = "mercurial", + suffix: str = "", extra_wxs: typing.Optional[typing.Dict[str, str]] = None, extra_features: typing.Optional[typing.List[str]] = None, signing_info: typing.Optional[typing.Dict[str, str]] = None, @@ -489,7 +491,9 @@ def run_wix_packaging( run_candle(wix_path, build_dir, source, source_build_rel, defines=defines) msi_path = ( - source_dir / 'dist' / ('%s-%s-%s.msi' % (msi_name, orig_version, arch)) + source_dir + / 'dist' + / ('%s-%s-%s%s.msi' % (msi_name, orig_version, arch, suffix)) ) args = [ diff --git a/contrib/packaging/inno/mercurial.iss b/contrib/packaging/inno/mercurial.iss --- a/contrib/packaging/inno/mercurial.iss +++ b/contrib/packaging/inno/mercurial.iss @@ -9,14 +9,13 @@ AppCopyright=Copyright 2005-2020 Matt Mackall and others AppName=Mercurial AppVersion={#VERSION} +OutputBaseFilename=Mercurial-{#VERSION}{#SUFFIX} #if ARCH == "x64" AppVerName=Mercurial {#VERSION} (64-bit) -OutputBaseFilename=Mercurial-{#VERSION}-x64 ArchitecturesAllowed=x64 ArchitecturesInstallIn64BitMode=x64 #else AppVerName=Mercurial {#VERSION} -OutputBaseFilename=Mercurial-{#VERSION} #endif InfoAfterFile=../postinstall.txt LicenseFile=Copying.txt