Jump to content

Recommended Posts

Posted

I am having a weird scenario.

I have an INI file which has the result... App1=10.0.9425.6254 and on the local machine, the application version say is 10.0.10224.63255

Using the below code is always giving the incorrect result as "Updated". For some reason it looks like code is only reading the 1st decimal and is not looking at the 2nd and 3rd decimal.

Can someone help?

Local $ServerVer = IniRead("c:\TEST\test.ini", "Results", "App1", "")
Local $LocalVer = FileGetVersion("FilePath", "ProductVersion")

    Select
        Case $LocalVer < $ServerVer
            MsgBox(0, '', $LocalVer & " < " & $ServerVer)

        Case Else
            MsgBox(0, '', "updated")
    EndSelect

 

  • Developers
Posted

Why do you think you can do a less than comparison on a none numeric value? A version number is not a number but rather 4 level number.
That is why there is a _VersionCompare() UDF available! ;) Check the helpfile for details.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...