Thanks for bringing this up, I just discovered a semi-obscure bug and filed
http://bugzilla.mozilla.org/show_bug.cgi?id=64835.  If your install script
at any point calls setPackageVersion() we store incorrect information into
the version registry which confuses compareVersion() later.  Good catch!

If you script does NOT call setPackageVersion then please let me know ASAP
because I'll have to look for an additional bug to explain your symptoms.

To work around this problem stop calling setPackageVersion in your script,
and if you have ever distributed your install anywhere consider changing the
registry name you use ("plugins/abc") to something slightly different --
there is really no practical way to fix an existing registry node at this
point. On your own development system you could simple delete the mozver.dat
and start over. You will lose all install version information, but you'll
get it back next time you install Mozilla.

-Dan Veditz


Danny Aijala wrote:
> 
> Has anyone got the InstallTrigger.compareVersion() function to actually
> work? No matter what, this call seems to return a -4 as the result.  On the
> other hand, InstallTrigger.getVersion() seems to work just fine.  I can get
> around it by writing my own compareVersion by using getVersion, but I keep
> thinking that I must be doing something wrong.
> 
> In my install.js I use something like this:
> initInstall("npell", "plugins/abc", "1.0.0.1");
> 
> and for my InstallTrigger.compareVersion() I use something loike this:
> 
> InstallTrigger.compareVersion("plugins/abc",  "1.0.0.1")
> 
> The result is always -4, even though the numbers are the same.
> Any thoughts?
> 
> Danny Aijala

Reply via email to