WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Compiler
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

ExtractAttachedFile only Newer Files


Question:

I am exploring the ExtractAttachedFile function. How can I know if the file in my EXE is newer/older than the file already extracted previously. When the program is first run, it should extract the files if they don't already exist. But if the files do already exist, I want to be able to say that if the files already present are newer then don't extract. That way if there is a change to a call or other file, we can just put that in the correct directory, and not have to recompile the main EXE.

Answer:

If you're talking about a Winbatch Compiled EXE you can furnish Version Info during compile time. Then you can use FileVerInfo() function to view it. As long as you keep things up to date it shouldn't be a problem.
FileN = "DivHideShow.exe"
FVersion = FileVerInfo(FileN, "", "FileVersion")
message("Debug", FVersion)
If you're talking about managing EXEs that come from some other source you have no control over, then maybe try using FileTimeTouch() to set the file times to the day of the "current build". For instance you build ver 1 today. Once you've done all your compiles, use FileTimeTouch to set them all the same. Next build tomorrow, has different set of FileTimeTouch() for that day. Look at the current EXE and if the files are older, then overwrite them.
Article ID:   W17387
File Created: 2008:04:10:15:09:06
Last Updated: 2008:04:10:15:09:06