views:

425

answers:

4

I have created setup project with Visual Studio. I also need some custom actions - created DLL with Visual c++ and it works just fine but i don't want to include visual c++ runtime files to my project. So is it possible to build this dll with some other c++ compiler?

I have tried to make make it with Dev-c++ but when compiling i get few hundred compilation errors from files msi.h and msiquery.h

+2  A: 

Probably the easiest solution is to link your DLLs against the static runtime lib.

MSalters
Thanks, that solved my problem.
Keios
A: 

In general custom action DLLs should only rely on DLLs that are already in the system before the installation. This means, for example, statically linking the CRT, as noted by MSalters, but also applies to any other dependency on 3rd party libraries.

Another option is to link with the OS CRT, as Koby Kahane explains here.

On Freund
A: 

But just for curiosity: could someone please also answer also to my question.

Can c++ custom action dlls be only made with Visual Studio?

Keios
Sure. Any compiler that can deal with <windows.h> will likely be able to deal with msi.h. Might be slightly tricky to get the compiler settings (such as C dialect, include paths) right.
MSalters
I'm pretty certain minGW can handle it.
On Freund
A: 

I have made a custom dll for my setup project. My dll is very simple, registering few services, not CLR or any 3rd party lib dependent. Have statically linked with msi.lib only.

I have removed the .net and windows installer prerequisite requirements from the setup project. My setup fails on macines not having .net framework..?

As I have not having any .net dependent code, what should be the solution to this. I don;t want user to download framework first for installation.

Regards Amit