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;