Elango Thanumalayan
Elango Thanumalayan

Reputation: 57

Installing a Windows Service

I have created a Simple windows service to be used in my project. Is it better to install it using the InstallUtil.exe in CMD Promt (or) By creating *.Msi file. I have to install this Service in all the systems in office...

If I prefer *.Msi file, what are the steps to be followed....while installing the setup. (Is it needed to update the system registry ?).......

Upvotes: 1

Views: 288

Answers (2)

Christopher Painter
Christopher Painter

Reputation: 55571

Sadly that while the use of InstallUtil is a documented way to do it, it's not the ideal way. Using the ServiceInstall and ServiceControl tables is the correct most robust way to do it in the context of a Windows Installer database.

Upvotes: 1

Matt Davis
Matt Davis

Reputation: 46034

If your project requires a formal install (and most do), the .msi approach makes more sense. Users today expect a program to install itself and later uninstall itself completely. This requires more than what InstallUtil offers. That said, if you will be installing the program on the systems in your office, InstallUtil is an option worth considering for its simplicity.

On my project, we require a formal installer and use InstallShield. However, we leverage the InstallUtil program from InstallShield to actually install the service portion of the product. And we do this by having the Windows service install itself via the command line by leveraging the same InstallUtil internals directly within the service. The InstallShield program kicks off a .bat file that simply executes the Windows service from the command line with a -install argument (e.g., MyService.exe -install). For an example of how to do this, please see the step-by-step instructions here.

Upvotes: 2

Related Questions