To install a Windows service
1. On the Start menu or Start Page, open the
shortcut menu for Developer Command Prompt, and then choose Run As
Administrator.
2.Navigate to the folder that contains your project's output. Navigate to D:\..\bin\Debug
3.Enter the following command:
installutil.exe program.exe
4.
Provide credentials and password.
(domain\username)
5.
If the service installs successfully,
installutil.exe will report "The transacted install has completed"
6. Go t to Computer Management and start the
service “program”
7. Check the progress from Application log file under Windows Log (If you have written the log to Application)
To uninstall windows service
1.
On the Start menu or Start Page, open the
shortcut menu for Developer Command Prompt, and then choose Run As
Administrator.
2. Navigate to the folder that contains your
project's output. For example, D:\..\bin\Debug
3. Enter the following command:
installutil.exe /u program.exe
4. If the service uninstalls successfully,
installutil.exe will report that your service was successfully removed. ("The uninstall has completed.")