14 Şubat 2008 Perşembe

install/uninstall windows services..

INSTALL

To install your Windows service, you must first add a Setup project. With your service project loaded in Visual Studio .NET, select File > Add Project > New Project. From the list of project types, select Setup and Deployment Projects. From the list of templates, select Setup wizard. Set the location appropriate for your situation and click on OK to create the project. In the Setup wizard, skip page 1. On page 2 (of 5) select "Create a Setup for a Windows application." On page 3, select "Primary output from ." On page 4, click on Finish. The final step (a crucial one) is to add a custom action to run the code in the installer class you added to your project (as part of reading the MSDN article). To do that, select View > Editor > Custom Actions. Right-click on the Install node in the Custom Actions treeview. In the Select Item in Project dialog, make sure Application Folder is selected, and click on OK. Click on OK again to select the "Primary output from " option. You should now see this as a child node of the Install node. That's all you have to do. Rebuild both the project and the setup project, run the installation, and the service should be installed as a Windows service.


UNINSTALL

1) Make code changes using VS.NET
2) Uninstall the service using InstallUtil /u PathToSerive.exe
3) At this point the service status is disabled and I have to reboot.

0 yorum: