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!

afreesoul
Posts: 10
Joined: Sun Jan 04, 2015 8:15 am

about Call function from standard DLL

Hi,

I add a custom action that Calling function from standard DLL. But in the DLL I use MsiGetProperty or MsiSetProperty, It always failed.
how can I do to make it succeed?
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: about Call function from standard DLL

Hi,

By standard DLL we refer to DLL files built for Win32 applications, which are not aware of the Windows Installer API.

For accessing the API, thus being able to call MsiSetProperty and MsiGetProperty methods you need to build a native Windows Installer DLL. The linked article has an example and a sample available for download.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
afreesoul
Posts: 10
Joined: Sun Jan 04, 2015 8:15 am

Re: about Call function from standard DLL

Bogdan wrote:Hi,

By standard DLL we refer to DLL files built for Win32 applications, which are not aware of the Windows Installer API.

For accessing the API, thus being able to call MsiSetProperty and MsiGetProperty methods you need to build a native Windows Installer DLL. The linked article has an example and a sample available for download.

Regards,
Bogdan
Thanks for your reply!

I know if I add a custom action that Calling function from attached native DLL, it will work fine.

But I use vs2010 to build my DLL which need "msvcr100.dll".
If I run my installer using this DLL in a machine which not have "msvcr100.dll" in SystemFolder, my DLL will not work.

I don't want to add a prerequistites about Visual C++ Redistributable for vs2010,because I only need "msvcr100.dll".
How can I do to make my DLL work fine?
codesynergy
Posts: 100
Joined: Fri Nov 14, 2014 10:29 pm

Re: about Call function from standard DLL

I don't want to add a prerequistites about Visual C++ Redistributable for vs2010,because I only need "msvcr100.dll".
How can I do to make my DLL work fine?
You can use merge modules for this. On the machine you built the dll with, search C:\Program Files (x86)\Common Files for *.msm. It sounds like you need: Microsoft_VC100_CRT_x86.msm/Microsoft_VC100_CRT_x64.msm
You can add these to your project (in the "Merge Modules" view).
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: about Call function from standard DLL

You either need to add the merge module or the prerequisite. There is no other way around it.

The merge module is my recommendation also, its much simpler to configure and does not
change the installation UX at all, i.e. the users will not be bothered with a separate installation of the prerequisite.

Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
afreesoul
Posts: 10
Joined: Sun Jan 04, 2015 8:15 am

Re: about Call function from standard DLL

Thanks for all replys.

I have found If I build my DLL in DEBUG mode instead of RELEASE mode,My DLL will not depend on msvcr100.dll.

Maybe it is more simple.

Return to “Building Installers”