Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Custom Action DLLs

98 views
Skip to first unread message

dhmot

unread,
Oct 21, 2009, 1:48:01 PM10/21/09
to
I've been hitting my head against the wall for a while on this problem and
can't seem to get anywhere.

I have custom actions to perform on install and uninstall. The custom
actions are within a DLL, and that DLL is installed as part of the MSI. When
I make the project, I get the following error:

WARNING: Entry point 'Install' not found in module
'c:\cygwin\home\qa1402\restartMgr\apps\Win32\Release\InstallDriver.dll' for
custom action 'Primary Output from InstallDriver (Active)'.

This occurs for both x86 & x64. The DLL seems fine. If I use dependency
walker, both "Install" and "Uninstall" entry points are present. I created a
small executable that loads and runs the DLL, and it works fine. I've
created a .def file. I've played with various permuations of
EXPORTDLL/__stdcall/cdecl.

Attempting to insatll the MSI always returns a failure. Turning on full
debug of msiexec provides minimal information:

----------------------------------------------
MSI (s) (58:8C) [12:10:03:431]: Creating MSIHANDLE (35) of type 790536 for
thread 396
MSI (s) (58:6C) [12:10:03:431]: Invoking remote custom action. DLL:
C:\Program Files\Motorola\WTM1100\InstallDriver.dll, Entrypoint: Install
MSI (s) (58:5C) [12:10:03:431]: Generating random cookie.
MSI (s) (58:5C) [12:10:03:478]: Created Custom Action Server with PID 3872
(0xF20).
MSI (s) (58:DC) [12:10:03:603]: Running as a service.
MSI (s) (58:DC) [12:10:03:618]: Hello, I'm your 32bit Elevated custom action
server.
MSI (s) (58:6C) [12:10:03:618]: Closing MSIHANDLE (35) of type 790536 for
thread 396
----------------------------------------------

I've tried manually editing the MSI with Orca to change _Install@4 to
Install and attempting to install, with the same above result.

I give up. What's the magic I have to do with Visual Studio to get it to
use this DLL? Is there some limitations on what other libraries/DLLs my DLL
may use? Is this failing because I don't use standard header files (stdfx.h
or whatever it is)?

Thanks,
Michael

dhmot

unread,
Oct 21, 2009, 3:18:02 PM10/21/09
to
I apologize for not giving a few more details - I posted to near lunch time :).

This is Visual Studio 2008, 9.0.21022.8 RTM, .NET Framework 3.5.
The custom action is the Primary Output from a project. Only the EntryPoint
has been set in the Properties window, to a value of "Install".
The declaration of the function is as follows:

#ifdef __cplusplus
extern "C" {
#endif
UINT __stdcall Install(MSIHANDLE hInstall)
{...}
#ifdef __cplusplus
}
#endif

The prototype is as follows:

#ifdef __cplusplus
extern "C" {
#endif
EXPORTDLL UINT __stdcall Install(MSIHANDLE hInstall);
#ifdef __cplusplus
}
#endif

Hopefully this helps.

Thanks,
Michael

dhmot

unread,
Oct 22, 2009, 7:40:01 PM10/22/09
to
OK, I figured out "what" was the problem, but I'm not sure about "why".

My InstallDriver.dll is dependent upon another DLL within the same package.
If I remove this dependency and comment out the function call that resides in
the other DLL, then Visual Studio recognizes the entry point. This other DLL
is packaged along with InstallDriver.dll. I use other functions present in
system DLLs (e.g. newdev.dll), but these do not cause a problem.

I don't recall seeing this as a restriction. Did I miss something in the
documentation?

0 new messages