hehongyu2000
Posts: 9
Joined: Mon Mar 01, 2010 3:53 pm

How to pass parameters to DLL function in custom action

I have a custom action that is set to use a function in C++ DLL. The function has several parameters need to be fulfilled with user entered information. How do I configure custom action to pass AI environment variables into function?

Thanks,
Henry
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: How to pass parameters to DLL function in custom action

Hi Henry,

From what I understand you have some controls on the MSI dialogs that will be set by the user. In order
get the values of these public properties you will need to use some special functions defined by Windows
as in the following example.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
hehongyu2000
Posts: 9
Joined: Mon Mar 01, 2010 3:53 pm

Re: How to pass parameters to DLL function in custom action

Thank you for the response. Is it possible to pass something to function with Action Data?
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: How to pass parameters to DLL function in custom action

Hello,

Indeed it is possible to achieve this.
You can use a SetProperty event. Place this event right before you call your the custom action.
The event would be configured as follows:

Code: Select all

Event                                       Argument                              Condition
===============================================================
[CustomActionData]                        <something>
DoAction                                  YourCustomAction.exe        
Replace <something> with whatever you wish to pass to your custom action.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”