Does NAnt have the ability to install or uninstall a windows service, using the InstallUtil utility or whatever else?
相关问题
- Inheritance impossible in Windows Runtime Componen
- how to get running process information in java?
- Is TWebBrowser dependant on IE version?
- How can I have a python script safely exit itself?
- I want to trace logs using a Macro multi parameter
相关文章
- 如何让cmd.exe 执行 UNICODE 文本格式的批处理?
- 怎么把Windows开机按钮通过修改注册表指向我自己的程序
- Warning : HTML 1300 Navigation occured?
- XCopy or MOVE do not work when a WCF Service runs
- Bundling the Windows Mono runtime with an applicat
- Windows 8.1 How to fix this obsolete code?
- CosmosDB emulator can't start since port is al
- How to print to stdout from Python script with .py
If your service can be installed at different places, you can also uninstall it through its name using SC.EXE, as follows:
You can call Nant's exec task to call InstallUtil and can pass parameters to install or uninstall a service easily
If you use the TopShelf Project in your application to host your services, you can get command-line based tools for installing / removing the services without needing InstallUtil.
ServiceName.exe service install ServiceName.exe service uninstall
And you can run the service directly and get a nice console window that you can CTRL+C to stop. You can integrate this directly into nant or msbuild by executing the program.
Nant or MSBuild? What's the problem with just running installutil yourself - that's what you'd do in MSBuild. (In general, builds dont do the installs for things like this as rule as typically your build should be able to run on a random build server).
Another option, which would take installutil out of the equation is adding a self-install option to your service like this (have a search for more by looking for
self install windows service
)