sjeslis
Posts: 308
Joined: Mon Aug 22, 2011 11:40 pm
Contact: Website

Programmatically Set A Service's Start Type Within AI?

I'm creating an Advanced Installer MSM that installs a service. Based on a property I'd like to set the service's "start type" to either automatic or manual. Since Advanced Installer's interface shows Start Type as a dropdown I have a feeling this isn't achievable.

Anyone tried to do something like this?
Scott Jeslis
Senior Software Engineer
Cicero, Inc.
sjeslis
Posts: 308
Joined: Mon Aug 22, 2011 11:40 pm
Contact: Website

Re: Programmatically Set A Service's Start Type Within AI?

The search tool on these forums can be challenging at times. From the Google Search I saw someone requested this as a feature in 2008:

http://www.advancedinstaller.com/forums ... =2&t=20054

Is this still not do-able today?
Scott Jeslis
Senior Software Engineer
Cicero, Inc.
sjeslis
Posts: 308
Joined: Mon Aug 22, 2011 11:40 pm
Contact: Website

Re: Programmatically Set A Service's Start Type Within AI?

Guess the above forum post relates to configurable attributes for a merge module.

What I need to do is make it configurable via an internal property.
Scott Jeslis
Senior Software Engineer
Cicero, Inc.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Programmatically Set A Service's Start Type Within AI?

Hello,
The search tool on these forums can be challenging at times.
You can use the top right search. It searches both the forums, website and user guide.
What I need to do is make it configurable via an internal property.
You can use the following menu:
configurable service.jpg
configurable service.jpg (69.35 KiB) Viewed 7171 times
With the "StartType" values from this MSDN article.

Also, you may find the Configurable Merge Modules Page article and sub articles useful.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sjeslis
Posts: 308
Joined: Mon Aug 22, 2011 11:40 pm
Contact: Website

Re: Programmatically Set A Service's Start Type Within AI?

Mihai,

I don't think you understand, unless I'm missing something.

"Configurable Parameter" I thought was to make the value value configurable AT THE TIME when the MSM is merged into an MSI??? I want it to be configurable when the parent MSI is being installed, i.e. Runtime.

e.g. The parent MSI will query the end user for a start type and pass the value in via a GLOBAL parameter.

Besides the Select Configurable Parameter dialog doesn't even list my local parameters, e.g. XMSTUDIO.4E72A4E1538744C6A2EC5B2DE0D2CEDE

I find it a pain that this dialog displays GUIDs versus any kind of "name".

i.e:
Capture.PNG
Capture.PNG (86.59 KiB) Viewed 7166 times
Scott Jeslis
Senior Software Engineer
Cicero, Inc.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Programmatically Set A Service's Start Type Within AI?

Hello,

Sorry, I didn't get that from your previous posts. Unfortunately setting a flag to automatically set the start type at install time is not possible.

You could try to use "sc.exe" utility in a custom action to change the start type after InstallServices standard action. By doing this you could reference a merge module specific property (e.g. XMSTUDIO.4E72A4E1538744C6A2EC5B2DE0D2CEDE).

If this doesn't work or suit your scenario for some reason, then the only solution is to install and configure the service from a custom action entirely (without using the Services page in the merge module).

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”