installation - Installing a Windows Service without Visual Studio's installutil.exe

07
2014-07
  • djechelon

    In a few days I'll be installing a Windows Service I developed on my development machine (which ultimately hosts a WCF-over-SOAP service) on a staging machine.

    Since I have Visual Studio 2013, I can use VS command prompt to install that service using installutil.exe.

    But target machine runs a plain old Windows Server 2008 R2

    How do I install a .NET windows service on WS2008 that has no installutil.exe?

  • Answers
  • allquixotic

    Unfortunately, as of Visual Studio 2012, Microsoft has deleted the "Setup Project" built-in feature of Visual Studio, in a move which I opine was a nod to their long-time business partner, InstallShield (owned by Flexera software). They removed this feature because they wanted to direct their customers to use hideously expensive third-party software to graphically build Windows Installers using InstallShield. Now, if you want to graphically design a setup project in Visual Studio 2012 or 2013, you must either:

    1. Download the free but extremely feature-limited "InstallShield LE", which constantly tries to upsell you to their extraordinarily expensive products, and is unable to do 99% of the useful things you might need it to do (highly un-recommended after trying this);

    2. Learn WiX and use the free WiX toolkit to build an installer (not particularly easy, but doable);

    3. Learn NSIS and use the free NSIS toolkit to build an installer (not particularly easy, but doable);

    4. Write a C# program that programmatically registers the service, per the example here on Stack Overflow. Your code will depend on the System.Configuration.Install assembly, which is available in the Client Profile (thankfully). See MSDN for details. This is perhaps the "simplest" way; you just ship your service as an EXE with a Main method...


  • Related Question

    command line - Error Installing Service with InstallUtil
  • Lando

    I've recently created a Windows Service and am attempting to install it using InstallUtil.

    The service I am trying to install works/installs correctly on a machine running Windows 2008, but I am having trouble getting that same service to install on a Windows 2003 Box.

    After running InstallUtil.exe WindowsService.exe in a Command Prompt (Running as an Admin) I get this Error:

    An exception occurred during the install phase.
    System.ComponentModel.Win32Exception: Access is denied
    The RollBack phase of the installation is beginning... etc.
    ... The installation failed, and the rollback has been performed.

    What could be causing the error in my install, considering this exact Windows Service installs correctly on the Windows 2008 box?


  • Related Answers
  • grawity

    Win32Exception: Access is denied

    Windows does not allow you to do something because of security restrictions. Use Process Monitor to find out what exactly.