Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Creating a log file?


14 replies to this topic

jagdishprabhu

jagdishprabhu
  • Members
  • 13 posts

Posted 20 September 2003 - 13:48

After installation is complete, is there a built-in function which would create a log that contains information about files that were installed , replaced, shared locked version nos...etc?

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 20 September 2003 - 23:24

Sorry, but there's nothing built in to automatically do logging, and as far as I know, no such file information is readily available from IS.

I do have logging setup in my IS projects for debugging/troubleshooting purposes, but it's own my own custom code and is mainly a series of debug messages to know what transpired.
user posted image

Ozone

Ozone
  • Full Members
  • 77 posts

Posted 22 September 2003 - 14:53

Provided that you have Logging ENABLED, the file you seek is [drive]:\Program Files\InstallShield Installation Information\{Your GUID here}\setup.ilg

It is in a hidden folder.

You can view the contents using the appropriate version of the InstallShield Utility 'Log File Viewer'. (ISLogVu.exe)


Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 22 September 2003 - 23:58

Wow, I knew about that file, but not the viewer, so it was basically meaningless up until now. Thanks for the info Ozone.

Edited by Taco Bell, 22 September 2003 - 23:58.

user posted image

jagdishprabhu

jagdishprabhu
  • Members
  • 13 posts

Posted 30 September 2003 - 05:07

Log file is required by customers to whom i'm deploying the setup so can i convert this mentioned file to .txt file and copy it to specified folder. The utility u mentioned requires series of ocx to be registered which is not feasible. Is there any other way for this? Please help.

Ozone

Ozone
  • Full Members
  • 77 posts

Posted 30 September 2003 - 14:58

I have an Install that writes a custom text log file for our Customer Support Dept.
It logs the file name, date, and time attributes of every file ‘moved’ – installed. I added script to the Move Data – Installing File event.
The function LOG_File_Create(); opens the log file in append mode. You will have to write your own function to open and append to the file.

This script does not do all that you requested, but maybe it is a starting point.


CODE

///////////////////////////////////////////////////////////////////////
//
// FUNCTION: OnInstallingFile(File)
//
// Purpose: To log all installed patched files in YourFileHere.log
//
// NOTE:  This function is called in each component
//
// Added:  02/26/2002 TEB
//
///////////////////////////////////////////////////////////////////////

function OnInstallingFile(File)

STRING svDATE_ATTR,
 svTIME_ATTR,
 svSpacer;
NUMBER nvResult,
 nvDifference,
 ret;

begin

if ( File % TARGETDIR ) then  // if the full path in <File> has TARGETDIR then put in LOG file
   
LOG_File_Create();  // You need to write your own code to create and append to the log file of your choice.

   ret = GetFileInfo ( File , FILE_DATE , nvResult , svDATE_ATTR );
   if ret = 0 then
    svDATE_ATTR = "  Dated: " + svDATE_ATTR;
   endif;
   
   ret = GetFileInfo ( File , FILE_TIME , nvResult , svTIME_ATTR );
   if ret = 0 then
    svTIME_ATTR = "  Time: " + svTIME_ATTR;
   endif;
   
   nvResult = StrLength ( File );
   nvDifference = 26 - nvResult;
   
   // Spacer to line up text in log file...
   while nvDifference > 0
       svSpacer = svSpacer + "=";
       nvDifference = nvDifference - 1;
   endwhile;
       
   WriteLine ( nvLOG_FileHandle , "Installing patch file " + svSpacer + " " + File + svDATE_ATTR + svTIME_ATTR );
CloseFile ( nvLOG_FileHandle );

endif;

end;


jagdishprabhu

jagdishprabhu
  • Members
  • 13 posts

Posted 01 October 2003 - 04:43

Would definately try it out and let u know. thnxs ozone.

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 01 October 2003 - 14:16

I'm curious Ozone. Where does the file parameter come from? You say its called with each component, but how exactly?
user posted image

Ozone

Ozone
  • Full Members
  • 77 posts

Posted 01 October 2003 - 15:45

The ‘File’ argument is provided by InstallShield’s default script in obevents.rul and Events.rul. Exactly which .dll file this function is in, is unknown to me. Below is the default code. I assume that IS loops through this function for each file installed, because that is the behavior that I have observed.

The same argument is in the default function OnUninstallingFile(File).

//////////////////////////////////////////////////////////////////////////////
//
// FUNCTION: OnInstallingFile
//
// EVENT: Installing File event is sent before a file that is being installed
//
// ARGUMENTS: File - full path of file being installed
//
///////////////////////////////////////////////////////////////////////////////
function OnInstallingFile(File)
begin
end;


Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 01 October 2003 - 16:36

Okay, thanks Ozone.
user posted image

jagdishprabhu

jagdishprabhu
  • Members
  • 13 posts

Posted 03 October 2003 - 09:48

Ozone, ur solution did work for dlls and exe that went into my application directory but for files that go into system32 directory are not captured. Probably becoz of condition
if(File%TARGETDIR).
Can this problem be overcomed? Can i give if(File%TARGETDIR | File%WINSYSDIR). pls suggest.

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 03 October 2003 - 14:11

Seem like that new if condition would be sufficient jagdishprabhu, or just outright remove the conditional statement to ensure that EVERY file is logged.

Edited by Taco Bell, 03 October 2003 - 14:11.

user posted image

jagdishprabhu

jagdishprabhu
  • Members
  • 13 posts

Posted 08 October 2003 - 11:14

But what abt the the datetime for my application dlls and exes going into my appln directory? they are not captured. Any reasons?

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 08 October 2003 - 14:32

Well if the return codes fail, then it won't right the date & time, so maybe you can step through it the debugger and figure out why that is happening. Not sure off the top of my head though since I didn't write the code, but maybe Ozone knows.

Edited by Taco Bell, 08 October 2003 - 14:33.

user posted image

Ozone

Ozone
  • Full Members
  • 77 posts

Posted 08 October 2003 - 14:48

To jagdishprabhu,

Your post dated 10-03-2003 stated that it worked fine logging into TARGETDIR but not the WINDIR. Removing the filter [ if ( File % TARGETDIR ) then ] will allow all files to be logged as suggested by Taco Bell. Below is a sample of what your log file should contain.

Installing patch file ====== C:\Alpha\Tkiscale.exe Dated: 2003\10\02 Time: 10:43:44
Installing patch file ======== C:\Alpha\TKPOST.EXE Dated: 2003\04\28 Time: 11:58:26
Installing patch file ======= C:\Alpha\TKPRICE.EXE Dated: 2003\04\24 Time: 10:2:32
Installing patch file ====== C:\Alpha\TKREXCEP.EXE Dated: 2003\04\24 Time: 9:33:12
Installing patch file ====== C:\Alpha\Tkrsale3.exe Dated: 2003\09\29 Time: 19:44:42


Without seeing your code I would just be guessing. Did you check to make sure that the String and Numeric variables defined locally in the function are not the same as some Global String and Numeric variables?