I have created an Winform application which is used to manage Book information and Generate Invoice now there is a Database function in Application which is called in every 6 days,but this function will work only when application is running. So i have created a windows service for this, Now i want to know how to i deploy my windows service with my windows application. Thanks !!!!
3 回答
You must use the installutil utility
installutil (e.g installutil C:\MyService.exe)
From MSDN:
To install a Windows service On the Start menu or Start Page, open the shortcut menu for Developer Command Prompt, and then choose Run As Administrator. Navigate to the folder that contains your project's output. For example, under your My Documents folder, navigate to Visual Studio 2012\Projects\MyNewService\bin\Debug. Enter the following command: installutil.exe MyNewService.exe If the service installs successfully, installutil.exe will report success.
Then go to Start --> Execute and type:
services.msc
Check that your service was succesfully installed and set it's startup type (auto, manual...)
您可以为该服务创建一个安装程序并与您的主应用程序一起安装。你可以在这里看到更多: