
caroline.simpson1.5524892785657134E12 asked a question.
Referenced DLL Missing in Managed Custom Action
I have a managed custom action (stored in binary table), which has another managed dll as a reference. I added this dll as a dependency in the ISClrWrap table, which worked fine. If, however, I call functions in the referenced dll, which use dll import to call functions in an unmanged dll, I get an error that it cannot find the unmanaged dll.
The custom action is being run before the files are being installed to disk.
Any suggestions on how to deal with this? Is it possible to use these functions?
Thanks,
Caroline
How would I add the dll to the binary table? (forgive me if this is a silly question, I'm still new to this.) I tried adding the unmanaged dll as a dependency in the ISClrWrap table, but that didn't seem to solve the problem.
Is there some location that I need to set the current directory to if I include the dll in the binary table before the functions from the unmanaged code is called?
http://blogs.msdn.com/jasongin/archive/2008/05/23/custom-action-project-templates.aspx
However I am not able to use ISClrWrap table as my managed code uses another managed dll that in turn uses unmanaged dll.
I didn't queit get what you mean by changing the current directory. Can you please explain how I would be able to achieve this. And is Support File option can be used in this case? If so, how can I use that?
Kindly suggest some solution
" MichaelU wrote:
If the unmanaged file is on disk somewhere, you just need to ensure it can be found. This may be easiest to do by changing the current directory. If it's not available on the disk yet, you'll have to figure out how to get it somewhere it can be found. One approach would be to reschedule your action; another would be to keep a copy in the Binary table and to extract it yourself with MSI APIs. "
I am having same issue as you had earlier. It is just that in my case, I am calling this custom action after services started.
I had looked at Support Files option but couldn't quiet understand how to use it. Can you explain a bit more so that I can follow the same.
Thanks,
" cs1234 wrote:
Thanks for the help. I went with the Support Files way, and that worked like a charm. I will look into DTF in the future maybe when time permits. "
For support files you add the files to the Language Independant section of the support files page. (I don't have a copy of Installshield available right at the moment, so the exact names may not be right).
Then when your installer runs these files get extracted to a temporary location. You can get the temporary location from the SUPPORTDIR property.
Hope that helps a bit, but if your files are already on disk, you probably shouldn't need to use the support files, you should just set your custom action to run from an installed file (there is an option when you go through the custom action wizard to pick the location of the action). and then set the current directory to the location of your files at the beginning of custom action. I believe you still need to set the Depenecy values in the IsClrWrpr table for any managed dependencies.