How to deploy windows Services ?, Deploy windows Services?

Source: Internet
Author: User

How to deploy windows Services ?, Deploy windows Services?

1. Create an installer for the service
1) return to the "design" view of Service1.
2) Click the background of the designer to select the service itself, instead of any content.
3) in the "properties" window, click the "add installer" link in the gray area under the property list.
By default, add component classes that contain two installers to your project. Name the component ProjectInstaller, which contains the service installer and the service-related process installer.
4) access the "design" view of ProjectInstaller and click "ServiceInstaller1 ".
Note: The account attribute of serviceProcessInstaller1 is set to LocalSystem. Otherwise, the installation cannot proceed.
5) in the "properties" window, set the ServiceName attribute to MyNewService.
Note: DisplayName is set to the name displayed in the Administrative Tools service. If it is set to null, It is not displayed in the Administrative Tools service.
6) set the StartType attribute to Automatic.

2. Generate a Service Project
1) In Solution Explorer, right-click your project and select "properties" from the shortcut menu ". The "property page" dialog box of the project appears.
2) In the left pane, select the General tab in the general properties folder.
3) in the "launch object" list, select "MyNewService ".
4) press Ctrl + Shift + B to generate the project.
After a project is generated, you can deploy it. The installation project will install the compiled project file and run the installation program required to run the Windows service. If you want to create a local installation project, you need to export mynewservice.exe to the installation project, and then manually complete the installation of mynewservice.exe.

3. Create an installation project for the service
1) point to "add project" on the "file" menu, and select "new project ".
2) In the "project type" pane, select the "Install and deploy project" folder.
3) Select "Installation Project" in the "template" pane ". Name the project MyServiceSetup.

4. Add MyNewService.exe to the installation project
1) In Solution Explorer, right-click "MyServiceSetup", point to "add", and select "project output ".
The "add project output group" dialog box appears.
2) Select "MyNewService" in the "project" box ".
3) in the list box, select "primary output" and click "OK ".

5. add custom operations to the installation project
1) In Solution Explorer, right-click the installation project, point to "View", and select "Custom operations ".
The custom operation editor is displayed.
2) In the "Custom operations" editor, right-click the "Custom operations" node and select "add custom operations ".
The "select items in project" dialog box appears.
3) double-click "application folder" in the list box to open it, select "main output from MyNewService (activity)", and click "OK ".
The master output is added to all four nodes in the Custom operation-"Install", "Submit", "rollback", and "Uninstall ".
4) generate the installation project.

6. Install Windows Services
View the installation object directory and run the. msifile to install mynewservice.exe.

7. Start and Stop services
Open the Service Control Manager by performing one of the following operations:
1) in Windows 2000 Professional, right-click my computer on the desktop and Click Manage ". On the "Computer Management" console, expand the "services and applications" node. Alternatively, on Windows 2000 Server, click Start, point to programs, click Administrative Tools, and then click Services ".
Note: in Windows NT 4.0, you can open this dialog box from the control panel.
Now we can see that MyNewService is listed in the "service" Area of the window.
2) select your service from the list, right-click the service, and click Start ".
3) Right-click the service and click "stop ".

8. Verify the event log output of the service.
1) Open the server resource manager and access the "event log" node. For more information, see process event logs in server resource manager.
2) Find the MyNewLog list and expand it. You should see the items that the Service performs operations.

9. Uninstall the service
1) on the "Start" menu, open "Control Panel", click "Add/delete programs", find your service, and click "Uninstall ".
2) You can right-click the program icon of the. msi file and select "Uninstall" to uninstall the program.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.