[wpkg-users] Is 1.8.20080.42104 < 2.0.0.14 ? true

Rainer Meier r.meier at wpkg.org
Wed May 14 16:19:52 CEST 2008


Hi Joe,

Joe wrote:
> I'm checking Firefox with the following rule:
> 
> <check type="file" condition="versionsmallerthan" path="%PROGRAMFILES%\Mozilla Firefox\firefox.exe" value="2.0.0.14"/>
> 
> WPKG shows this in debug mode:
> 
> Checking file version 1.8.20080.42104 is versionssmallerthan
> (than) 2.0.0.14 - got result -1

Check returns "left value smaller than right value)


> Checking version of "c:\program files\mozilla firefox\firefox.exe'
> : Is 1.8.20080.42104 < 2.0.0.14 ? true

Up to here it seems to be correct. 1.8.... is smaller than 2.0....


> Package 'Mozilla Firefox' (firefox): Already installed. Skipping.

Correct too as you check that firefox.exe file version is smaller than 
2.0.0.14.


> Looking in the file properties, Firefox.exe has a "file version"
> of 1.8.20080.42104 and a "program version" of 2.0.0.14.  WPKG
> apparently reads the "file version".  WPKG is somehow figuring
> out that ff is already installed but with the version discrepancy
> I'm not sure how it does.  Can anyone lend any insight?

So WPKG is right. You put a check onf "file version" you got a 
comparison to "file version".

But I know what your problem seems to be - you think WPKG should 
probably read "program version". But this is wrong. Program version is 
much less reliable. For lots of programs (I quickly checked some here) 
the program version is not filled in at all. For others the program 
version field is simply in-sync with the file version of the main 
binary. For some others program version is indicating the "logical 
program version" like "<major>.<minor>". This is not the intended usage. 
The "file" checks are there to check the file revision in a reliable 
way. We know that Firefox has some well-known issues for automatic 
deployment (Uninstall entry contains version number, file versions do 
not correspond to product version, upgrade issues when FF is running...).

You might also try to check the uninstall version for equality 
(supported in WPKG 1.1 pre-release). Unfortunately there is another 
"glitch" with Firefox. The uninstall version string shows something like 
"2.0.0.14 (en-US)" which makes it hard to compare it numerically.

Also I see some problems with your comparison - your check checks for 
file version "smaller than" which means that every (old) version of 
Firefox will be recognized as "installed properly". I would suggest 
changing this to a check as follows (if you would really like to check 
the binary file version:

<check type="file" condition="versiongreatherorequal" 
path="%PROGRAMFILES%\Mozilla Firefox\firefox.exe" value="1.8.20080.42104"/>

This would allow Firefox 2.0.0.14 and newer versions to be recognized as 
correct - but would force older versions to upgrade.

br,
Rainer



More information about the wpkg-users mailing list