Page 1 of 9

Bridge plug-in runtime error.

Posted: Sun Aug 26, 2012 10:22 am
by bokkie

I've spent a bit of time trying to get the Bridge plug-in to work. I went back to first principles and created a plug-in using the IA NX project creation. I compiled the two .Net projects, etc. If I drag the plug-in into a new setup project it displays the test message successfully. When I build the setup I get another message box displayed which again, looks to be okay.

However, when I run the setup I get this error message "Unable to load plug-in library. Please rebuild your project and make sure all required plug-ins are installed."

I think I've done everything the right way but maybe I've missed an important step but I can't be sure. Has anyone used the plug-in created by IA to see if it works during all phases in the IDE, build, and when you run a setup that tries to use it?

Re: Bridge plug-in runtime error.

Posted: Mon Aug 27, 2012 12:06 pm
by FrancescoT
Dear Bokkie,

let me do a test ... Im not an expert of c# (I'm basically a C++ developer).


Re: Bridge plug-in runtime error.

Posted: Mon Aug 27, 2012 1:04 pm
by bokkie
Francesco, thanks for your help with it. The plugin template that comes with NX has two dotnet solutions and both compile clean. You don't need to change the source code. Where I think I might have a problem is the use of the two bridge dlls and ini files that describe the namespace and classes used by the plugin. There is a dll and an ini file for each of the IDE and runtime usage. They refer to the two dot net dlls that the template solutions create.

I'm not sure if the names of the files are important?

Do the six files have to be copied to another folder somewhere that IA looks for them?

I looked at the registry entries for some of the other plugins and I can't see anything I might be doing wrong. If I can work out how to get a very simple one working I'll write a tutorial document which might be of use to others like me.

Another thing you or someone on the dev team could advise is if the C++ plugin will compile and work without changes and if it will compile successfully using VS C++? I don't have Delphi and I don't have any C++ older than VS 2008 installed. I do have a free download of C++ Builder but that version is so old that it might not work anymore! :)

PS: I just noticed that I have passed the 500 milestone. :D

Re: Bridge plug-in runtime error.

Posted: Mon Aug 27, 2012 1:52 pm
by christ23
sorry when i am crashing into this discussion.

Bokkie, what sort of "Bridge" do you mean ? Have i missed something by staying on IA2012 and not using NX ?
Background : I am trying to develop a plugin-skeletton for our company, using C# and the Delphi-Bridge from MaxLogic, but i am running into trouble every step i solved ;).

Can you shortly inform me about your technique ? This would be great nice. Thanks!

Re: Bridge plug-in runtime error.

Posted: Mon Aug 27, 2012 1:59 pm
by christ23

sorry bokkie just now i have been reading your post to my post, after answering. Yes, i am resident;), quite true.
In serious : We only want (can?!) use C#, C++ is becoming deprecated in the part of the company i am working for. So as i drive the installers for my collegues, i thin we should concentrate on our knowledge in C#. That is why i am resident :).

Ok, some suggestions, but i think you checked them before :

- the REGISTRY. Not only the being here, but the values(!). (Check them with one of my posts)
- in the debug mode, check the variable "SUPPORTDIR". In this folder, check if your dlls are present

I will have a look at my notes tomorrow and will write you the "stones in the highway" i have written down for myself.

Re: Bridge plug-in runtime error.

Posted: Mon Aug 27, 2012 2:47 pm
by bokkie
Thanks. I will look into your suggestions tomorrow when I get to work. I didn't know about SUPPORTDIR's part it plays but I will look into it as well. I don't know if you have NX but it seems that much of what MaxLogic did is now part of IA in NX only.

I'm sure that between us you will solve it for me. :D

Re: Bridge plug-in runtime error.

Posted: Mon Aug 27, 2012 8:25 pm
by glenharvy
I purchased NX and thought I was getting a .Net Bridge 'out-of-the-box' so to speak as I have no desire to learn C++ and thought that the .Net DLL bridge would perform and act in much the same way as the 'Call DLL' function is setup and works. It seems I am mistaken. :(

I have created the .Net Bridge by using the IA VS project creator. I then read all the documentation I could find and became very confused very fast :oops:

With regards to getting the supplied code to work, I persevered and took the following steps:

1. Amended my Registry entries to include the newly created 'Plug-IN'. In my case, under the wow6432 node.
2. Copied the 4 files (the dlls and ini files) from the compiled projects created for me by IA to my IA projects mpr directory.
3. Re-opened IA and dragged the new .Net Bridge Plug-In to my MSICode.
4. Compiled using debug and all worked fine. Message box popped up etc.

I now have, to me, a completely useless dll that appears to run fine. I'm pretty sure I can add methods to the dll's to do what I want however how do I call those specific methods and get their return values into IA variables.

I was hoping that I could call the newly created dll using the 'Call DLL' Plugin, I configured that but that didn't work.

Is there an easy solution to my problem - I'm sure I have missed something that must be obvious to everyone else :?

I was hoping that the '.Net DLL Plug-In' would have the same IA interface as the 'Call DLL Plugin' in that I could call specific methods within my shiny new .Net Bridge DLL and save the results in appropriate variables but I have no idea how to implement that functionality and there doesn't seem to be any documentation anywhere to tell me how.

I'm a bit disappointed at the moment and would appreciate someone writing a meaningful explanation of what to do regards to interfacing with the dll. A very simple example along the lines of the 'Call Dll' plugin, would be great.

Re: Bridge plug-in runtime error.

Posted: Tue Aug 28, 2012 2:38 am
by FrancescoT
Dear Bokkie,

with C++ you just need to compile the provided project and works ( ... with C++ is very very easy).
of course, just doing this the plugin does nothing.

Last but not least, to wok the plugin requires some registry keys of the target system properly filled.

Code: Select all

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MimarSinan\InstallAware\2.0\Plug-Ins\[PLUGIN NAME]

(Default) = {Full Path to Plug-In Design-Time/Compile-Time DLL}
Action = {Plug-In Name}
Execute = {File Name (without path) to Plug-In Run-Time DLL}
Script = {Plug-In Script Display}

For what I seen the difference with c# is that you have to specify "the NET Bridge dlls" not the plugin assemblies with the above registry.

I hope to run a test with c# this afternoon (... even if I prefer C++ :wink: )



Re: Bridge plug-in runtime error.

Posted: Tue Aug 28, 2012 3:03 am
by glenharvy
Dear FrancescoT,

This is what I've found so far ...

It makes no sense to reference the C# DLL's in the IA Registry settings because the c# compiled DLL's are what you create to do whatever you want them to do. They will obviously change their names to something meaningful to the individual IA project. I'm not to sure why these registry settings are not created as part of the IA NX install process. I can only guess that as the plugin wasn't created by them and is not fully documented it would be better to treat it in the way they have.

Add references to the pre-compiled IA distributed DLL's to the registry. IA will then use those pre-compiled DLL's to call the c# DLL's that you have developed. This is achieved by specifying the c# dll you have developed via the ini files with the same name as the pre-compiled DLL's.

The supplied example c# dll's seem to work fine. How you create an IA GUI interface to set the method and variable to hold the methods result is what I'm unable to fathom.

Hope the above helps.

Re: Bridge plug-in runtime error.

Posted: Tue Aug 28, 2012 3:05 am
by christ23
Hi bokkie,

here an example of my registry part which is working :

Code: Select all

@="C:\\Documents and Settings\\***\\My Documents\\Doku\\Installer\\_InstallAware\\Plugins_dotNet\\_NEW2012\\IA_NetBridge_and_TestTool\\data\\[b]IDEPlug_NetBridge.dll[/b]"

Have a check at the bolded values. But note - i am using MaxLogics (Delphi-)Bridge. But i think, when it is not his one, the technique is quite the same.

Re: Bridge plug-in runtime error.

Posted: Tue Aug 28, 2012 4:19 am
by FrancescoT

Dear christ23,

Please note! do not use "C:\Documents and Settings\xxxxxx ..." to store the dlls ... this could cause problems.
As for any application, use a Plugin subfolder under the Program Files directory.

C:\Program Files (x86)\My comapany\Plugin Name


Re: Bridge plug-in runtime error.

Posted: Tue Aug 28, 2012 5:28 am
by bokkie

I'm also confused what I need to do. Let me explain.

1. I have the plugin in my registry in the same node as all other available plugins added by IA's installer.
2. I created a new bridge project using the template. I have not changed any code in the C# solutions.
3. I made sure the bridge ini files referred to the namespaces and class. They do.
4. I created a new installer (basic) project. I can see my plugin in the MSIcode window on the right hand side.
5. I select my plugin and drag it onto the MSIcode window. It displays the message "Test" when I release the mouse button.
6. On the Project tab, I build "CD or DVD".
7. During the build I get another message from the C# code saying "InstallAware: State".
8. I then run the setup. As soon as it gets to my plugin I get the error message about the plugin. When I cancel the error message the installation carries on as normal.

I've tried copying the six files (2 x ini, 2 x bridge dlls, 2 x C# dlls) into various folder locations. No matter where I copy them I always get the installation time error messages.

This is what makes me think I have done something wrong because I can't get mine to work at runtime. I can't see anything obviously wrong.

Christ23 and Glenn: it seems to me yours are able to run during installation time? If so, what would explain the difference between yours and mine?

Francesco: You might have better luck than me!

Re: Bridge plug-in runtime error.

Posted: Tue Aug 28, 2012 5:51 am
by FrancescoT
Dear bokkie,

are all your plugin dlls copied during the build?

The full path to the folder where the plug-in must copy its build files to. At a minimum, the plug-in should copy its Run-Time DLL to this build location. The plug-in may also copy other files as needed (for instance, if the plug-in installs any files, it should also copy those files).

To test it, do an uncompressed build and check if all the required files are available under the build folder of the project.


Re: Bridge plug-in runtime error.

Posted: Tue Aug 28, 2012 7:06 am
by bokkie
1. See attached screenshot.

2. After the build, I took a look in the Release -> Uncompressed -> data -> OFFLINE folder. There is only one folder DesignTime_NetBridge.dll and it's empty.

This seems to suggest to me there is something missing?

Re: Bridge plug-in runtime error.

Posted: Tue Aug 28, 2012 7:32 am
by FrancescoT
Dear bokkie,

I suspect that this is your problem. Under the folder DesignTime_NetBridge.dll you should have all the plugin dlls files otherwise the setup will not be able to have acces to the plugin.

I haven't tried yet using C#, but I suspect that it it quite similar as in C++.

In C++during Project build time the IDE plugin DLL is called by the function "CompileTimeBuild". With this function the IDE plugin is responsable to perform all the required file copy operations. So the plugin must physically copy all the required runtime dlls by to the directory pointed by the "BuildPath" paramenter of the function.

Let me know.