Windows Service and General win Program Package Installation Method 1: (1) create a new windows Service Project Server1 (2) Open Service1 Code view, locate OnStart, and add code (3) switch to the design view, right-click to add the installation program www.2cto.com (4), and switch to the newly generated project installer. in the cs design view, locate serviceProcessInstaller1, set the Account attribute to LocalSystem, and set the ServiceName attribute of serviceInstaller1 to Server1 (Service name ), startType is set to Automatic (the service is automatically started when the system starts) (5). Close the project just now. (6) create a new installation project ServerSetup (we set up an installation project for the service just now) (7), right-click, add, project output, Master output, select Service1, and click OK (8), right-click-View-custom operation-custom Operation Right-click-add custom operation-open application folder-select the primary output just now-OK (9), re-generate this installation project-right-click-install (10), in the Service Manager (my computer-right-click-Manage-service and application-service) Find Server1 service, start the service and install and deploy a general win program to install and deploy the windows Service. The installation will be a win program, and you must uninstall it through the control panel. Method 2: Install the bat file in the windows Service Directory (usually bin/debug/) as follows: % SystemRoot % \ Microsoft. NET \ Framework \ v4.0.30319 \ installutil.exe windowsservice application .exe Net Start service name SC config service name = autopause (This shows debugging information) www.2cto.com uninstall as follows: % SystemRoot % \ Microsoft. NET \ Framework \ v4.0.30319 \ installutil.exe/u windowsservice Application name .exe or SC delete service name