Type 1 CustomAction Load Failures

When testing a custom action, it is usally practical to have the CA write some information to the installer log, so that you can verify that the CA has been called properly. But what if the installer log does not show up your information but instead the installation aborts and the log only states that the custom action returned 3 (ERROR_INSTALL_FAILURE)?

There may be various reasons for this to happen, but the most common reason is probably that your DLL was unable to load because of unsatisfied dependencies. Note that for the CA to work on all machines, it may only have dependencies to ‘standard DLLs’ — those DLLs that are available on a fresh Windows install.

Odds are that if you created the DLL with Visual C++ 2005 using standard settings (i.e. compiling with /MD[d]), VC has introduced a dependency to msvcr80.dll. As msvcr80.dll is not a ‘standard Windows DLL’, this will result in a DLL loading failure. The solution in this case is mostly as easy as switching to /MT[d].

Advertisements

Categories




About me

Johannes Passing, M.Sc., living in Berlin, Germany.

Besides his consulting work, Johannes mainly focusses on Win32, COM, and NT kernel mode development, along with Java and .Net. He also is the author of cfix, a C/C++ unit testing framework for Win32 and NT kernel mode, Visual Assert, a Visual Studio Unit Testing-AddIn, and NTrace, a dynamic function boundary tracing toolkit for Windows NT/x86 kernel/user mode code.

Contact Johannes: jpassing (at) acm org

Johannes' GPG fingerprint is BBB1 1769 B82D CD07 D90A 57E8 9FE1 D441 F7A0 1BB1.

LinkedIn Profile
Xing Profile
Github Profile

%d bloggers like this: