Start Service task

Mar 24, 2010 at 5:26 PM

Hi Mike,

What should i enter in the Deployment Script so that the windows service starts after installing on the remote computer?

Thanks & Regards

Arun Prakash

 

Coordinator
Mar 24, 2010 at 11:16 PM

Hi Arun,

If you add a ServiceName element within the MSI element with the service name, it will automaticaly stop the service before uninstalling and restart it after the installation.

<ServiceName>Another Service</ServiceName>

You can also use the deploy_testserver2.xml for an example.

I hope this helps,

Mike

Mar 25, 2010 at 1:00 PM

Hi Mike,

Thanks for the reply. It did help me out. I was able to do the same for my project.

I had one question around the same, does the service gets started automatically on the remote computer when it is installed for the first time?

Thanks and Regards

Arun Prakash

Coordinator
Mar 25, 2010 at 1:05 PM

Hi Arun,

It should automatically start the first time.  The issue is that "logon as service" rights have to be granted to the user before it will automatically start.  If the user account is a local admin it will be automatically granted, if not it won't start but as soon as you manually start the service, the rights will be granted and it will work after that.

Is this consistent with what you are seeing?

Thanks,

Mike

Mar 25, 2010 at 1:45 PM

Mike,

I am an admin on the system, but doesnt start the service after i provide the servicer crediantials for installation. Please find the setting that i have in my deployscript

<DeploymentScript>
 <DeploymentSteps>
    <CleanupPsExec />
<MSI>         
   <UninstallProductCode>{--productcode--}</UninstallProductCode>
   <MSIPathFile>--msi path---</MSIPathFile>
      <ServiceName>---Service Name---</ServiceName>
   <OverrideDefaultArgs></OverrideDefaultArgs>     
  </MSI> 
 </DeploymentSteps>
 <TargetMachines>
  <TargetMachine name="Build Machine name"/>
 </TargetMachines>

</DeploymentScript>

 

Yes it is consistent. I also did start the service manually as well, am i missing anything?

Thanks & Regards

Arun Prakash

Coordinator
Mar 25, 2010 at 2:28 PM

Hi Arun,

The script looks correct.  One thing to look at is the service name.  It is looking for the specific servicename property that is set in the serviceInstaller class.  I don't think it uses the display name.  That might be something to check.  If it is assigning the username and password correctly it would be the same name that is passed into this. 

Do you know if this is the same?

Thanks,
Mike

Mar 25, 2010 at 3:57 PM

Hi Mike,

Its working fine now. It was becasue of the Service name, i had mentioned the display name instead of the one set for servicename in the serviceinstaller class.

Thanks Again.

Regards

Arun Prakash