[Project_owners] Testing whether XPI install script is runningonMozilla or Firebird...

Pete Collins pete at mozdev.org
Sun Feb 8 15:38:56 EST 2004


Roland Mainz wrote:
>>"Laeb (hotmail)" wrote:
>>
>>
>>>Is there a way (or better: has someone example code :) to
>>>test whether
>>>an XPInstall script is being run by Mozilla (Suite) or
>>>FireBird/Thunderbird ?
>>
>>Try this:
>>
>>if (!File.exists(getFolder(getFolder('Chrome'), 'browser.jar'))) {
>> alert('is not Mozilla Firebird');
>> cancelInstall(err);
>>}
> 
> 
> Nice... but I need to do the reverse - check whether the Mozilla Suite
> is running or not. Just testing for FireBird won't work for
> SunBird/Thunderbird/AnyOtherGREBasedBird ... ;-(

browser.jar means Firebird install.

comm.jar means a Mozilla install.

You could also look for the binary.

mozilla means it's a mozilla install

MozillaFirebird means it's a FB install.

XPInstall API is actually documented:

 
http://devedge.netscape.com/library/manuals/2001/xpinstall/1.0/Chap211.html#1012570


if (getFolder("Program") == "mozilla")
   alert("it's a mozilla install");

if (getFolder("Program") == "MozillaFirebird")
   alert("it's a FB install");



--pete


-- 
Pete Collins
www.mozdev.org
www.mozdevgroup.com



More information about the Project_owners mailing list