Creating a Custom Event Log in a VS.NET deployment project

  • Thread starter Thread starter T
  • Start date Start date
T

T

I have a web site i want to deploy using a VS.NEt set up
project. I have no problems with that, that is fine and
works no problem.

But the web application uses a custom event log to log
application messages. The asp.net application will not be
running under an account with administrative permissions
and so this will not be able to create the custom event
log.

So i wanted to be able to create this during the setup
program. As this will have to be run using an
admisitrative account. Can this be done? How can it be
done?

Any help would be gratefully appreciated.

Thanks
 
Hey Tony,

Within a setup project in VS, you can add a custom installer to perform such
actions. Right-click on your class library project in the Solution Explorer
and choose Add New Item | Code | Installer Class. You will get something
like this:
[RunInstaller(true)]
public class Installer1 :
System.Configuration.Install.Installer {
public Installer1() {
...

// TODO: Add your own logic here
}
}Your custom installer type will be instantiated by the MSI at install time.

The very simplistic approach is to provide the code for your install action
in the constructor (see above "Add your own logic here"). But, if you look
at
http://msdn.microsoft.com/library/e...emConfigurationInstallInstallerClassTopic.asp
you will see that there are various methods you can provide (Install,
AfterInstall, Uninstall, AfterUninstall, Rollback, etc) to deliver a more
robust and intelligent behavior for your custom installer.

google may lead you to some hints and examples:
http://www.google.com/search?hl=en&num=30&q=System.Configuration.Install.Installer
 
Back
Top