5

I'm trying to install the first service I wrote using:

installutil XMPPMonitor.exe

I get the following message:

Running a transacted installation.

Beginning the Install phase of the installation.
See the contents of the log file for the E:\Documents\Projects\XMPPMonitor\XMPPMonitor\bin\Debug\XMPPMonitor.exe assembly's progress.
The file is located at E:\Documents\Projects\XMPPMonitor\XMPPMonitor\bin\Debug\XMPPMonitor.InstallLog.

The Install phase completed successfully, and the Commit phase is beginning.
See the contents of the log file for the E:\Documents\Projects\XMPPMonitor\XMPPMonitor\bin\Debug\XMPPMonitor.exe assembly's progress.
The file is located at E:\Documents\Projects\XMPPMonitor\XMPPMonitor\bin\Debug\XMPPMonitor.InstallLog.

The Commit phase completed successfully.


The transacted install has completed.

But I'm not setting the service listed when I run services.msc. Am I missing something?

4 Answers 4

5

Make sure you correctly created and configured the ServiceInstaller and ServiceProcessInstaller. These are what installutil uses to actually register each service within the process.

Sign up to request clarification or add additional context in comments.

Comments

3

I asked a similar question recently : C#: Running and Debugging a Windows Service

Apparently the problem was because I did not have an Installer attached to the service.

Here is the tutorial I used to add a Service Installer and so on.

1 Comment

I did create the installer but it still does not work!
1

You might need to refresh the services.msc window, sometimes it doesnt update it if you have it open all the time. Hit F5 to refresh to the window and see if its there.

Comments

1

can we see the code?

What do you have for the Description attribute? Have you clicked F5 (Refresh) in the Services MMC?

public class WindowsServiceInstallerEx : ServiceInstaller
{

  [ComponentModel.Description("A lengthy description of the service that will display in the Description column of the Services MMC applet.")]
  public string ServiceDescription
  {
    get { return serviceDescription; }
    set { serviceDescription = value; }
  }

  public override void Install(System.Collections.IDictionary stateSaver)
  {
    base.Install (stateSaver);

    Microsoft.Win32.RegistryKey serviceKey = null;
    try
    {
      string strKey = string.Format(@"System\CurrentControlSet\Services\{0}", this.ServiceName);

      serviceKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(strKey, true);
      serviceKey.SetValue("Description", this.ServiceDescription);
    }
    finally
    {
      if (serviceKey != null)
        serviceKey.Close();
    }
  }

  private string serviceDescription;
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.