home *** CD-ROM | disk | FTP | other *** search
- //
- // Date Last Modified: Monday, October 02, 2006
- //
- // Modified By: Mark Ritter (mritter) & Michael Mims (zorphnog)
- //
-
-
- function OpenLogFile()
- {
- position="installer_log.js";
- whatfunc="OpenLogFile()";
-
- var logFile;
-
- if (LogInstallation)
- {
- if (LogPath=="")
- {
- // alert(getText(NoLogFileSpecified)+"\n"+DefaultLogPath);
- LogPath=DefaultLogPath;
- }
-
- logFile=ReplacePath(LogPath[0]);
- try
- {
- WshShell.regWrite("HKEY_CURRENT_USER\\Software\\WPI\\LogPath",LogPath,"REG_SZ");
- }
- catch (ex)
- {;}
-
- if (ResumeInstall)
- {
- try
- {
- logHandle = fso.OpenTextFile(logFile,8,false);
- }
- catch (ex)
- {
- // alert(getText(CouldNotOpenLogFile)+"\r\n"+logFile);
- LogInstallation=false;
-
- return;
- }
- }
- else
- {
- try
- {
- logHandle = fso.CreateTextFile(logFile,true);
- logHandle.WriteLine(getText(WPIInstallLogFile)+"\r\n");
- logHandle.WriteLine(getText(InstallProcessStarted)+" "+LogTimeStamp());
-
- LogGlobalVariables();
- }
- catch (ex)
- {
- // alert(getText(CouldNotCreateLogFile)+"\r\n"+logFile);
- LogInstallation=false;
-
- return;
- }
- }
- }
- }
-
-
- function LogGlobalVariables()
- {
- position="installer_log.js";
- whatfunc="LogGlobalVariables()";
-
- WriteLogLinePlain("\r\nGlobal variables:");
- WriteLogLinePlain(" %OSLANG%="+oslang);
- WriteLogLinePlain(" %WPIPATH%="+wpipath);
- WriteLogLinePlain(" %ROOT%="+root);
- WriteLogLinePlain(" %CDROM%="+cddrv);
- WriteLogLinePlain(" %DOSPATH%="+dospath);
- WriteLogLinePlain(" %SYSTEMDRIVE%="+sysdrv);
- WriteLogLinePlain(" %WINDIR%="+windir);
- WriteLogLinePlain(" %PROGRAMFILES%="+programfiles);
- WriteLogLinePlain(" %TEMP%="+temp);
- WriteLogLinePlain(" %SYSDIR%="+sysdir);
- WriteLogLinePlain(" %ALLUSERSPROFILE%="+allusersprofile);
- WriteLogLinePlain(" %USERPROFILE%="+userprofile);
- WriteLogLinePlain(" %APPDATA%="+appdata);
- WriteLogLinePlain(" %COMMONPROGRAMFILES%="+commonprogramfiles);
- }
-
-
- function LogTimeStamp()
- {
- position="installer_log.js";
- whatfunc="LogTimeStamp()";
-
- var DateStamp = new Date();
-
- return DateStamp.toLocaleString();
- }
-
-
- function StartLogEntry(prog)
- {
- position="installer_log.js";
- whatfunc="StartLogEntry()";
-
- if (LogInstallation)
- logHandle.WriteLine("\r\n-----\r\n\r\n"+LogTimeStamp()+"\r\n Program: "+prog.prog+"\r\n UID: "+prog.uid+"\r\n Order: "+prog.ordr+"\r\n Category: "+prog.cat);
- }
-
-
- function WriteLogLine(logTxt)
- {
- position="installer_log.js";
- whatfunc="WriteLogLine()";
-
- if (LogInstallation)
- logHandle.WriteLine(" "+LogTimeStamp()+"\r\n "+logTxt);
- }
-
-
- function WriteLogLinePlain(logTxt)
- {
- position="installer_log.js";
- whatfunc="WriteLogLinePlain()";
-
- if (LogInstallation)
- logHandle.WriteLine(logTxt);
- }
-
-
- function CloseLogFile()
- {
- position="installer_log.js";
- whatfunc="CloseLogFile()";
-
- if (LogInstallation)
- {
- logHandle.WriteLine("\r\n-----");
- logHandle.WriteLine("\r\n"+getText(InstallProcessFinished)+" "+LogTimeStamp());
-
- logHandle.Close();
- }
- }
-