How can I install a windows service onto a machine that doesn't have Visual Studio installed?

前端 未结 11 1812
悲&欢浪女
悲&欢浪女 2021-01-31 09:08

The only way to install windows-service I know is using \"Visual Studio 2008 Command Prompt\", Is there a way to install windows-service on a machine which isn\

相关标签:
11条回答
  • 2021-01-31 09:39

    I guess that you're looking for the "installutil.exe" program, which one uses to install .NET Windows Services. You can find it in %windir%\Microsoft.NET\Framework\v2.0.50727

    0 讨论(0)
  • 2021-01-31 09:40

    All that's doing is putting the .Net framework tools onto the PATH; you can go still use: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe by specifying the full path on a normal command prompt (obviously adjust for your framework / CPU architecture)

    0 讨论(0)
  • 2021-01-31 09:42

    you can do it with installUtil which resides in the .net framework folder (on my machine it's C:\Windows\Microsoft.NET\Framework\v2.0.50727).

    0 讨论(0)
  • 2021-01-31 09:49

    With visual studio command prompt:

    installutil /i fullfilepathtoservice.exe
    

    Without visual studio command prompt:

    C:\WINNT\Microsoft.NET\Framework\v1.1.4322 installutil /i fullfilepathtoservice.exe
    

    HTH.

    0 讨论(0)
  • 2021-01-31 09:50

    Relevant MSDN page: http://msdn.microsoft.com/en-us/library/sd8zc8ha%28VS.80%29.aspx

    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\installutil.exe yourproject.exe
    

    You don't need to have Visual Studio installed for this to work.

    0 讨论(0)
  • 2021-01-31 09:52

    You can install Windows Services as an MSI. Create the MSI as a normal Project attached to your Service Project.

    In your Service Project Create an Installer Class and add the components serviceInstaller and serviceProcessInstaller and configure as required. Add the Project Output from the Service Project to the MSI Project, Set the Custom Actions of the MSI Project for Install, Commit, Rollback and Uninstall to the Output of the Service Project.

    Alter the MSI Project in any other way as desired, build the MSI, then you will be able to install your Service to any Windows machine without VS.NET or by using the InstallUtil utility application. The MSI will also handle the Uninstall etc.

    There are properties of the serviceProcessInstaller component which you can set for the Account to run the Service under, the serviceInstaller contains properties which can be set such as the Service Name. You will have to set the ServiceName and its Parent, MSDN will provide good information on how to use both of these components.

    0 讨论(0)
提交回复
热议问题