locked
Quick question about FileVersionInfo.GetVersionInfo RRS feed

  • Question

  • If the target file exists on a remote machine, will it be copied to the local machine in order to retrieve its version information?

    Thanks,
    Will.
    Monday, June 23, 2008 2:56 PM

Answers

  • Neither GetVersionInfo nor the native GetFileVersionInfo (which is used by GetVersionInfo) are documented as needing to copy a file locally first in order to work.  The OS should simply read the appropriate parts of the file to get the version info--if that's what it's doing there's no need to copy the file locally first (other than to cache read data).

    Is there a reason why you ask?
    http://www.peterRitchie.com/blog
    • Marked as answer by Will.Rogers Monday, June 23, 2008 5:52 PM
    Monday, June 23, 2008 5:03 PM

All replies

  • Neither GetVersionInfo nor the native GetFileVersionInfo (which is used by GetVersionInfo) are documented as needing to copy a file locally first in order to work.  The OS should simply read the appropriate parts of the file to get the version info--if that's what it's doing there's no need to copy the file locally first (other than to cache read data).

    Is there a reason why you ask?
    http://www.peterRitchie.com/blog
    • Marked as answer by Will.Rogers Monday, June 23, 2008 5:52 PM
    Monday, June 23, 2008 5:03 PM
  • Thanks for the reply!

    A few years ago at our company, developers were having significant performance issues related to checking a file's version over a local network. Their conclusion was that the target file was being copied to the local machine, so they scrapped that method of determining the file's version.This was either using Wise Installer or Delphi code - I don't recall which. My assumption is that both technologies also wrapper the native call - I could definitely be wrong, though.

    I'm in a similar situation where I need to determine the version of a file across a local network and the above anecdote has me wary of using what seems to be the obvious solution.

    Should I expect a significant performance difference when retrieving the file version of a 300MB file over a slow network vs. a 3MB file on a fast one? Hopefully the only difference is network latency and the target machine's speed of accessing and opening the larger file.

    Thanks,
    Will.
    Monday, June 23, 2008 5:32 PM
  • WillRogers said:

    Thanks for the reply!

    A few years ago at our company, developers were having significant performance issues related to checking a file's version over a local network. Their conclusion was that the target file was being copied to the local machine, so they scrapped that method of determining the file's version.This was either using Wise Installer or Delphi code - I don't recall which. My assumption is that both technologies also wrapper the native call - I could definitely be wrong, though.

    I'm in a similar situation where I need to determine the version of a file across a local network and the above anecdote has me wary of using what seems to be the obvious solution.

    Should I expect a significant performance difference when retrieving the file version of a 300MB file over a slow network vs. a 3MB file on a fast one? Hopefully the only difference is network latency and the target machine's speed of accessing and opening the larger file.

    Thanks,
    Will.



    I wouldn't expect it to be slower; but it would depend on how those APIs are implemented.  They should simply read the EXE header, find the resource information and read the VersionInfo section--but, if they're reading more information than that it will be slower than it needs to be.
    http://www.peterRitchie.com/blog
    Monday, June 23, 2008 5:42 PM