471,356 Members | 1,688 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,356 software developers and data experts.

Custom install action does not register event log sources

Hi all,

Can somebody give me a hint why my custom install action does not register
event log sources, when I run the MSI package generated by VS2005.

The same install action DLL executed via installutil.exe registers evrything
just fine!

Here's the installer class that I have created:
Code Snippet
[RunInstaller(true)]
public class CustomEventLogInstaller :
System.Configuration.Install.Installer
{
public CustomEventLogInstaller()
{
InstallSource(Settings.Default.EventLogName,
Settings.Default.EventLogSourceAlertService);
InstallSource(Settings.Default.EventLogName,
Settings.Default.EventLogSourceSystem);
InstallSource(Settings.Default.EventLogName,
Settings.Default.EventLogSourceUser);
InstallSource(Settings.Default.EventLogName,
Settings.Default.EventLogSourceError);
}

/// <summary>
/// Installs the EventLog source.
/// </summary>
/// <param name="log">The event log name.</param>
/// <param name="source">The source name.</param>
private void InstallSource(string log, string source)
{
// Create an instance of an EventLogInstaller.
EventLogInstaller myEventLogInstaller = new EventLogInstaller();

// Unregister the source, if it already exists.
if (EventLog.SourceExists(source))
EventLog.DeleteEventSource(source);

// Set the source name of the event log.
myEventLogInstaller.Source = source;

// Set the event log that the source writes entries to.
myEventLogInstaller.Log = log;

// Leave the event log behind after uninstall.
myEventLogInstaller.UninstallAction = UninstallAction.NoAction;

// Add AutoMonEventLogInstaller to the Installer collection.
Installers.Add(myEventLogInstaller);
}
}
Any help is greatly appreciated.
--
http://www.alhambra-eidos.es/web2005/index.html
www.kiquenet.net
http://www.setbb.com/putainformatica...opic.php?p=843
www.trabajobasura.com/solusoft

Jul 7 '08 #1
0 2062

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Angela | last post: by
3 posts views Thread by Vai2000 | last post: by
6 posts views Thread by | last post: by
reply views Thread by Ron Andersen | last post: by
reply views Thread by =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post: by
3 posts views Thread by KennethLundin | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.