Inno Setup has command line parameter /LOG="filename"
. Can I specify a log filename from inside the Inno Setup script, so I can include it later in my error reports?
You can set the SetupLogging
option (SetupLogging=yes
) then integrate the following code into your script to copy the log somewhere.
procedure CurStepChanged(CurStep: TSetupStep);
var
logfilepathname, logfilename, newfilepathname: string;
begin
logfilepathname := ExpandConstant('{log}');
logfilename := ExtractFileName(logfilepathname);
newfilepathname := ExpandConstant('{app}\') + logfilename;
if CurStep = ssDone then
begin
FileCopy(logfilepathname, newfilepathname, false);
end;
end;