# HG changeset patch # User Gregory Szorc # Date 1571881339 25200 # Node ID 8aa6aa9b7843e789c0deb54b456617fb7f6b80b2 # Parent 2574330dd0f69b67029ee8ed822502b551bc8f4a packaging: write out editor.rc in Python Let's dynamically generate the file from Python instead of relying on Inno functionality, as that will give more visibility into what's going on. I spotted this as part of converging the install layout of Inno and WiX: the former doesn't install an editor.rc and instead defines the editor via its mercurial.rc file. We will change the behavior of WiX later once it is consuming the staged install directory for packaging. Differential Revision: https://phab.mercurial-scm.org/D7171 diff -r 2574330dd0f6 -r 8aa6aa9b7843 contrib/packaging/hgpackaging/py2exe.py --- a/contrib/packaging/hgpackaging/py2exe.py Wed Oct 23 13:25:01 2019 -0700 +++ b/contrib/packaging/hgpackaging/py2exe.py Wed Oct 23 18:42:19 2019 -0700 @@ -217,6 +217,13 @@ """ process_install_rules(STAGING_RULES, source_dir, staging_dir) + # Write out a default editor.rc file to configure notepad as the + # default editor. + with (staging_dir / 'hgrc.d' / 'editor.rc').open( + 'w', encoding='utf-8' + ) as fh: + fh.write('[ui]\neditor = notepad\n') + # Purge any files we don't want to be there. for f in STAGING_EXCLUDES: p = staging_dir / f diff -r 2574330dd0f6 -r 8aa6aa9b7843 contrib/packaging/inno/mercurial.iss --- a/contrib/packaging/inno/mercurial.iss Wed Oct 23 13:25:01 2019 -0700 +++ b/contrib/packaging/inno/mercurial.iss Wed Oct 23 18:42:19 2019 -0700 @@ -48,7 +48,6 @@ [INI] Filename: {app}\Mercurial.url; Section: InternetShortcut; Key: URL; String: https://mercurial-scm.org/ -Filename: {app}\hgrc.d\editor.rc; Section: ui; Key: editor; String: notepad [UninstallDelete] Type: files; Name: {app}\Mercurial.url