contrib/packaging/inno/mercurial.iss
author Gregory Szorc <gregory.szorc@gmail.com>
Wed, 23 Oct 2019 13:00:14 -0700
changeset 43606 14ce03e13508
parent 43518 7c9f63a5cb14
child 43609 8aa6aa9b7843
permissions -rw-r--r--
packaging: install .rc files to hgrc.d Currently, Inno installs these .rc files to a default.d directory and WiX to a hgrc.d directory. Mercurial automatically loads files in an hgrc.d directory next to the executable and in an "internal" default.d directory. This "internal" directory is util.datadir, which on Windows installs made with py2exe is the directory containing hg.exe. So on Windows both hgrc.d and default.d directories relative to hg.exe are loaded. For the install layout, I think it makes sense for hgrc.d to be used, as that path is documented as non-internal. So this commit changes the Inno install layout to use hgrc.d instead of default.d. .. bc:: Changed default config file location in Windows .exe installers Mercurial's installer installs some default .rc config files. Previously, these were installed in a default.d directory. These are now installed in an hgrc.d directory. Custom default.d/*.rc files should still be loaded. But it is recommended to move these to hgrc.d/*.rc. This change only affects the .exe installers (not the .msi installers). Differential Revision: https://phab.mercurial-scm.org/D7168

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#ifndef ARCH
#define ARCH = "x86"
#endif

[Setup]
AppCopyright=Copyright 2005-2019 Matt Mackall and others
AppName=Mercurial
AppVersion={#VERSION}
#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
ShowLanguageDialog=yes
AppPublisher=Matt Mackall and others
AppPublisherURL=https://mercurial-scm.org/
AppSupportURL=https://mercurial-scm.org/
AppUpdatesURL=https://mercurial-scm.org/
{{ 'AppID={{4B95A5F1-EF59-4B08-BED8-C891C46121B3}' }}
AppContact=mercurial@mercurial-scm.org
DefaultDirName={pf}\Mercurial
SourceDir=stage
VersionInfoDescription=Mercurial distributed SCM (version {#VERSION})
VersionInfoCopyright=Copyright 2005-2019 Matt Mackall and others
VersionInfoCompany=Matt Mackall and others
InternalCompressLevel=max
SolidCompression=true
SetupIconFile=../mercurial.ico
AllowNoIcons=true
DefaultGroupName=Mercurial
PrivilegesRequired=none
ChangesEnvironment=true

[Files]
{% for entry in package_files -%}
Source: {{ entry.source }}; DestDir: {{ entry.dest_dir }}
{%- if entry.metadata %}; {{ entry.metadata }}{% endif %}
{% endfor %}

[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
Type: filesandordirs; Name: {app}\hgrc.d

[Icons]
Name: {group}\Uninstall Mercurial; Filename: {uninstallexe}
Name: {group}\Mercurial Command Reference; Filename: {app}\Docs\hg.1.html
Name: {group}\Mercurial Configuration Files; Filename: {app}\Docs\hgrc.5.html
Name: {group}\Mercurial Ignore Files; Filename: {app}\Docs\hgignore.5.html
Name: {group}\Mercurial Web Site; Filename: {app}\Mercurial.url

[Tasks]
Name: modifypath; Description: Add the installation path to the search path; Flags: unchecked

[Code]
procedure Touch(fn: String);
begin
  SaveStringToFile(ExpandConstant(fn), '', False);
end;

const
    ModPathName = 'modifypath';
    ModPathType = 'user';

function ModPathDir(): TArrayOfString;
begin
    setArrayLength(Result, 1)
    Result[0] := ExpandConstant('{app}');
end;

{% include 'modpath.iss' %}