none
Installing and Uninstalling a Service!

    Question

  • Hi Guys,
    I have a project of type Windows Service in C# (Framework 3.5). I tried to install this service to my local machine (Vista Ultimate). The command prompt said it is installed successfully but it never appeared under services.  Here is the text from logfile 

    Running a transacted installation.

    Beginning the Install phase of the installation.
    See the contents of the log file for the Z:\PProject\PExec\FuliService.exe assembly's progress.
    The file is located at Z:\PProject\PExec\FuliService.InstallLog.
    Installing assembly Z:\PProject\PExec\FuliService.exe'.
    Affected parameters are:
       logtoconsole =
       assemblypath = Z:\PProject\PExec\FuliService.exe
       logfile = Z:\PProject\PExec\FuliService.InstallLog
    No public installers with the RunInstallerAttribute.Yes attribute could be found in the Z:\PProject\PExec\FuliService.exe assembly.

    The Install phase completed successfully, and the Commit phase is beginning.
    See the contents of the log file for the Z:\PProject\PExec\FuliService.exe assembly's progress.
    The file is located at Z:\PProject\PExec\FuliService.InstallLog.
    Committing assembly Z:\PProject\PExec\FuliService.exe'.
    Affected parameters are:
       logtoconsole =
       assemblypath = Z:\PProject\PExec\FuliService.exe
       logfile = Z:\PProject\PExec\FuliService.InstallLog
    No public installers with the RunInstallerAttribute.Yes attribute could be found in the Z:\PProject\PExec\FuliService.exe assembly.
    Remove InstallState file because there are no installers.

    The Commit phase completed successfully.

    The transacted install has completed.

     This may be of interest to note that when I tried to uninstall the service the following log was generated.

    The uninstall is beginning.
    See the contents of the log file for the Z:\PProject\PExec\FuliService.exe assembly's progress.
    The file is located at Z:\PProject\PExec\FuliService.InstallLog.
    Uninstalling assembly Z:\PProject\PExec\FuliService.exe'.
    Affected parameters are:
       logtoconsole =
       assemblypath = Z:\PProject\PExec\FuliService.exe
       logfile = Z:\PProject\PExec\FuliService.InstallLog
    No public installers with the RunInstallerAttribute.Yes attribute could be found in the Z:\PProject\PExec\FuliService.exe assembly.

    The uninstall has completed.

    Your help will be appreciated.

    Thanks,
    Leo
    Wednesday, August 27, 2008 10:29 PM

Answers

  • Click on START –> PROGRAMS –> ACCESSORIES
    right click on command prompt icon and click on Run as administrator

    Then run your command to install the service
    Gaurav Khanna
    • Marked as answer by New Leo Friday, August 29, 2008 9:25 PM
    Friday, August 29, 2008 3:43 AM

All replies

  • Will creating a Window Service you need to add ServiceProcessInstaller and ServiceInstaller. You might made mistake while adding or configuring it.

    http://msdn.microsoft.com/en-us/library/system.serviceprocess.serviceprocessinstaller.aspx

    Gaurav Khanna
    Thursday, August 28, 2008 4:28 AM
  • I ceated a brand new service and added installer class as below and the exception I am getting now is given below:

    Installing service MyService1...
    Creating EventLog source MyService1 in log Application...

    An exception occurred during the Install phase.
    System.Security.SecurityException: The source was not found, but some or all event logs could not be searched.  Inaccessible logs: Security.

    I am logged on as a user who is member of admin group on this local machine (Vista Ultimate). 
    InitializeComponent is called from the constructor of Installer derived class.
     

     

    private void InitializeComponent()

    {

    this.serviceProcessInstaller1 = new System.ServiceProcess.ServiceProcessInstaller();

    this.serviceInstaller1 = new System.ServiceProcess.ServiceInstaller();

    this.serviceProcessInstaller1.Account = System.ServiceProcess.ServiceAccount.LocalSystem;

    this.serviceInstaller1.ServiceName = "MyService1";

    this.serviceInstaller1.StartType = System.ServiceProcess.ServiceStartMode.Manual;

    this.Installers.AddRange(new System.Configuration.Install.Installer[] {

    this.serviceProcessInstaller1,

    this.serviceInstaller1});

    }

     

    • Edited by New Leo Friday, August 29, 2008 3:42 AM changed some comments
    Friday, August 29, 2008 3:08 AM
  • Click on START –> PROGRAMS –> ACCESSORIES
    right click on command prompt icon and click on Run as administrator

    Then run your command to install the service
    Gaurav Khanna
    • Marked as answer by New Leo Friday, August 29, 2008 9:25 PM
    Friday, August 29, 2008 3:43 AM