(imported topic written by EricWittersheim)
I’m trying to write a relevance clause to check to see if Firefox.app < “29.0.1”
The current version of Firefox installed is 29 and QNA on the mac reports the version as 29.0. But when I run
Q: version of application “Firefox.app” < “29.0.1”
A: False
T: 1626
Here are my results for getting the version.
Q: version of application “Firefox.app”
A: 29.0
T: 1747
Any ideas on how to get the correct results?
Thank you
(imported comment written by Chuxin)
Hi,
I believe this is bug. The agent cannot parse a version number on Mac correctly sometime.
I had similar issue before.
(“29.0” as version < “29.0.1” as version) will return false on a Mac agent.
but
(“29.0.0” as version < “29.0.1” as version) will return true on a Mac agent.
You may want to try this,
(exists application “Firefox.app” whose ( version of it = “29.0” as version OR version of it < “29.0.1”))
Regards
(imported comment written by EricWittersheim)
Thanks for your reply. I got it to work by using
Q: bundle version of application “Firefox.app” < “2914.5.6”
I did try and see what your code would do.
Q: (exists application “Firefox.app” whose (version of it = “29.0” as version))
A: True
T: 1622
But now after the upgrade
Q: version of application “Firefox.app”
A: 29.0.1
T: 1605
It has to be a bug.
(imported comment written by Chuxin)
Oh, my bad.
should use string comparison for the first part.
(exists application “Firefox.app” whose ( version of it as string = “29.0” OR version of it < “29.0.1”))
this bug is very tricky.
(imported comment written by EricWittersheim)
That looks like the solution.
Q:
(exists application “Firefox.app” whose
(version of it as string = "29.0))
A: False
T: 17375
Q:
(exists application “Firefox.app” whose
(version of it as string = "29.0.1))
A: True
Thanks for your help. This is much easier than trying to get the bundle application version of the new version.
Eric
(imported comment written by Chuxin)
you are welcome. glad i can help. =)
(imported comment written by Chuxin)
Hi Eric,
I have been checking this issue with other people.
Turned out, it is a design change.
Comparisons are done at the minimum length of one side.
(“9” as version = “9.1.2.3” as version) is true, which is equivalent to (“9” as version = “9” as version)
In your original case,
(“
29.0
” as version < “
29.0.1
” as version) is false, which is equivalent to (“
29.0
” as version < “
29.0
” as version)
Regards
Chuxin
(imported comment written by EricWittersheim)
Thanks for checking. If that is the case I think that is not a good change. Additionally, on the Windows side I don’t see the same results. So they only made the design change for Mac?
(imported comment written by Chuxin)
I tested on a 9.0 agent on Windows, it gives same result as it on Mac.
(“10” as version < “10.1” as version) is false.
Pre-9.0 agents are designed to return true for this relevance. But they have been fixed if I am not wrong.
system
May 29, 2014, 4:40pm
10
(imported comment written by EricWittersheim)
Ok I see the difference. In Windows I was using version of regapp. Which gives me the results I was expecting. It is the version of the file object that doesn’t behave as I hoped it would. Thanks for looking into this.
Q: version of regapp “Chrome.exe”
A: 35.0.1916.114
T: 0.850 ms
Q: version of regapp “Chrome.exe” < “35.0.1916.116”
A: True
T: 0.941 ms
jgstew
June 2, 2014, 12:31am
11
(imported comment written by jgstew)
try:
(pad of version of application “Firefox.app”) < (“29.0.1”)
or:
(pad of version of application “Firefox.app”) < (“29.0.1” as version)
There are definitely some inconsistencies between the Mac version comparison and Windows version comparison.