Jump to content
Sign in to follow this  

Quick Dirty method: Check for new version?

Recommended Posts


I have an application that I need to implement and autoupdate function. When the app launches, I will call another .exe that will read an update path from an .ini file. It will then need to check for a new version of the my applications .exe file on a network share. My question is, what is a reliable quick, dirty way of doing this.......as far as comparing the two files (the one currently on the users machine, and the one out on the network share). Thanks for any suggestions. I did some digging in the Example scripts forum but wasn't able to run across anything there.


Share this post

Link to post
Share on other sites

Hi hogfan,

take a look at FileGetVersion() in the helpfile.

Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]

Share this post

Link to post
Share on other sites

I had problems with File Get version and had to make one to look at creation date instead, small piece below

This is not network but should be adaptable

#include <Date.au3>
#include _FileGetProperty.au3

$CB1_path_64 = "C:\Program Files (x86)\AVG\AVG10\avgtray.exe"
$CB1_path_pen_64 = @ScriptDir & "\file_includes\install_avg_64.exe"
    If FileExists($CB1_path_64) Then
    $CB1_inst_ver = StringTrimRight(_FileGetProperty($CB1_path_64,"Date Created"), 9) ; searches for the file then trims the hrs off to leave just the date
    $CB1_pen_ver = StringTrimRight(_FileGetProperty($CB1_path_pen_64,"Date Created"), 9)
    $CB1_inst_ver = "01/01/2011"
    $CB1_pen_ver = StringTrimRight(_FileGetProperty($CB1_path_pen_64,"Date Created"), 9)
$CB1_I_ver = StringRegExpReplace($CB1_inst_ver, "\A(\d*)/(\d*)/(\d*)","$3/$2/$1"); changes the date to an autoit readable form
$CB1_P_ver = StringRegExpReplace($CB1_pen_ver, "\A(\d*)/(\d*)/(\d*)","$3/$2/$1")

If _DateDiff( "D", $CB1_I_ver, $CB1_P_ver) < 21 Then; tests against 21 days difference
"your code below

This uses the FileGetProperty UDF which is available here

Like i say not exactly what you want but might start you off

Plus you can search for other things from the file details with this UDF

Edited by Chimaera

Share this post

Link to post
Share on other sites

You need to indicate version in directives of your script

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

Without this indication FileGetVersion will return AutoIt Version.

Edited by wakillon

AutoIt X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post

Link to post
Share on other sites

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
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.