cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
klim_c
Level 3

InstallScrip project. How to start windows service under specific account?

Hello,
This is InstallScript project. I'm trying to install windows service. The service is installed and started successfully under local account.
How to start it under specific account assuming that the account/username/password is provided?
Could you please provide me with detailed steps of how to do it in InstallShield 2010 IDE, or with some script snippet if it's done programmatically, or point me to some article ot topic?
Your help would be greatly appreciated.
Thank you in advance,
Klim
Labels (1)
0 Kudos
(3) Replies
ch_eng
Level 7

Klim,

Hopefully some of these links will help out!

Install NT Service Settings: http://helpnet.flexerasoftware.com/robo/projects/installshield16helplib/ComponentInstallNT.htm

Configuring a Component to Install or Uninstall a Windows Service: http://helpnet.flexerasoftware.com/robo/projects/installshield16helplib/IHelpAdvNTServ.htm

Install windows service: http://community.flexerasoftware.com/showthread.php?t=175189&page=2

Starting and Stopping a Service in Basic MSI: http://community.flexerasoftware.com/showthread.php?t=193496

how do I check if my application is running: http://community.flexerasoftware.com/showthread.php?t=194269

HTH
0 Kudos
klim_c
Level 3

ch_eng wrote:
Klim,

Hopefully some of these links will help out!

Install NT Service Settings: http://helpnet.flexerasoftware.com/robo/projects/installshield16helplib/ComponentInstallNT.htm

Configuring a Component to Install or Uninstall a Windows Service: http://helpnet.flexerasoftware.com/robo/projects/installshield16helplib/IHelpAdvNTServ.htm

Install windows service: http://community.flexerasoftware.com/showthread.php?t=175189&page=2

Starting and Stopping a Service in Basic MSI: http://community.flexerasoftware.com/showthread.php?t=193496

how do I check if my application is running: http://community.flexerasoftware.com/showthread.php?t=194269

HTH


Thank you Cheng.
I installed NTService object and associated it with the Feature I want to install and start as the WinService. And it worked fine: service installed and started under any account I provide in the NTService Wizard. I was able to install service with the option of starting or not starting during the installation.
But the problem is that the acoount and credentials should not be hardcoded by the wizard. They need to be collected from the user during the installation process by presenting dialog box where he could enter the accound and the credentials. And then the service should start under provided account. Any ideas please?
0 Kudos
ch_eng
Level 7

Klim,

I haven't had to do this but you might want to try setting the "User Name" and "Password" parameters in your service configuration to be InstallShield Properties that you create and populate (ex: [SERVICE_USERNAME]). I would suggest using a property name with all caps anyway. I don't know if that will work, but if you want to try it, remember the specifications mentioned in the first link:

User Name:

Enter the account under which the service will be logged on. To install the service under the local system account, leave this setting blank. (Microsoft does not recommend installing services that impersonate the privileges of a single user.)

If the service type is Win32 that runs in its own process, the value that you enter should use the following format:

DomainName\UserName

If the service will be logged on under the built-in domain, you can use the following format:

.\UserName


HTH
0 Kudos