PDA

View Full Version : Windows Service Start Type


jzild
05-10-2008, 10:49 PM
I am using MSI Factory to install a Windows Service. By default, I want the service to install Disabled - which I have now and it is working fine. However, after the user installs my program, the service Startup Type may change to either Manual or Automatic based on the user's needs.

So the problem is, when the user installs a new version of my software, it reinstalls the service and resets it back to Disabled. If the service is already installed, I'd like the Startup Type to remain unchanged.

Any ideas how to make this happen?

Thanks,
James

jassing
05-11-2008, 09:55 AM
So the problem is, when the user installs a new version of my software, it reinstalls the service and resets it back to Disabled. If the service is already installed, I'd like the Startup Type to remain unchanged.


Are you using a bootstrapper or just running the .msi?

Adam
05-12-2008, 01:38 PM
I don't see a way to properly query the service through the built in MSI functions. This could be done through our lua script in the bootstrapper or through the Luascript DLL (http://www.indigorose.com/webhelp/msifact/Program_Reference/LuaScript/Using_LuaScript_in_Your_Installer.htm).

Adam Kapilik

jzild
05-21-2008, 11:39 PM
I am using a Bootstrapper but just the standard one that gets built automatically to include the .NET framework download (no customizations).

So if I did it through the Luascript DLL, I'm not sure what I'd have to do? The service files and the service itself are getting installed by the MSI so would I have to remove all that logic from the MSI and move it into the bootstrapper?

Or would I just query the service via the bootstrapper and pass the result into the MSI via a parameter? If that was the case, I don't see any options for conditionally setting the Start Type, so how would I do that?

Thoughts? Thanks for the replies guys.

James