Passing Multiple Values to CustomAction - 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!

slb
Posts: 2
Joined: Thu Aug 11, 2011 2:23 pm

Passing Multiple Values to CustomAction

How do you pass multiple values to Session in a CustomAction? I created a CustomAction in VB.net (WiX). When I created an embedded CustomAction in Advanced Installer, I placed the variables I wanted to pass to the CustomAction into the "Action Data:" field on the Custom Action Tab (field contents: [ACCESSDB_DIR], [EXCELWB_DIR], [APPDIR]). I placed a session.log within a FOR loop in the CustomAction to see what values are passed to Session.CustomActionData

Key = "C:\Selected Directory\...., D:\Selected Directory\...., C:\Selected Directory\...."
Value = Null

Can you pass multiple values to a CustomAction? If so, what am I doing wrong?

I must be doing something wrong because the values I need are being assigned as a Key and not a Value in Session.CustomActionData.

Are there any examples that show how to pass one or more values to a CustomAction?
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Passing Multiple Values to CustomAction

Hi,

Usually the CustomActionData property is used for Deferred custom actions because these types of custom actions don't have access to public properties directly. You can then parse the content of CustomActionData from within your custom action. This process is explained in the following article:
http://www.advancedinstaller.com/user-g ... rties.html

If your custom action is Immediate, then you can simply reference public properties( containing folder paths in your case ) directly.

I am not sure why the key is populated in a VB.NET custom action and not the value, but here is an article to help with the declaration of the custom action:
http://www.advancedinstaller.com/user-g ... rp-ca.html

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Dean.Wilson
Posts: 6
Joined: Mon Aug 22, 2011 10:17 am

Re: Passing Multiple Values to CustomAction

I have the same problem, and neither of the 2 links referenced above.

The steps in http://www.advancedinstaller.com/user-g ... rp-ca.html work fine if you only want to pass 1 parameter at most.

If we follow these steps what do we need to put into the Action Data to do this?

Please give exact example e.g.
param1="valueHere" param2="valueHere"

Note: The above does not work
Node2: If we are ment to be using a .NET installer class custom action, I can see how to specify multiple parameters but where do I specify which method to call? I cannot see it on any guide or screenshot
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Passing Multiple Values to CustomAction

Hi,

I answered to your other post, please take a look:
http://www.advancedinstaller.com/forums ... 893#p46893

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”