comparison contrib/packaging/inno/mercurial.iss @ 41847:0f49b56d5d74

inno: replace add_path.exe with a Pascal script While attempting to build the Inno installer, I was unable to find a copy of add_path.exe from the source site previously listed in the docs. Some quick Googling revealed that achieving this functionality in native Pascal scripts seems to be preferred these days. This commit vendors "Modify Path" (fetched from https://www.legroom.net/software/modpath) and plugs it into our Inno config file per its instructions. The existing Inno installer appears to only modify PATH for the current user (as opposed to at the system level). I've maintained this behavior with Modify Path. Although it would be trivial to change or add checkboxes to control the behavior. I'll leave this as a follow-up. Differential Revision: https://phab.mercurial-scm.org/D6060
author Gregory Szorc <gregory.szorc@gmail.com>
date Thu, 28 Feb 2019 12:54:48 -0800
parents 765f836a9484
children 2dbdb9abcc4b
comparison
equal deleted inserted replaced
41846:765f836a9484 41847:0f49b56d5d74
51 SolidCompression=true 51 SolidCompression=true
52 SetupIconFile=contrib\win32\mercurial.ico 52 SetupIconFile=contrib\win32\mercurial.ico
53 AllowNoIcons=true 53 AllowNoIcons=true
54 DefaultGroupName=Mercurial 54 DefaultGroupName=Mercurial
55 PrivilegesRequired=none 55 PrivilegesRequired=none
56 ChangesEnvironment=true
56 57
57 [Files] 58 [Files]
58 Source: contrib\mercurial.el; DestDir: {app}/Contrib 59 Source: contrib\mercurial.el; DestDir: {app}/Contrib
59 Source: contrib\vim\*.*; DestDir: {app}/Contrib/Vim 60 Source: contrib\vim\*.*; DestDir: {app}/Contrib/Vim
60 Source: contrib\zsh_completion; DestDir: {app}/Contrib 61 Source: contrib\zsh_completion; DestDir: {app}/Contrib
78 #endif 79 #endif
79 Source: dist\python*.dll; Destdir: {app}; Flags: skipifsourcedoesntexist 80 Source: dist\python*.dll; Destdir: {app}; Flags: skipifsourcedoesntexist
80 Source: dist\msvc*.dll; DestDir: {app}; Flags: skipifsourcedoesntexist 81 Source: dist\msvc*.dll; DestDir: {app}; Flags: skipifsourcedoesntexist
81 Source: dist\Microsoft.VC*.CRT.manifest; DestDir: {app}; Flags: skipifsourcedoesntexist 82 Source: dist\Microsoft.VC*.CRT.manifest; DestDir: {app}; Flags: skipifsourcedoesntexist
82 Source: dist\lib\library.zip; DestDir: {app}\lib 83 Source: dist\lib\library.zip; DestDir: {app}\lib
83 Source: dist\add_path.exe; DestDir: {app}
84 Source: doc\*.html; DestDir: {app}\Docs 84 Source: doc\*.html; DestDir: {app}\Docs
85 Source: doc\style.css; DestDir: {app}\Docs 85 Source: doc\style.css; DestDir: {app}\Docs
86 Source: mercurial\help\*.txt; DestDir: {app}\help 86 Source: mercurial\help\*.txt; DestDir: {app}\help
87 Source: mercurial\help\internals\*.txt; DestDir: {app}\help\internals 87 Source: mercurial\help\internals\*.txt; DestDir: {app}\help\internals
88 Source: mercurial\default.d\*.rc; DestDir: {app}\default.d 88 Source: mercurial\default.d\*.rc; DestDir: {app}\default.d
105 Name: {group}\Mercurial Command Reference; Filename: {app}\Docs\hg.1.html 105 Name: {group}\Mercurial Command Reference; Filename: {app}\Docs\hg.1.html
106 Name: {group}\Mercurial Configuration Files; Filename: {app}\Docs\hgrc.5.html 106 Name: {group}\Mercurial Configuration Files; Filename: {app}\Docs\hgrc.5.html
107 Name: {group}\Mercurial Ignore Files; Filename: {app}\Docs\hgignore.5.html 107 Name: {group}\Mercurial Ignore Files; Filename: {app}\Docs\hgignore.5.html
108 Name: {group}\Mercurial Web Site; Filename: {app}\Mercurial.url 108 Name: {group}\Mercurial Web Site; Filename: {app}\Mercurial.url
109 109
110 [Run] 110 [Tasks]
111 Filename: "{app}\add_path.exe"; Parameters: "{app}"; Flags: postinstall; Description: "Add the installation path to the search path" 111 Name: modifypath; Description: Add the installation path to the search path; Flags: unchecked
112
113 [UninstallRun]
114 Filename: "{app}\add_path.exe"; Parameters: "/del {app}"
115 112
116 [Code] 113 [Code]
117 procedure Touch(fn: String); 114 procedure Touch(fn: String);
118 begin 115 begin
119 SaveStringToFile(ExpandConstant(fn), '', False); 116 SaveStringToFile(ExpandConstant(fn), '', False);
120 end; 117 end;
118
119 const
120 ModPathName = 'modifypath';
121 ModPathType = 'user';
122
123 function ModPathDir(): TArrayOfString;
124 begin
125 setArrayLength(Result, 1)
126 Result[0] := ExpandConstant('{app}');
127 end;
128 #include "modpath.iss"