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!

Ashwini Kolan
Posts: 2
Joined: Wed Jan 13, 2016 9:43 am

Standard C++ custom action

Hi team,

I am trying to write a standard custom action and called it through Call function from standard dll.

When I am trying to run it, I get the return code of MsiGetPropertyW as 6. Is there anything wrong in my code snippet. Please suggest.

I also sent a mail with the AIP file and visual studio project. Please reply ASAP.

This is my another sample snippet:

WCHAR vbuff [500] = {0};
DWORD vlen = 500;
UINT gp = MsiGetPropertyW(hInstall, L"SERVER_PROP", vbuff, &vlen);
WCHAR msg [500] = {0};
wsprintfW (msg, L"gp = %d vlen = %d vbuff = %s", gp, vlen, vbuff );
LogMessage (hInstall, msg);
MessageBoxW (NULL, msg, L"Result", MB_OK);
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Standard C++ custom action

Hello Ashwini and welcome to our forums,

You can try to troubleshoot your DLL code using a debug method.

Also, you can try to build your custom action as a DTF custom action with the WiX Toolset and run and debug it as it is exposed in our "Integrate and debug custom actions" user guide article.

If you have any questions let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Standard C++ custom action

Hello Ashwini,

First of all I apologize for my previous reply. We have further investigated your custom action scenario and it seems you cannot use a "Call function from standard DLL" custom action type to get and set installation properties. This is because you should explicitly pass a MSIHANDLE parameter to your DLL function when using the "Call function from standard DLL" action type, but this is not possible using the current implementation of our "Call function from standard DLL" custom action type.

Instead you should use a "Call function from attached native DLL" custom action type to achieve what you need.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”