On Thu, Apr 3, 2014 at 2:59 PM, James Rankin <[email protected]> wrote: > I did this quick bit of PS to check a file version number and then launch a > patching process if it isn't at a certain level. It works OK but I am sure > there is a much cleaner and more elegant way to do this. Any pointers?
More of an observation than a suggestion: Testing version numbers is one of those things that you'd think would be easy but ends up being ridiculously complicated. Removing separators and just treating it as one big number seems like a good idea unless you want to compare version 11.2 with version 1.13. Plus some people throw in letters. Testing release dates might seem like a good alternative, but if the publisher is maintaining multiple release branches, patch release 1.1.42 might be released after major release 2.0.0. Blech. If the possible version numbers are more controlled, your method is usually fine. -- Ben

