I've got a problem with a Thunderbird add-on which works always fine in
Thunderbird 2. But in Thunderbird 3 (RC1) there are some problems. I hope
someone can help me with the following point:
The extension should start a windows application (exe) with some arguments,
first time. The application keeps itself in the memory. All following calls
of the application with arguments should call the still existing application
with new arguments and so on (keep itself in memory and get the new
arguments is managed by the application). But with Tunderbird 3 (RC1) there
is a problem with currently used behaviour in Thunderbird 2 (see code
below):
...
this.appToProcess =
Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
this.process =
Components.classes["@mozilla.org/process/util;1"].createInstance(Components.interfaces.nsIProcess);
...
// initialize objects for process calls
this.appToProcess.initWithPath(C:\\Temp\\test.exe); // only a simple
example.
this.process.init(this.appToProcess);
...
var executionParameters = new Array(1);
executionParameters[0] = "/mailclient:thunderbird /combitapp:cRM
/command:config"; // only a simple example.
// In Thunderbird 2 it works always fine!
// In Thunderbird 3 - up to the second call - the exception
NS_ERROR_ALREADY_INITIALIZED is always triggered (application 'test.exe' is
there in memory!)
this.process.run(false, executionParameters, executionParameters.length);
...
I'll be glad, if someone could help me. Thanks in advance.
something like this:
if ( this.process )
{ this.process = nil; }
this.process.init(....
PM-
PM-
"Pavol Mi��k" <pmi...@gmail.com> schrieb im Newsbeitrag
news:P6mdnbjHM42KconW...@mozilla.org...
But which OS do you run?
This question is because I have used that nsIProcess with an extension
on different platforms: WINxp and Linux no problem, but on OSX it
doesn't work for multiple calls -- similar error messages.
See also my discussion and bug about it:
mozilla.dev.extensions: OSX with "cmdline" options works different as on
other platforms
See also [Bug 528683 <http://bugzilla.mozilla.org/show_bug.cgi?id=528683>]
The answer was like "this is a special case, you need to change the
nsIProcess for OSX by yourself" .. sounds a bit rude and disappointing.
I thought the Mozilla calls should function equally -- "platform
independent".
The bug was canceled as "RESOLVED INVALID ".
Will test Pavol's approach later.
Thanks
G�nter
[01.12.2009 14:01] �Friedemann Kunze� wrote:
> Thank you for the extended infos.
> For simple tests I had changed the bahaviour to "reset" the process-object
> and it works fine!
>
> "Pavol Mi��k"<pmi...@gmail.com> schrieb im Newsbeitrag
> news:P6mdnbjHM42KconW...@mozilla.org...
Well,
I have just taken look at
http://mxr.mozilla.org/mozilla1.8.0/source/xpcom/threads/nsProcessCommon.cpp#84
and
http://mxr.mozilla.org/mozilla1.9.1/source/xpcom/threads/nsProcessCommon.cpp#104
and as you can see in gecko 1.9.1 there is additional check:
106 if (mExecutable)
107 return NS_ERROR_ALREADY_INITIALIZED;
Because of this I thing this has thrown an exception in javascript.
PM-
I think Pavol is rigth. Since I changed the behaviour in our code it works
fine in both Thunderbird versions.
"Pavol Mi��k" <pmi...@gmail.com> schrieb im Newsbeitrag
news:LZmdnbF_BtSCpIjW...@mozilla.org...
> gNeandr wrote:
>> Just to get it completely.
>> Also Pavol point to the Gecko version -- saying it's dependent of OS?
>>
>> But which OS do you run?
>>
>> This question is because I have used that nsIProcess with an extension on
>> different platforms: WINxp and Linux no problem, but on OSX it doesn't
>> work for multiple calls -- similar error messages.
>>
>> See also my discussion and bug about it:
>> mozilla.dev.extensions: OSX with "cmdline" options works different as on
>> other platforms
>> See also [Bug 528683
>> <http://bugzilla.mozilla.org/show_bug.cgi?id=528683>]
>>
>> The answer was like "this is a special case, you need to change the
>> nsIProcess for OSX by yourself" .. sounds a bit rude and disappointing. I
>> thought the Mozilla calls should function equally -- "platform
>> independent".
>> The bug was canceled as "RESOLVED INVALID ".
>>
>> Will test Pavol's approach later.
>> Thanks
>> G�nter