Bridge plug-in runtime error.

Interested in developing new plug-ins? Got one to share? Post here!
bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Bridge plug-in runtime error.

Postby bokkie » Sun Aug 26, 2012 10:22 am

Chaps,

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?
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP

FrancescoT
Site Admin
Posts: 4862
Joined: Sun Aug 22, 2010 4:28 am

Re: Bridge plug-in runtime error.

Postby FrancescoT » Mon Aug 27, 2012 12:06 pm

Dear Bokkie,

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

Regards
Francesco Toscano
InstallAware Software Support

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Re: Bridge plug-in runtime error.

Postby bokkie » Mon Aug 27, 2012 1:04 pm

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
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP

christ23
Posts: 82
Joined: Mon Jan 16, 2012 4:51 am

Re: Bridge plug-in runtime error.

Postby christ23 » Mon Aug 27, 2012 1:52 pm

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!

christ23
Posts: 82
Joined: Mon Jan 16, 2012 4:51 am

Re: Bridge plug-in runtime error.

Postby christ23 » Mon Aug 27, 2012 1:59 pm

Hehe,

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.

bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Re: Bridge plug-in runtime error.

Postby bokkie » Mon Aug 27, 2012 2:47 pm

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
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP

glenharvy
Posts: 150
Joined: Fri Sep 14, 2007 3:53 am

Re: Bridge plug-in runtime error.

Postby glenharvy » Mon Aug 27, 2012 8:25 pm

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.
Last edited by glenharvy on Tue Aug 28, 2012 2:39 am, edited 1 time in total.

FrancescoT
Site Admin
Posts: 4862
Joined: Sun Aug 22, 2010 4:28 am

Re: Bridge plug-in runtime error.

Postby FrancescoT » Tue Aug 28, 2012 2:38 am

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.
AS:

Code: Select all

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

Keys:
(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: )

Regards



Regards
Francesco Toscano
InstallAware Software Support

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

glenharvy
Posts: 150
Joined: Fri Sep 14, 2007 3:53 am

Re: Bridge plug-in runtime error.

Postby glenharvy » Tue Aug 28, 2012 3:03 am

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.

christ23
Posts: 82
Joined: Mon Jan 16, 2012 4:51 am

Re: Bridge plug-in runtime error.

Postby christ23 » Tue Aug 28, 2012 3:05 am

Hi bokkie,

here an example of my registry part which is working :

Code: Select all

[HKEY_LOCAL_MACHINE\SOFTWARE\MimarSinan\InstallAware\2.0\Plug-Ins\ORASQL23]
@="C:\\Documents and Settings\\***\\My Documents\\Doku\\Installer\\_InstallAware\\Plugins_dotNet\\_NEW2012\\IA_NetBridge_and_TestTool\\data\\[b]IDEPlug_NetBridge.dll[/b]"
"Action"="ORASQL23"
"Execute"="[b]EXEPlug_NetBridge.dll[/b]"
"Script"="ORASQL-RUN"


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.

FrancescoT
Site Admin
Posts: 4862
Joined: Sun Aug 22, 2010 4:28 am

Re: Bridge plug-in runtime error.

Postby FrancescoT » Tue Aug 28, 2012 4:19 am

PLEASE NOTE! THE TOPIC HAS BEEN MOVED TO "Plug-In Development" Forum.

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.

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

Regards
Francesco Toscano
InstallAware Software Support

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Re: Bridge plug-in runtime error.

Postby bokkie » Tue Aug 28, 2012 5:28 am

All,

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!
Attachments
Screenshot3.png
Screenshot3.png (26.78 KiB) Viewed 22875 times
Screenshot2.png
Screenshot2.png (94.54 KiB) Viewed 22875 times
Screenshot1.png
Screenshot1.png (81.76 KiB) Viewed 22875 times
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP

FrancescoT
Site Admin
Posts: 4862
Joined: Sun Aug 22, 2010 4:28 am

Re: Bridge plug-in runtime error.

Postby FrancescoT » Tue Aug 28, 2012 5:51 am

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.

Regards
Francesco Toscano
InstallAware Software Support

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Re: Bridge plug-in runtime error.

Postby bokkie » Tue Aug 28, 2012 7:06 am

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?
Attachments
Screenshot5.png
Screenshot5.png (125.6 KiB) Viewed 22871 times
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP

FrancescoT
Site Admin
Posts: 4862
Joined: Sun Aug 22, 2010 4:28 am

Re: Bridge plug-in runtime error.

Postby FrancescoT » Tue Aug 28, 2012 7:32 am

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.

Regards
Francesco Toscano
InstallAware Software Support

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE


Return to “Plug-In Development”

Who is online

Users browsing this forum: No registered users and 2 guests