PDA

View Full Version : Writing to Windows Event Log



NewsArchive
01-16-2010, 03:46 AM
In MyApp, I am writing to the Windows Event Log. When I do, the message
below is PrePended to my Event Log message:

------------
The description for Event ID 1 from source MyApp cannot be found. Either
the component that raises this event is not installed on your local
computer or the installation is corrupted. You can install or repair the
component on the local computer.
------------

So my question is am I missing a switch when I build my SB script? Is
there a way to add a description for Event ID X during installation?

Thank you,
David.

NewsArchive
01-16-2010, 03:46 AM
David,

> In MyApp, I am writing to the Windows Event Log. When I do, the message
> below is PrePended to my Event Log message:
>
> ------------
> The description for Event ID 1 from source MyApp cannot be found. Either
> the component that raises this event is not installed on your local
> computer or the installation is corrupted. You can install or repair the
> component on the local computer.
> ------------
>
> So my question is am I missing a switch when I build my SB script? Is
> there a way to add a description for Event ID X during installation?

Are you writing from the SetupBuilder application (MyApp?) to the Windows
Event Log? If yes, how do you do this?

Friedrich

NewsArchive
01-16-2010, 03:47 AM
No, after the install is complete and the user is running MyApp, MyApp
is writing to the Windows Event Log. But, when it does write to the
log, I get the Windows O/S generated message below. It is implying that
something didn't happen during the install of MyApp. I was wondering if
there is a switch or script command that I need to add to my SB install
script so that Windows doesn't display the error message.

david

NewsArchive
01-16-2010, 03:48 AM
David,

> No, after the install is complete and the user is running MyApp, MyApp is
> writing to the Windows Event Log. But, when it does write to the log, I
> get the Windows O/S generated message below. It is implying that
> something didn't happen during the install of MyApp. I was wondering if
> there is a switch or script command that I need to add to my SB install
> script so that Windows doesn't display the error message.

No, this has absolutely nothing to do with the install of your app at all!
It's caused by the code in your application that handles the Windows Event
write actions.

Friedrich

NewsArchive
01-21-2010, 03:16 AM
Not related to this.
One thing which you must do is register your appliaction as follows:

if self.ApplicationName
CurrentPath = LongPath(path())
KeyName =
'SYSTEM\CurrentControlSet\Services\Eventlog\Applic ation\'&clip(self.ApplicationName)
ValName = 'EventMessageFile'
Val_ = clip(CurrentPath)&'\imessages.dll'
IF PutReg(REG_LOCAL_MACHINE, KeyName, ValName , Val_ , REG_SZ)
END
end

And create the event log messages in the s=dll (in this case it would be
imessages.dll).

Benjamin Krajmalnik