rqcoder
Posts: 2
Joined: Fri Jun 15, 2012 4:39 pm

Help, Call Function from Standard DLL

Having a hard time getting this work... using version 7.3.1
Here is the function definition I was provided and I have verified that it works with a small utility application:

function MyFunction(Msg : UINT; wParam : WPARAM; lParam : LPARAM) : LRESULT; stdcall;
Msg: represents and enumerated value
wParam : PChar of some string
lParam : some number

I add the dll as a temporary file since it is not required after the installation is complete. Create a custom action that calls a function from a standard dll using the standard calling convention. I set the return type of integer, my arguments are:

Msg: unsigned integer by value
wParam: unicode string by reference
lParam: integer by reference

It seems the function is called without incident but the expected results from calling that function are not attained. Do I have all the arguments setup correctly?

I've also tried differnt variations (not all) and still not getting what I need. This call requires elevated rights and I can only assume since the installer prompts the user for them that the custom action is being executed using elevated rights... is this not the case?

Thanks for any help or insight...
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Help, Call Function from Standard DLL

Hi and welcome to Advanced Installer forums,
This call requires elevated rights and I can only assume since the installer prompts the user for them that the custom action is being executed using elevated rights... is this not the case?
You can try to use "Deferred with no impersonation" execution option for your custom action. This way it will run under the local system account with full Administrator privileges instead of impersonating the current user.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rqcoder
Posts: 2
Joined: Fri Jun 15, 2012 4:39 pm

Re: Help, Call Function from Standard DLL

Thank you for the suggestion but I'm not seeing anything different.

Do you have a sample project that calls a standard dll as an example? I'd like to have a working example then see what I'm doing different that is causing this not to work.

I've issolated this custom action into its own installer project to take all the variables out from the main application install and still not having any success... its almost like it is not making the call. I am able to call the dll using a sample application and get the expected results, so either it is not working or I am setting it up wrong (I assume the latter).

Were there any known issues with this feature in version 7.3.1? do I need to upgrade?
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Help, Call Function from Standard DLL

Hello,

Here's Call a function from a standard dll thread that describes how to use this custom action type.

Also, you may also find some information in Call function from standard DLL user guide reference.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”