I have created an installer to install a windows service. Installer should ask user to name the service. Hence, I have created a custom UI in the installer with TextBox
You need to follow these steps:
Service1.cs
.Service1.cs
and right click and choose Add Installer. It will create a ProjectInstaller.cs
.Edit1
to false
.)CustomActionData
to /SVCNAME=[EDITA1]
.Open ProjectInstaller.cs
in your service project and override Install
to set Name
or DisplayName
of the service:
public override void Install(IDictionary stateSaver)
{
string value = Context.Parameters["SVCNAME"];
this.serviceInstaller1.DisplayName = value;
base.Install(stateSaver);
}
Then build your projects and install the service.