Windows Service Development (1. Installation)

Source: Internet
Author: User

recently, due to work requirements, I have written a Program for Windows Services. I will write a lot of experiences one after another.
Please forgive me for talking about installation, because I have always had a misunderstanding: you only need to inherit a class from system.serviceprocess.servicebaseto compile and compile it, and you can use installutil.exe, the command line program of .net. After a try, I found that if the hacker installed installutil.exe, the following information will be output during installation:

D: \> installutil windowsservice2.exe <br/> Microsoft (R ). net Framework installation utility version 1.1.4322.573 <br/> copyright (c) Microsoft Corporation 1998-2002. all rights reserved. <br/> running a transacted installation. </P> <p> beginning the install phase of the installation. <br/> see the contents of the log file for the D: \ windowsservice2.exe assembly's progr <br/> ess. <br/> the file is located at D: \ windowsservice2.installlog. <br/> installing Assembly 'd: \ windowsservice2.exe '. <br/> affected parameters are: <br/> assemblypath = D: \ windowsservice2.exe <br/> logfile = D: \ windowsservice2.installlog <br/> no public installers with the runinstallerattribute. yes attribute cocould be found <br/> in the D: \ windowsservice2.exe assembly. </P> <p> the install phase completed successfully, and the commit phase is beginning. <br/> see the contents of the log file for the D: \ windowsservice2.exe assembly's progr <br/> ess. <br/> the file is located at D: \ windowsservice2.installlog. <br/> committing Assembly 'd: \ windowsservice2.exe '. <br/> affected parameters are: <br/> assemblypath = D: \ windowsservice2.exe <br/> logfile = D: \ windowsservice2.installlog <br/> no public installers with the runinstallerattribute. yes attribute cocould be found <br/> in the D: \ windowsservice2.exe assembly. <br/> remove installstate file because there are no installers. </P> <p> The commit phase completed successfully. </P> <p> the transacted install has completed.
This is because installutil.exe will use the reflection method to find all the systems that set runinstallerattribute to true. configuration. install. installer type, and execute the install method above. If the installation fails, the installation fails.
In this case, we need to write the requirements of installutil.exe from the class inherited by the installerclass.

Windows Service Development (II. debugging)
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.