Programmatically Set A Service's Start Type Within AI?

Need help authoring your installer? Ask the community for tips and advice.

Programmatically Set A Service's Start Type Within AI?

Postby sjeslis » Wed Jun 20, 2012 10:18 pm

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?
sjeslis
 
Posts: 144
Joined: Mon Aug 22, 2011 11:40 pm

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

Postby sjeslis » Wed Jun 20, 2012 10:24 pm

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:

viewtopic.php?f=2&t=20054

Is this still not do-able today?
sjeslis
 
Posts: 144
Joined: Mon Aug 22, 2011 11:40 pm

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

Postby sjeslis » Wed Jun 20, 2012 10:28 pm

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.
sjeslis
 
Posts: 144
Joined: Mon Aug 22, 2011 11:40 pm

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

Postby mihai.petcu » Fri Jun 22, 2012 9:02 am

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 516 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
http://www.advancedinstaller.com/
mihai.petcu
 
Posts: 3457
Joined: Thu Aug 05, 2010 8:01 am

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

Postby sjeslis » Fri Jun 22, 2012 2:14 pm

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 511 times
sjeslis
 
Posts: 144
Joined: Mon Aug 22, 2011 11:40 pm

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

Postby mihai.petcu » Mon Jun 25, 2012 12:53 pm

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
http://www.advancedinstaller.com/
mihai.petcu
 
Posts: 3457
Joined: Thu Aug 05, 2010 8:01 am


Return to Building Installers

Who is online

Users browsing this forum: No registered users and 2 guests