How to pass the parameters (in UNICODE format) to a DLL func - 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!

yogesh12
Posts: 23
Joined: Mon Sep 01, 2008 6:52 am

How to pass the parameters (in UNICODE format) to a DLL func

We have a DLL that has a function PerlServiceExecOpt and it has 2 parameters.
NOTE: The passing parameters are of type UNICODE or wide character.

DLL NAME: TestDLL
FUNCTION: PerlServiceExecOpt "C:\Perl\bin\perl.exe", "-S C:\Program Files\Test\service.pl --install"

We have created 2 properties
PARAM1 value is "C:\Perl\bin\perl.exe"
PARAM2 value is "-S C:\Program Files\Test\service.pl --install"

these values are hard coded as of now but will be replaced by the properties.

We have written a CA: TestCA
Source Path: path of the DLL file
Source Type: DLL
Function Name: PerlServiceExecOpt [PARAM1] [PARAM2]

How should we pass the parameters to the DLL function?

We have tried out different options as
Function Name: PerlServiceExecOpt "C:\Perl\bin\perl.exe", "-S C:\Program Files\Test\service.pl --install"
but nothing seems to work and we alway get the message as "A DLL required for this install to complete could not be run.". Please suggest.

Where should we get/collect the return value of the DLL function?

Thanks in advance for you valuable time.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: How to pass the parameters (in UNICODE format) to a DLL func

Hi,
How should we pass the parameters to the DLL function?
Please note that a function in a DLL used as a custom action cannot receive parameters. However, it can access installer properties through the MsiGetProperty and MsiSetProperty. Also, please note that this type of DLL must be written in a specific way. You can find a sample DLL custom action in the Serial Number Validation DLL article in the User Guide.
Where should we get/collect the return value of the DLL function?
I'm afraid that the return value of a custom action is handled automatically by Windows Installer. Therefore, it cannot be retrieved during the installation.

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

Return to “Common Problems”