hogfan Posted August 4, 2011 Share Posted August 4, 2011 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. -hogfan Link to comment Share on other sites More sharing options...
hannes08 Posted August 4, 2011 Share Posted August 4, 2011 Hi hogfan, take a look at FileGetVersion() in the helpfile. Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler] Link to comment Share on other sites More sharing options...
Chimaera Posted August 4, 2011 Share Posted August 4, 2011 (edited) 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) Else $CB1_inst_ver = "01/01/2011" $CB1_pen_ver = StringTrimRight(_FileGetProperty($CB1_path_pen_64,"Date Created"), 9) EndIf EndIf $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 August 4, 2011 by Chimaera If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
wakillon Posted August 4, 2011 Share Posted August 4, 2011 (edited) You need to indicate version in directives of your script #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_Fileversion=1.0.0.1 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** Without this indication FileGetVersion will return AutoIt Version. Edited August 4, 2011 by wakillon AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now