Page 7 of 9

Re: Bridge plug-in runtime error.

Posted: Sun Sep 16, 2012 2:26 pm
by glenharvy
I downloaded when Francesco told us to and got 9.10.12 .

Should I wait a few more days for the SAMPLE. By then we could be at 9.20.12 :(

Re: Bridge plug-in runtime error.

Posted: Sun Sep 16, 2012 2:36 pm
by bokkie
Glenn, like you and christ23 I've been waiting a while myself. I don't mind being an early adopter because I won't miss what I haven't had! :D

I'm happy to run with as many versions as are needed to get it fully working. I feel a little more positive about it all but I suspect not getting my own variables into the plugin might well be another round of problems. At least now, it seems to work. I'd like to see Francesco's sample when and if he posts it. If he reads this before he does, Francesco, can you confirm if user defined variables can be passed into the plugin?

Re: Bridge plug-in runtime error.

Posted: Mon Sep 17, 2012 1:07 am
by christ23
Bokkie,

no - normally you can see the variables you have defined on your own. In my former projects, that did work. Maybe, try to set the variable in uppercase, like $MYVAR$ and not $myvar$. I have in mind, that lowercase variables can be something like "private" (but, maybe i am mixing it with compiler vars or something else, i am not shure). But give it a try.

So, download the version on the website which does have a different version to Friday's and try it.


Which website do you mean ? The IA download page ?

Re: Bridge plug-in runtime error.

Posted: Mon Sep 17, 2012 1:34 am
by bokkie
christ23 wrote:Which website do you mean ? The IA download page ?


Yes. The normal download page.

Re: Bridge plug-in runtime error.

Posted: Mon Sep 17, 2012 10:29 am
by FrancescoT
Dear Guys,

I have just completed the sample projects.
It has requested more additional time because I modified my original intentions on what the sample does.

I originally thought to release a dummy sample that did anything.
then I imagined your questions ... so I decided to give you a sample that gives you a good idea on how plugin works.
I mean with IA variables and plugin parameters.

Of course, due the fact that I released the sample when I had free time, my sample must be considered as starting point to work on.
I used very simple functions to handle variables and parameters and in a real application, it must be modified in order to work extensively.

Then last but not least, I'm a C++ developer and not a Net developer.

I just need to package all the things in an usable distribution form.

In meanwhile please update your InstallAware NX to ver. 14.1 because I used the Net Bridge runtimes distributed with this IA update.

if another disaster will not happens with my server, which kept me at work all weekend instead of going out and playing with my band, I suppose to be able to post the sample in a couple of days.

Regards.

Re: Bridge plug-in runtime error.

Posted: Mon Sep 17, 2012 1:42 pm
by bokkie
christ23 wrote:Bokkie,

no - normally you can see the variables you have defined on your own. In my former projects, that did work.


My bad. My variable was in the large message box all the time. I lost sight of it as it was hidden among all the others. :)

Re: Bridge plug-in runtime error.

Posted: Tue Sep 18, 2012 12:07 am
by christ23
Bokkie,

i expected that. Passing variables works ;)

Re: Bridge plug-in runtime error.

Posted: Wed Sep 19, 2012 11:44 am
by bokkie
I've got some questions to ask as I can't see the rationale behind something.

In the default plugin DemoLib VS solution, the RunTimeExecute method has a parameter called "first iteration". RunTimeExecute always seems to get called twice, the first time with it set true and a second call with it set false. The two iterations always get called as the message boxes in the method confirm that. What I'd like to know is why?

The first iteration sets the returnVal parameter to 0 and the return value of the method is the length of the IA variables passed in.

The second iteration sets the newval parameter to a null string and it returns 0 as method return value.

Q: Why are there two iterations? That is, why is RunTimeExecute called twice at all?

Q: What would you want to do different in the second that you can't do in the first?

Q: What would you want or need to do in the first that you couldn't do in the second?

Q: What is the purpose of the callback? I know what callbacks are, I just don't know what it's used for in IA's context when the first iteration is called. The callback has a parameter called "smart position". What's that for? Clearly, it's a smart position as the clue is in the name but what exactly is it positioning smartly? :)

Re: Bridge plug-in runtime error.

Posted: Wed Sep 19, 2012 1:15 pm
by christ23
Bokkie,

It is positioning the progressbar in the standard "progress dialog", which comes with IA. That is, if you show a dialog (remark: the dialog has to be non-modal!) before calling your plugin in the msi-code.

That is working, too ;), just try it.

WHY the runtime function is called twice, i do not know. But for me it was okay as i think it has to do with some IA internals. Because in the first iteration, you return the length of the variablestring thqt you want to pass back to IA. In the second iteration, you return the variablestring itself.

E.g.
Iter1 : return 8
Iter2 : return "myVar1,23" where 23 is some value you want to post back.

Edit: I will send you one of my projects tomorrow, but i have to delete every company stuff inside the projects before doing that.
But - exactly aftef this step, i get the ...... "is not a valid integer value. That is right, " is no int ;))

Re: Bridge plug-in runtime error.

Posted: Wed Sep 19, 2012 1:40 pm
by bokkie
Thanks. Some of that makes sense. I'll have to try it sometime but if I understand your reply correctly, do you have to return a comma-separated list of variables and values? If I wanted to return something like:

MYNAME,Peter,MYCATSNAME,Emmie

I'd return 29 in the first call and then return the above string in the second? Does that mean that IA will then break it down into two variables and assign the values appropriately? In other words does it have to a comma-separated string of variable/value pairs? If it's mandatory to do so, I wonder what would happen if you give something in return that isn't?

I'll try and schedule some time tomorrow to test it. The progress bar sounds good.

Re: Bridge plug-in runtime error.

Posted: Wed Sep 19, 2012 3:52 pm
by christ23
Bokkie,

Yes, you got it.


MYNAME,Peter,MYCATSNAME,Emmie
This will pass back two variables with Peter and Emmie as value.

Remark: If you want to pass back a value containing characters like " you have to mask it. (Escape-character)

Ah, and with the callback/progressbar, you can also pass a s string with the progress value. The last one is from 0-100.

Re: Bridge plug-in runtime error.

Posted: Thu Sep 20, 2012 7:33 am
by christ23
Bokkie, and all the others waiting,

i got it running !!! :-)

The plugin GETS variables from IA, has another DLL (Oracle.DataAccess.dll) included which is called correctly and SETS variables back to IA.

This is soo nice !!

I will post you my example this evening. Not earlier - because as i wrote in my last post, i have to delete every company stuff in my plugin due security reasons.
Please be a little patient ...

Re: Bridge plug-in runtime error.

Posted: Thu Sep 20, 2012 8:59 am
by bokkie
christ23 wrote:Bokkie, and all the others waiting,i got it running !!! :-)


Well done that man! We don't have an emoticon for a glass of beer but have one all the same.Wifey and I are off to Amsterdam for a week's vacation on Saturday so I won't have much chance to do anything until we get back but good to hear you've escaped from the Plugin Prison. :) :!: :!: :!: 8)

Re: Bridge plug-in runtime error.

Posted: Thu Sep 20, 2012 4:12 pm
by glenharvy
christ23 wrote:i got it running !!! :-)


Congratulations :D

Re: Bridge plug-in runtime error.

Posted: Fri Sep 21, 2012 1:50 am
by bokkie
I found something which might be a problem but I'll let somebody else confirm it for me.

I was able to return some variable values back to IA, as christ23 helped me with. I then displayed the values in a messagebox and the contents are correct. I used ctrl-enter to add some newlines to the messagebox. When I ran the installer, messagebox is displaying newlines as literally $NEWLINE$ and not the line spacing it should do. When I commented out my plugin, normal $NEWLINE$ behaviour returned.

Perhaps someone else can confirm it for me?

Edit: I think I found the reason. If I return the variables exactly as I got them from IA everything worked. I then returned just the two variables I was interested in changing and IA/bridge got a little upset with me as I described above. I then split the IA variables into a string array. I searched the array for my variables ABC and DEF and then changed the next element in the array to the new value. I then rejoined all the elements into one uber-string much like IA passed them in as. Back in IA, I still got the problem above. When I used values like Fred and 123.45 it worked. The problem was that when I introduced spaces into my new values IA/bridge didn't like them. I think my conclusion is this:

1. Always return back all the variables IA gives you. By all means change the ones you want but always give back the others and not just the ones you're interested in changing.
2. If you want to use spaces in your replacement values always double quote the value. Don't use single quotes as they don't work. You can use single quotes in the value without a problem make sure you double-quote the string. Even if you don't use spaces, it's probably a good habit to get into. That seems to have fixed the problem for me. christ23? Did you observe this in your tests.