EventLog write permissions

By default, any authenticated user is able to write to application event log. However only administrators can create new event Sources. If all event Sources are known at the service installation time, I recommend register those sources ahead of time, then you will be all set up. Registering is a simple call to EventLog.CreateEventSource. If … Read more

Upgrade a Windows Service without Uninstalling

I’ve done this with WiX, which generates .MSI files using the ServiceInstall & SeviceControl commands: <Component Id=’c_WSService’ Guid=’*’> <File Id=’f_WSService’ Name=”WSService.exe” Vital=”yes” Source=”..\wssvr\release\wsservice.exe” KeyPath=”yes” /> <ServiceInstall Id=’WSService.exe’ Name=”WSService” DisplayName=”[product name]” Type=”ownProcess” Interactive=”no” Start=”auto” Vital=”yes” ErrorControl=”normal” Description=’Provides local and remote access to [product name] search facilities.’ /> <ServiceControl Id=’WSService.exe’ Name=”WSService” Start=”install” Stop=’both’ Remove=”uninstall” Wait=”yes” /> </Component> … Read more

Best practice for writing a self-updating windows service [closed]

Google have an open-source framework called Omaha which does exactly what your point 1. describes. It runs as a scheduled Windows task in the background, outside the applications it manages. Google use Omaha to auto-update their Windows applications, including Chrome. Because it comes from Google, and because it is installed on every Windows machine that … Read more

how to run(F5) windows service from visual studio

Copied from here. static void Main(string[] args) { DemoService service = new DemoService(); if (Environment.UserInteractive) { service.OnStart(args); Console.WriteLine(“Press any key to stop program”); Console.Read(); service.OnStop(); } else { ServiceBase.Run(service); } } This should allow you to run from within Visual Studio. Another way would be to embed a programmatic breakpoint in your code by calling … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)