HI ALL..
Recently I came across a situation where I required to install a windows service on remote server. I created a windows service application and tried to install on local machine, when it prompted for user credentials for the service, I entered domainName\CurrentUserName and current user password. this works perfect when your local machine or remote server is in domain. But what if it is in a workgroup ??
Here I have a solution where where you can install windows service without specifying user credentials.
Open projectIstaller.vb file in solution explorer. Go to InitializeComponent() method, and write following line to specify your service is a Local System service.
InitializeComponent()
Me.ServiceProcessInstaller1.Account = System.ServiceProcess.ServiceAccount.LocalSystem (in VB.NET)
this.ServiceProcessInstaller1.Account = System.ServiceProcess.ServiceAccount.LocalSystem (in C#)
Now rebuild your application and setup project. Now install setup project. It won't ask for username and password.YOU R DONE !!
Hope this will resolve your service installation problem.In case of any further problem..fell free to reply me.