Q:

How to modify a vdproj for a Windows service to be associated with a custom account

I have a plain vdproj deployment project I use to install a service I've written.  I want the installer to assign a certain user/pass to the service instead of, say, a local system account.
I've seen examples, but they seem to involve code, whereas my deployment project has no codes file.  Just the .vdproj file.
How can I make this happen?  Thanks.
Background: The service is a C#.NET service targeting framework 4.  The installer is just the stock installer/deployment project offered in VS2010.

A:

If you look at the service process installer object of your Windows Service there is a property for Account which you can set to User.  Doing so will prompt for user credentials during the installation process. 
See: http://msdn.microsoft.com/en-us/library/system.serviceprocess.serviceprocessinstaller.account.aspx
If you want to preseed the Account values you can set the Account type to user and then set the Username and Password properties.
Since the ServiceProcessInstaller is the actual component that installs the service (not the Visual Studio Deployment Project) your interface to the install process is in there.

