cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Gvarma
Level 7

Create Instalaltion log file.

hi,

i am looking for a way to log all the result of my installer during installation, perhaps a way to control the occurring events as well.e.g lets say a file is being copied, but file copy operation fails, but sucessfull installation of my product does not depends on just copying of this file, i want to be able to detect this and report it in the dedicated installation log file.

Is there a way?

TIA
Labels (1)
0 Kudos
(14) Replies
esiemiat
Level 9

What type of project are you using? Windows Installer setups can create an ASCII log file detailing what has occured, but InstallScript projects do not. If you want an MSI style log in an InstallScript installer you are going to have to write the code to do this.
0 Kudos
Happy_Days
Level 7

There are lot of file related functions in InstallScript, like OpenFile, CreateFile, OpenFileMode, WriteLine etc. Write a custom function to create the log file using the above functions and call it in each event function.
0 Kudos
jchristman
Level 8

There are entrys in this forum that explain how to create these logs.

MSISCRIPT -
http://community.macrovision.com/showthread.php?t=174986

INSTALLSCRIPT - http://community.macrovision.com/showthread.php?t=180218
0 Kudos
Gvarma
Level 7

Happy Days wrote:
There are lot of file related functions in InstallScript, like OpenFile, CreateFile, OpenFileMode, WriteLine etc. Write a custom function to create the log file using the above functions and call it in each event function.


Verbose doesn't seems to be best choice as suggested by some of the members, considering what you have suggested , how would I trap file copying etc and any other internal event that occurs during installation?

I am using MSI Installscript project.


TIA
0 Kudos
jchristman
Level 8

In installscript. I believe this will also work in a MSI InstallScript project.


//---------------------------------------------------------------------------
// OnInstallingFile
//
// The OnInstallingFile event is called when a file is about to be installed
// as a result of FeatureTransferData or FeatureMoveData.
//
// szFile will contain the full path of file about to be installed.
//---------------------------------------------------------------------------
function OnInstallingFile(szFile)
begin
//Write szFile to your logfile here.

end;
0 Kudos
Gvarma
Level 7

jchristman wrote:
In installscript. I believe this will also work in a MSI InstallScript project.


//---------------------------------------------------------------------------
// OnInstallingFile
//
// The OnInstallingFile event is called when a file is about to be installed
// as a result of FeatureTransferData or FeatureMoveData.
//
// szFile will contain the full path of file about to be installed.
//---------------------------------------------------------------------------
function OnInstallingFile(szFile)
begin
//Write szFile to your logfile here.

end;


Hi,

Function OnInstallingFile(szFile) doesnt seems to be available in MSI Installscript project and I also dont see any alternative to this in MSi installscript project?????????????????????


Any clue?

TIA
0 Kudos
Gvarma
Level 7

Gvarma wrote:
Hi,

Function OnInstallingFile(szFile) doesnt seems to be available in MSI Installscript project and I also dont see any alternative to this in MSi installscript project?????????????????????


Any clue?

TIA


Any clues? also how to I log my custom script actions/functions results in MSI Installscript project?

TIA
0 Kudos
esiemiat
Level 9

If you are using an InstallScript MSI project you should be able to use the built in logging for Windows Installer.
0 Kudos
Gvarma
Level 7

esiemiat wrote:
If you are using an InstallScript MSI project you should be able to use the built in logging for Windows Installer.


Eric,

What is that and how to go about it?

TIA
0 Kudos
jchristman
Level 8

It is all laid out in the this link.

But here is the gist of it.

Media
- Releases
-release 1
- properties show up in the right pane
- choose the setup.exe tab
- MSI Command Line Options

Enter in this line something like this "/L*ve "%TEMP%\Install.log"

This puts the log file "Install.log" in the users TEMP directory, you could do C:\Install.log the "/L*ve" logs everything in verbose and errors. a complete log of everything going on. 😄
0 Kudos
Gvarma
Level 7

jchristman wrote:
It is all laid out in the this link.

But here is the gist of it.

Media
- Releases
-release 1
- properties show up in the right pane
- choose the setup.exe tab
- MSI Command Line Options

Enter in this line something like this "/L*ve "%TEMP%\Install.log"

This puts the log file "Install.log" in the users TEMP directory, you could do C:\Install.log the "/L*ve" logs everything in verbose and errors. a complete log of everything going on. 😄



Ahhh the great Verbose switch again...

Well above option would include whatever is part of MSI but stuff that I am doing using installscripts (without any custom action)...wouldnt be included..this is what i am looking for..somehow I can put errors occured during execution of my Installscript code as well along with MSI.

ANy idea?
TIA
0 Kudos
jchristman
Level 8

you can do a couple of things, you can either open the log file and do a write to it with in installscript or write out a second logfiel and at the end append it to the main logfile. Either can be done with InstallScript.
0 Kudos
Gvarma
Level 7

jchristman wrote:
you can do a couple of things, you can either open the log file and do a write to it with in installscript or write out a second logfiel and at the end append it to the main logfile. Either can be done with InstallScript.


Gotcha...

I guess following what you suggested, if could use try and catch to catch any exception that might occur on the event where return value is not possible.


Thanks again!
0 Kudos
jchristman
Level 8

i do somthing like this

nResult = ListGetFirstString(listID,svString);
if (nResult = END_OF_LIST) then
RecordtoLogFile("Reached End of List - " + nResult);
endif;
nResult = ExistsDir(svString);
if ( nResult < 0) then
RecordtoLogFile("Directory does not Exist - " + nResult)
endif;


RecordtoLogFile is a function that got from the InstallScript thread I posted in here earlier.
0 Kudos