Native Custom action dll fails to build on x64

when you changed the build environment from Win32 to x64 and tried to build the setup project Its giving Error

the Visual studio 2005 always complained the error message "Entry point ‘xxxxxx’ not found in module ‘xxxxxx’ for custom action ‘Primary Output from xxxx’ " and stopped the building.

-If you are using VS 2008. It will build the Application with couple of warning. But this application will fail during install again

 

Cause

This is a Limitation of Microsoft Visual studio 2005 - It cannot find correct entry point when You build Native Custom action dll.

It gives Error during Build

Limitation of VS 2008 - It passes the Build but still cannot find the entry point correctly. so custom action won’t be successful

 

Resolution

First you should use an MSI editor (such as Orca.exe) to look at your built MSI - you'll see a series of tables, like a database.

 

The "CustomAction" table contains all the custom actions in your MSI (some of these are built-in - not all rows here are your own custom actions). Look at the "Target" column - some rows will have a string here similar to this: "_FunctionName@4", where "FunctionName" is the name of the entrypoint of the DLL that this custom action will execute. This is case-sensitive, so don't forget to preserve case. You should update the "Target" column to be just the name of the entrypoint you expect, without the "_" or the "@4". So as an example, you would change "_Install@4" to "Install".

 

Once you have learned to alter the MSI the way you want it with Orca (and tested installing it), you can create a post build script which will modify your MSI using SQL statements, so that the custom actions will be re-prioritized for you automatically each time you build it

 

Contributor : Ravi Shankar