Using DetectService multiple services - Advanced Installer Community
scambias
Posts: 29
Joined: Tue Nov 19, 2019 3:26 pm

Using DetectService multiple services

Hi all,

I have to build a setup that has two services as features: I need to detect if they're installed so I was thinking to use the DetectService custom action twice (I can rename them). The thing is that the property they generate has the same name (AI_SERVICE_STATE): how can I distinguish whether one or the other service has been detected?
Am I wrong on something?

Thank you very much.
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Using DetectService multiple services

Hello and welcome to Advanced Installer forums,

Indeed, you are right. If you will use two custom actions, the value of the property that stores the results will be overwritten.

A workaround for this would be to have a "Set Property" custom action after each of your "DetectService" custom actions. Basically you will set two different properties (one for each of your servives) to the value of the AI_SERVICE_STATE property. For instance:

DetectService
Set property to the value of AI_SERVICE_STATE
DetectService
Set another property to the value of AI_SERVICE_STATE

After doing so, you can use the two new properties to fulfill your needs.

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
scambias
Posts: 29
Joined: Tue Nov 19, 2019 3:26 pm

Re: Using DetectService multiple services

Thank you very much for your quick reply!
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Using DetectService multiple services

You are always welcome!

Glad I could help.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”