sas*_*alm 18 logging inno-setup
Inno Setup具有命令行参数/LOG="filename".我可以在Inno Setup脚本中指定日志文件名,因此我可以在以后的错误报告中包含它吗?
mir*_*eil 20
您可以设置SetupLogging选项(SetupLogging=yes),然后将以下代码集成到脚本中以将日志复制到某处.
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;
Run Code Online (Sandbox Code Playgroud)
小智 12
根据Lars的评论,我使用了该DeinitializeSetup()过程,但我还更改了新文件路径,使用{src}常量将日志文件复制到运行安装程序的目录而不是{app}常量,如果用户取消,可能会/可能不会创建安装:
// Called just before Setup terminates. Note that this function is called even if the user exits Setup before anything is installed.
procedure DeinitializeSetup();
var
logfilepathname, logfilename, newfilepathname: string;
begin
logfilepathname := ExpandConstant('{log}');
logfilename := ExtractFileName(logfilepathname);
// Set the new target path as the directory where the installer is being run from
newfilepathname := ExpandConstant('{src}\') + logfilename;
FileCopy(logfilepathname, newfilepathname, false);
end;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
14005 次 |
| 最近记录: |