"Installation failed due to the absence of a ServiceProcessInstaller" Problem

Furqan Misarwala picture Furqan Misarwala · May 4, 2010 · Viewed 8.8k times · Source

When I start to installing using installutil it gives me following error, I have set ServiceInstaller and ServiceInstallerProcess,

System.InvalidOperationException: Installation failed due to the absence of a ServiceProcessInstaller. The ServiceProcessInstaller must either be the containing installer, or it must be present in the Installers collection on the same installer as the ServiceInstaller.

Any ideas on how to fix the problem?

Answer

jmozko picture jmozko · Sep 28, 2011

I had the same problem with the Installer and found that in the [YourInstallerClassName].Designer.cs at InitializeComponent() method, the dfault generated code is Missing add the ServiceProcessInstaller

        // 
        // [YourInstallerClassName]
        // 
        this.Installers.AddRange(new System.Configuration.Install.Installer[] {
        this.serviceInstaller1});

Just add your ServiceProcessInstaller in my case its:

        // 
        // ProjectInstaller
        // 
        this.Installers.AddRange(new System.Configuration.Install.Installer[] {
        this.serviceProcessInstaller1,   //--> Missing
        this.serviceInstaller1});

and the Setup project works.