cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
z_efrati
Level 4

Custom Action #1 returned 3

I've developed in C++ a DLL that has one exported function.
I've also tested it using a C++ client. It worked.

The prototype of the function is as follows:

#ifdef __cplusplus
extern "C" {
#endif
__declspec(dllexport) unsigned int __stdcall MyFunc(unsigned long hInstall);
#ifdef __cplusplus
}
#endif


I also added EXPORT tag to the linker ( /EXPORT:"MyFunc" ).

I tried to run it during installation (CustomAction #1), but it failed with error 3 (I think that Windows Installer called ::LoadLibrary(), and that call returned error 3 (The system cannot find the path specified.) ).

How can that be?
Labels (1)
0 Kudos
(3) Replies
RobertDickau
Flexera Alumni

What are the action settings? Does performing MSI validation post-build tell you anything? (For example, a DLL action of type "installed with the product" won't work if called before InstallFiles in deferred mode.) If you run, say, Dependency Walker on the DLL, is your function exported?
0 Kudos
z_efrati
Level 4

This DLL is stored in Binary Table, not installed with the product.
Validation didn't complain about this file.
0 Kudos
z_efrati
Level 4

I got it!

The dll depends on another dll - when I MANUALLY put the second dll in C:\Windows\System32, the installation works.

Of cource I need a better solusion than putting the dll on the machine before the installation. I'll continue from here.

Thanks.
0 Kudos