0

I'm using the Visual Studio Installer Projects Extension to create a .msi for my project.

The installer seems to work ok for the most part, but it won't kick off my service after install and I have to run MyService.exe manually.

Is there a way to do this? Or could I inject some custom installer code somewhere?

rocklobster
  • 609
  • 2
  • 10
  • 23
  • You mean MSI is getting installed successfully but the service doesn't get started always? or sometimes it fails to start ? – Kurubaran Dec 09 '14 at 21:24
  • So the extension creates all the install folders and copies the required files which is great. It doesn't however register my service (not listed under services.msc). I've now created a service installer class, but not sure how if at all I can use that with the extension – rocklobster Dec 10 '14 at 00:56
  • Thats the right way to go. you should create a service installer class and add the project where the class resides as primary out put to the installer project then add the primary output to custom actions.(install/commit/uninstall) – Kurubaran Dec 10 '14 at 08:06

3 Answers3

1

Viusal Studio Installer projects don't expose Windows Installer's underlying ServiceInstall / ServiceControl tables. This forces developers to reinvent the wheel using custom actions resulting in fragile installers.

Windows Installer XML can author merge modules that properly implement ServiceInstall / Service Control. You can then reference that merge module into your Visual Studio Installer to accomplish the task with breaking best practices. A discussion of this can be found here:

Augmenting InstallShield using Windows Installer XML - Windows Services

Redemption of Visual Studio Deployment Projects

IsWiX Tutorials - How to author a Windows Service using WiX / IsWiX

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
0

Microsoft has described the process of creating a service installer in this MSDN article: How to: Add Installers to Your Service Application

Oliver Ulm
  • 531
  • 3
  • 8
0

See if this helps:

http://www.installsite.org/pages/en/msi/tips.htm

Scroll down to Installing Services with Visual Studio.

It's a tool for adding the ServiceInstall/ServiceControl features to a VS setup. I haven't updated it for a while but all the source is there.

PhilDW
  • 20,260
  • 1
  • 18
  • 28