DetectService Method in IU Custom Actions - 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!

canuzun
Posts: 15
Joined: Fri Jul 15, 2011 8:25 am
Location: Turkey

DetectService Method in IU Custom Actions

Hi,
i can detect services from InstallUISequence or InstallExecuteSequence. I assign service name to a property and use the property in "Action Data".
1.jpg
1.jpg (42.05 KiB) Viewed 7239 times
However when i try to do the same on UI Custom Actions, i can not find Action Data, i can chose detect service, but how can i set which service.
2.jpg
2.jpg (34.26 KiB) Viewed 7239 times
Or am i doing something, i shouldn't be doing :)

Thanks

can uzun
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: DetectService Method in IU Custom Actions

Hi,

For UI custom actions you can set the special property "CustomActionData". This is the equivalent of the field "Action Data" for sequence custom actions.

So what you need is another UI custom action that sets the above property to the name of your service, and schedule it to be
called exactly before the UI custom action which detects the state of the service.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
canuzun
Posts: 15
Joined: Fri Jul 15, 2011 8:25 am
Location: Turkey

Re: DetectService Method in IU Custom Actions

Hi Bogdan,
this worked like a charm.

Thank you.

can uzun
invalidptr
Posts: 79
Joined: Thu Nov 18, 2010 7:10 pm

Re: DetectService Method in IU Custom Actions

Yes, thanks Bogdan, he's what I did in this situation: create a Script Inline and set the Script Text to:

Code: Select all

Session.Property("CustomActionData")=Session.Property("LOCATION_GUID")
invalidptr
Posts: 79
Joined: Thu Nov 18, 2010 7:10 pm

Re: DetectService Method in IU Custom Actions

Is there a way to set a public Property in my code? I have a C# WixCA dll and want to pass Properties in (which this thread help me do) but change a public property from within my C# code. Is this possible?
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: DetectService Method in IU Custom Actions

Hi,

Yes, this is possible in this type of custom action. The following forum post has more details:
http://www.advancedinstaller.com/forums ... 751#p47436

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
invalidptr
Posts: 79
Joined: Thu Nov 18, 2010 7:10 pm

Re: DetectService Method in IU Custom Actions

Thanks, Bogdan. Given your prior link setting CustomActionData would seem unnecessary in this situation since I can just use YourVariable = session["YOUR_PROPERTY"]; in my code. Under what scenario would I use CustomActionData instead of an assignment in my C# code.
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: DetectService Method in IU Custom Actions

Hi,

In this case this is correct, you don't need to add another level of indirection. To set "CustomActionData" for UI custom actions is required only when you are using one of our predefined custom actions that need to have their input information in this specific property, like "Detect Process".

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”