我想在inno设置中写一个日志文件而不是消息框

时间:2017-03-17 14:48:41

标签: inno-setup pascal

我尝试使用以下代码,但日志没有写

procedure CurStepChanged(CurStep: TSetupStep);
var
  logfilepathname, logfilename, newfilepathname: string;
begin
  logfilepathname := ExpandConstant('{log}');
  logfilename := ExtractFileName(logfilepathname);
  newfilepathname := ExpandConstant('C:\Spectrum\StaticFilesLog\') + logfilename;

  if CurStep = ssDone then
  begin
    FileCopy(logfilepathname, newfilepathname, false);
  end;
end;

function SQLServerInstallation: Boolean;
begin
  if (IsSQlServer2012Present = True) then
  begin
    Result := True;
  end
  else if (IsSQlServer2005Present = True) then
  begin
    Log('File : ' + 'Static file installation'); // this is not working
    Log('SQL server 2005 is present in your machine. Please install SQL');
    // It should write the log but not writing
    ExitProcess(0);
  end
  else
  begin
    Log('File : ' + 'Static file installation'); // This is not working
    Log('SQL server was not installed in your machine please install 2005')
    // It should write the log but not writing
      ExitProcess(0);
  end;
end;

0 个答案:

没有答案
相关问题