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