Skip to content

Commit 8911bd5

Browse files
committed
installer: record install options in /etc/install-options.txt
It is useful to have a file lying around that lists the options there were chosen in the installer. This resolves git-for-windows/git#454 Signed-off-by: Johannes Schindelin <[email protected]>
1 parent e5c2862 commit 8911bd5

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

installer/install.iss.in

+15-1
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,10 @@ Type: files; Name: {app}\etc\rebase.db.i386
202202
Type: dirifempty; Name: {app}\etc
203203
#endif
204204

205+
; Delete recorded install options
206+
Type: files; Name: {app}\etc\install-options.txt
207+
Type: dirifempty; Name: {app}\etc
208+
205209
[Code]
206210
#include "helpers.inc.iss"
207211
#include "environment.inc.iss"
@@ -275,6 +279,9 @@ const
275279
BIND_CACHE_IMPORT_DLLS = $00000008;
276280

277281
var
282+
// The options chosen at install time, to be written to /etc/install-options.txt
283+
ChosenOptions:String;
284+
278285
// Wizard page and variables for the Path options.
279286
PathPage:TWizardPage;
280287
RdbPath:array[GP_BashOnly..GP_CmdTools] of TRadioButton;
@@ -488,6 +495,7 @@ end;
488495

489496
procedure RecordChoice(PreviousDataKey:Integer;Key,Data:String);
490497
begin
498+
ChosenOptions:=ChosenOptions+Key+': '+Data+#13#10;
491499
SetPreviousData(PreviousDataKey,Key,Data);
492500
if ShouldSaveInf then begin
493501
// .inf files do not like keys with spaces.
@@ -523,6 +531,8 @@ var
523531
Data:String;
524532
begin
525533

534+
ChosenOptions:='';
535+
526536
PrevPageID:=wpSelectProgramGroup;
527537

528538
(*
@@ -1508,7 +1518,7 @@ end;
15081518

15091519
procedure RegisterPreviousData(PreviousDataKey:Integer);
15101520
var
1511-
Data:String;
1521+
Data,Path:String;
15121522
begin
15131523
// Git Path options.
15141524
Data:='';
@@ -1555,6 +1565,10 @@ begin
15551565
Data:='Enabled';
15561566
end;
15571567
RecordChoice(PreviousDataKey,'Performance Tweaks FSCache',Data);
1568+
1569+
Path:=ExpandConstant('{app}\etc\install-options.txt');
1570+
if not SaveStringToFile(Path,ChosenOptions,False) then
1571+
LogError('Could not write to '+Path);
15581572
end;
15591573

15601574
{

0 commit comments

Comments
 (0)