PDA

View Full Version : Custom Action for Calling a function in a DLL does not work !!



preethi
02-16-2005, 07:51 AM
Hi,

I'm trying to create a Custom Action which calls a function in a DLL. The DLL is installed as part of the installation.
The custom action is created using the Custom Action Wizard.
The details of the custom action are as in the attachment. I have not changed any value in the Custom Action Table.
Also, the custom action has been added " After Install Files " in the Execute Sequence.
On running the setup, i get an error saying the DLL would not be run. If the Custom Action is moved in the sequence then it gives me an error saying, the DLL would not be found.
Please help me out with this !!

Thanks

Christopher Painter
02-16-2005, 08:06 AM
Several thoughts here....

First read

http://www.installsite.org/pages/en/isnews/200108/

and

http://helpnet.installshield.com/Robo/BIN/Robo.dll?tpc=/robo/projects/HelpLib/IHelpDLLFunctionStandard.htm

I noticed your using Commit execution. Do realize that if machine policy has rollback disabled the commit script will never get build or executed.

Also learn to walk before you run. Make sure you check out the Helpnet article and try calling MessageBox before anything more complicated.

Otherwise make sure the DLL that you are installing and calling is infact installed. Provided that the commit script gets executed after InstallFinalize I think you should be ok there. But this CA should probably either be defferred not committed and placed after copyfiles.

leandrobecker
08-30-2005, 04:15 PM
I don't know if the cause is the same because I'm using Developer 8, but let's go:

I have a dll installed into "program files\my app" that is a CA dll. The installer NEVER could call my CAs. After an deep investigation I've discovered the problem. My custom action depends of another dll of my product. The problem is: The working directory for msiexec.exe is system32, and it cannot load the CA dll because the another DLL is not in the system32 but in the product folder and because of that, the LoadLibrary fails!

To workaround this, I have another CA dll that is used only at installation that is a simple wrapper to the CA dll that is installed in my application folder. My temporary CA dll do the LoadLibrary and call my "CA".

Another workaround that I have done is to lauch process from my CA that depends of dlls installed into the product folder. I've change the PATH env variable to use in CreateProcess adding to PATH var the INSTALLDIR value.

Sorry by my english, is not my natural language ...

Good luck