Windows Services Can Install Themselves!!!


 

In this short article, I’ll show you a way to make your Windows Services install themselves without needing InstallUtil.exe at all.

Thanks to Reflector for .NET by Lutz Roeder, it’s easy to discover that InstallUtil.exe tool jumps to a method called InstallHelper in the ManagedInstallerClass in the System.Configuration.Install namespace. And what’s really interesting is that the command line arguments passed to InstallUtil.exe as an array of strings are then passed directly to this helper method.

Sample Code:

// First create a new .cs file with the following code

// Add Reference to System.Configuration.Install.dll from the Global Assembly Cache

image 

 

 

Via CodeProject: Windows Services Can Install Themselves. Free source code and programming articles

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s