Jason LaBumbard wrote:
> I want to check to make sure that my xpi is installed on mozilla 1.0 and
> a windows system.  Is this the correct way to do it?
> 
> First check windows...

I'd check the buildID first -- if you know it's 1.0 then you don't have to
bother with whether platform exists. Or do check for 'platform' but don't
bother with anything else if it doesn't exist since it must be an old version.

If it's win you install and register some chrome before checking the buildID
and possibly having to back out the install. Get your basic error checking
out of the way at the beginning.

>         cancelInstall(err);

I don't see err getting set anywhere... if this is the only problem it'll
default to 0 which would be interpreted as a success. The install *will* get
cancelled (transactions since the last initInstall backed out) but anyone
listening to the result code (such as the dialog and install log) will get
confused.

You can call cancelInstall() without an arg, which returns a default code of
-227 (INSTALL_CANCELLED), or supply a literal numeric value without having
to assign to the err variable.

Also note that cancelInstall() does *not* abort or exit the script: it's
just a function that unwinds install actions. The normal javascript control
flow applies.

>       if(buildID != "20020530)

As noted in another post this line is the problem.

-Dan Veditz


Reply via email to