2013年5月22日水曜日

Note to myself: Creating a self-installing .NET Windows Service

(This is not about Java. Its about .NET)

It took me while to get it working, so I am writing a note to myself for future reference.

  • In Visual Studio .NET IDE, do "Add -> New Item..."
  • Select "Installer Class"

Your new installer class is added to your project. Next, we want to add ServiceProcessInstaller and ServiceInstaler from the Toolbox but you won't see them in the Toolbox by default.

To make these two components to show up:

  • Right-mouse click on Toolbox and select "Choose items..."
  • Look for these components and select them.

Both SeviceProcessInstaller and ServiceInstaller components will show up in the Toolbox, so drag them to the Installer's designer.

Select each item on the designer and F4 to show its properties and configure them (Google to learn details about  what to set)

That should do.

Earlier, I tried to create an Installer class manually without using IDE designer and I ran into too many weird issues. Then, the designer approach worked in two minutes.

0 件のコメント:

コメントを投稿