Bridge plug-in runtime error.

Interested in developing new plug-ins? Got one to share? Post here!
FrancescoT
Site Admin
Posts: 4860
Joined: Sun Aug 22, 2010 4:28 am

Re: Bridge plug-in runtime error.

Postby FrancescoT » Fri Sep 21, 2012 4:51 am

Dear Bokkie,

Probably I missed your question,

Are you using a message box with IA script to report some variables, and if doing this after your plugin call, seems that some IA variables becomes altered?

I'm correct?

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 » Fri Sep 21, 2012 6:30 am

Hello Francesco,

That was the problem but it's okay now. If you look at my previous reply you'll see I edited the thread to show what I think my problem was and the solution. It seems to be working now. I don't have much time to look at things at the moment. Right now, all seems okay and I'm making very good progress.
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 » Fri Sep 21, 2012 7:38 am

Dear bokkie,

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


Exactly. That was what i have tried yesterday, with success. It is NOT GOOD to return only the variables you want to return. I am modifying mines with a String.Replace in my plugin, like

Code: Select all

variables = variables.Replace("EESTASKS,-1", "EESTASKS"+eestasks.ToString());

This is working great fine. And, the ... " is not a valid integer value error is fixed with this, too.

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

Re: Bridge plug-in runtime error.

Postby bokkie » Fri Sep 21, 2012 10:01 am

Thanks for confirming it. I feel that I too have now esacaped from the Plugin Prison having cut a hole in the fence and then smacked the guard on patrol across the head with a bowl of soggy porridge. Ah, life on the run isn't so bad. :D

When I get back from my vakansie I will investigate the progress bar and the callbacks.

I'll also have some more questions about the parameters, I'm sure!
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP

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

Re: Bridge plug-in runtime error.

Postby FrancescoT » Fri Sep 21, 2012 11:44 am

Dear Guys,

My sample is available with the following forum topic.
http://www.installaware.com/forum/viewtopic.php?f=3&t=8868&p=32800#p32800

It is a starting point and I hope to be able to add extra functionality in future.

Hope you enjoy it ... but seems that actually you are able to do much better than me.

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

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

Re: Bridge plug-in runtime error.

Postby christ23 » Fri Sep 21, 2012 12:11 pm

Bokkie,

Nice, now we both are free off the plugin prison :). Have a nice stay in Amsterdam, great fine! Rock on!

When you are back, we will continue discussing the plugins. I will have a look at Francesco's examples the next days and will report you my opinion of the examples.

Francesco, nice to hear from you. Maybe we all together have solved the problems ourselves in the last days - but i am shure your examples will clarify much more. Thank you :)

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

Re: Bridge plug-in runtime error.

Postby bokkie » Fri Sep 21, 2012 1:47 pm

FrancescoT wrote:Dear Guys,

My sample is available with the following forum topic.
http://www.installaware.com/forum/viewtopic.php?f=3&t=8868&p=32800#p32800

It is a starting point and I hope to be able to add extra functionality in future.

Hope you enjoy it ... but seems that actually you are able to do much better than me.

Regards


Francesco, thank you for driving the bridge changes for us behind the curtains. The sum of all our knowledge will contribute to a much better understanding. :)
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP

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

Re: Bridge plug-in runtime error.

Postby bokkie » Fri Sep 28, 2012 11:28 am

Off topic: Amsterdam was incredible. Five days was way too short. My wife's friend who lives there did everything possible to take us around and make it a superb stay. Unfortunately, she took us to the Apple store in Leidseplein which is apparently the biggest Apple store in Europe. She was given a demo of the new iPad and my wife fell in love with it. Tomorrow, we go to the local Apple shop in Bluewater Mall in Kent, and we will buy her an iPad. I can't complain as she let me buy a 27" iMac for myself. Who knows, perhaps she will buy me an iPad as well? :D

Anyway, I will continue doing some work on the plugin this weekend as I want to see it change the progress bar as well as introduce a Windows form. So much to do, so little time. :)
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP

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

Re: Bridge plug-in runtime error.

Postby bokkie » Sat Sep 29, 2012 2:03 am

christ23,

Cast your mind back to the DemoLib project's source and the RunTimeExecute method. It has an "if" statement that references the callback parameter. You mentioned earlier that you got the callback to provide data to a progressbar? Could you briefly explain to me how you used it? I'm familiar with IA's progressbar but I can't quite see how or what you need to do to make the callback work.
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 Oct 01, 2012 1:35 am

bokkie,

this is how i am doing it in my RUNTIME :

Code: Select all

[ComVisible(true), GuidAttribute("AD7144BF-3730-46F5-A5B6-DDA760575C61")]
    public delegate bool RunTimeCallback(Int32 smartPosition, string text);

[ComVisible(true), GuidAttribute("9C7B484A-EFE1-45B2-ADE6-042601741914")]
    public class pluginclass
    {
        string _newValue = "";

        public int RunTimeExecute(Int32 window, string variables, string state, Int32 callback, ref Int32 returnVal, ref string newval, bool firstiteration)
        {
                       if (firstiteration)
            {
                // do something in the first iteration
                MessageBox.Show("We are inside ");
             
                if (callback != 0)
                {
                    IntPtr ptr = new IntPtr(callback);
                    RunTimeCallback callbackMethod = (RunTimeCallback)Marshal.GetDelegateForFunctionPointer(ptr, typeof(
                      RunTimeCallback));

                    callbackMethod(0, "Initialize sql ...");
                    Thread.Sleep(1000);
                    callbackMethod(30, "Initialize sql ... getting credentials ... ");

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

Re: Bridge plug-in runtime error.

Postby bokkie » Mon Oct 01, 2012 3:59 am

Your callback sends data messages back to IA during installation? If so, that's the part I can't work out. For example, did you create your own dialog and add controls to it and then you did something or used something that allowed the callback to update something on the dialog.

In other words, does the callback only provide information to something that's known only to IA during the installation and not something of your creation?

I'm just puzzled by what the callback is actually communicating with.
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 Oct 01, 2012 6:11 am

bokkie,

yes, the callback send data messages back. The integer value is meant to be the percentage (0-100), and the string the text displayed beneath the progress bar.
The callback is communicating with the IA-standard-dialog "Progress".

So, in the msi-code, before calling your plugin, call the "display dialog : Progress" command (notice : The dialog has to be non-modal! Otherwise your script will stop at this point as it is waiting the dialog to be closed before continuing).

Allright ?

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

Re: Bridge plug-in runtime error.

Postby bokkie » Mon Oct 01, 2012 6:53 am

Aha! So that's what you do. I remember you mentioned something about the non-modal dialog a while back. I'll have a go later this afternoon.
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP

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

Re: Bridge plug-in runtime error.

Postby bokkie » Mon Oct 01, 2012 10:22 am

christ23,

Good news. I did manage to get the text and percentage into a non-modal progress dialog so that's working okay. Out of interest, did you suspend further installation activity until you'd completed your callback progress? If you did, did you achieve it by passing a completion status using a variable and returning it with all the others back to IA?

Does it have to be the progress dialog you must use? I mean, could you copy the dialog to another filename? For example, if I copy it to say MyProgress.dfm and then edit it with the dialog editor to make it look the way I want, would the callback be able to talk to my edited dialog and not the standard progress dialog?

It doesn't bother me if you can;t but I'd like to explore it all in more detail.
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP

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

Re: Bridge plug-in runtime error.

Postby bokkie » Tue Oct 02, 2012 12:22 am

I made a local copy of the progress dialog and changed it a little. It also responded correctly to the callbacks which proves they're not tied in to a specific form. I suspect that the important thing is that any dialog could be used as long as it's set to non-modal. In the MSIcode window my statement (when non-modal) is displayed as Display Dialog: MyProgress, use as progress dialog (non-modal) which seems to endorse the idea I have how it works.

Another thing I want to explore is how to use the dialog only during installations and force it to exit when doing an uninstallation. The assembly gets all the variables in one long string anyway so perhaps the uninstallation indication is in there as well. If so, I should be able to skip the callback code if that uninstallation flag is true for example.
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP


Return to “Plug-In Development”

Who is online

Users browsing this forum: No registered users and 1 guest