This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Referenced DLL Missing in Managed Custom Action
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 06, 2009
04:11 PM
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
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
(11) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 09, 2009
02:57 PM
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.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 09, 2009
03:12 PM
The file isn't on disk yet. I'm trying to run an action which loads the previous install and data storage location from our database, so that I can show those to the user as a default location during installation. (This is for the case where they have uninstalled our software, and want to reinstall (we give them the option of saving all their settings on uninstall)).
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?
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?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 09, 2009
03:56 PM
Yeah, the ISClrWrap table doesn't support unmanaged dependencies. I forgot the support files option; that would automatically extract a file into [SUPPORTDIR]. However adding files to the Binary table should be as easy as going to the direct editor, adding a row, and browsing to your file; extracting it would be the hard part. Either route, once it's extracted to a known location, I'd make your entry function change the directory before calling into the intermediate assembly.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 09, 2009
04:34 PM
I'd look into using DTF for managed custom actions. DTF will automatically include non-GAC'd assemblies that you add as references and any other non-managed resource provided that you add it to your project as build action content.
http://blogs.msdn.com/jasongin/archive/2008/05/23/custom-action-project-templates.aspx
http://blogs.msdn.com/jasongin/archive/2008/05/23/custom-action-project-templates.aspx
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 10, 2009
09:22 AM
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.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 17, 2010
11:41 AM
I have similar problem as CS1234 has mentioned in this post. However in my case, the custom action is run after starting the services. So that means at that time, files are already installed on the disk.
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
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.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 17, 2010
11:45 AM
CS1234,
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,
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.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 17, 2010
11:54 AM
If the files are already on disk, you probably just need something like the following at the start of your custom action to change the current directory.
System.Environment.CurrentDirectory = "
System.Environment.CurrentDirectory = "
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 17, 2010
11:59 AM
When you say at the start of Custom Action, does that mean in the C# code where the actual code is written or in InstallShield itself?
And by the way how does Support Files work?
And by the way how does Support Files work?
cs1234 wrote:
If the files are already on disk, you probably just need something like the following at the start of your custom action to change the current directory.
System.Environment.CurrentDirectory = "
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 17, 2010
12:19 PM
I meant to add a line of code like that to the beginning of your c# code.
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.
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.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 20, 2010
12:27 PM
Thanks CS1234. I was able to get away with using just the managed dlls and hence ISClrWrap table worked for me.
![](/skins/images/CC38E504FC9E1309DC48ACFEB4925670/responsive_peak/images/icon_anonymous_message.png)