InstallShield 创建安装日志

/ 0评 / 4

InstallShield 创建安装日志

#define LOGFILE "SetupLog.txt"

export prototype WriteLog(byval string);
function WriteLog(message)   
STRING LogFolder, LogFileName, curDate, curTime;   
NUMBER nvResult, nLogFileHandle;   
begin          
   // specify the log folder             
   LogFolder = WINDISK +  "\\"; 
   if (FindFile(LogFolder, LOGFILE, LogFileName) < 0) then
   OpenFileMode(FILE_MODE_APPEND);   
            CreateFile(nLogFileHandle, LogFolder, LOGFILE);   
            CloseFile(nLogFileHandle);   
        endif;      

        OpenFileMode(FILE_MODE_APPEND);   
        OpenFile(nLogFileHandle, LogFolder, LOGFILE);

        GetSystemInfo(DATE, nvResult, curDate);           
        GetSystemInfo(TIME, nvResult, curTime);   
        message = curDate + "    " + curTime + "    " + message;   
        WriteLine(nLogFileHandle, message); 

        CloseFile(nLogFileHandle);   
 end;

 

发表评论

邮箱地址不会被公开。 必填项已用*标注