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
.
When user runs the setup.exe file, installation starts and the custom UI shows up. User adds the name for the windows service but how shall I take the ServiceName
as user input during installation and set default service name into service name provided by user during installation in that custom UI.
You need to follow these steps:
Service1.cs
.Service1.cs
and right click and choose Add Installer. It will create aProjectInstaller.cs
.Edit1
tofalse
.)CustomActionData
to/SVCNAME=[EDITA1]
.Open
ProjectInstaller.cs
in your service project and overrideInstall
to setName
orDisplayName
of the service:Then build your projects and install the service.