Conditionally start services - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

rading
Posts: 2
Joined: Thu May 20, 2010 1:06 pm

Conditionally start services

Hi,

I need to create a public property such as [SERVICESTART] to allow for control af service start in some deployment scenarios.
I want to start my installed services by default, but if the user specifies the SERRVICESTART=NO, then the services should not be started.

In service control operations, i have set my services to start on installation, and stop&delete on uninstallation. As far as i can see, it is not possible to contitionally control these control operations?

Is my alternative to create a vbscript CustomAction, in the InstallExecuteSequence --> StartServices standard action, and set execute conditions on this?

/Rading
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Conditionally start services

Hi Rading and welcome to the Advanced Installer Forums,

You can follow this article from our user guide and condition the mentioned custom action with a UI public property set on user interaction. This way the service will start only if the user choses to.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rading
Posts: 2
Joined: Thu May 20, 2010 1:06 pm

Re: Conditionally start services

Thanks for the quick reply Mihai,

I have got it working now, using a UI_property set through a checkbox.

What i initially was trying to do, was to set a public property through the install parameters section. i created a property named STARTSERVICES here, with a default value of "yes", but i could not get a condition on my custom action to work this way...

Just out of curiosity, how would you create a public property with a default value=yes, without using the dialogs, and have the ability to control a custom action through MSIEXEC parameters only?

/Rading
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Conditionally start services

Hi Rading,
Just out of curiosity, how would you create a public property with a default value=yes, without using the dialogs, and have the ability to control a custom action through MSIEXEC parameters only?
Simply add the property in the Install Parameters like you said and then set the property upon installation using the MSIEXEC CLI:

Code: Select all

msiexec.exe /i "C:\Example.msi" YOUR_PROP="YourValue"
If you already tried this, please attach a test sample project of your attempt so we can assist you further.

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

Return to “Common Problems”