feeks Posted November 7, 2010 Share Posted November 7, 2010 Can anyone tell me if it possible to obtain a file date stamp of a fileinstall()-ed file in memory without extracting the file first or pre-storing the source file date-stamp as some sort of information file for later checking. I would like to avoid performing an extraction of the file unless the date stamp of the fileinstall()-ed file is newer than the equivalent destination file in an attempt to optimize code run-time. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 7, 2010 Moderators Share Posted November 7, 2010 feeks,You do not need a separate file, you can always hardcode the timestamp as a Const in your compiled file. You would have to do this manually before compilation. I cannot think of a way to retrieve it as you compile and then store it within the exe - but someone else might if you can wait a bit. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
feeks Posted November 7, 2010 Author Share Posted November 7, 2010 Thanks Melba23, a howto on that would be great Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 8, 2010 Moderators Share Posted November 8, 2010 feeks,You would have to run FileGetTime on the file you are FileInstalling beforehand. I would suggest setting the "format" parameter to 1 to get a string return:ConsoleWrite(FileGetTime("File_Path", 0, 1) & @CRLF)This will give you the returned value in the SciTE output pane in the form "YYYYMMDDHHMMSS".Then you put it into your main script as a constant and do a comparison like this:; Among your declarations Global Const $MyFileTimeStamp = "YYYYMMDDHHMMSS" ; <<< the value you got from the step above, not the literal string! ; Then you look for the installed file timestamp $sInstalledFileTimeStamp = FileGetTime("Where_you_think_it_should_be_path", 0, 1) ; And see if it is an earlier version If Number($sInstalledFileTimeStamp) < Number($MyFileTimeStamp) Then ; You need to install your version EndIfNote that I converted the values to numbers before making the comparison - it might work with strings, but it is better to make an arithmetical comparison. All clear? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
feeks Posted November 8, 2010 Author Share Posted November 8, 2010 Love your work M23I adapted your suggestion slightly by configuring the const to the FileGetTime() of the source exe as FileInstalled against the locally stored copy and it worked a treat public/style_emoticons/autoit/rolleyes.giffeeks 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