locked
Web equivalent of FileVersionInfo.GetVersionInfo() RRS feed

  • Question

  • Hello,

    Is there a way to get an application's file information from a web link without having to download it?

    What I would like to be able to do is something like:

    var version = FileVersionInfo.GetVersionInfo(@"www.mywebsite.com/MyFile.exe");

    Friday, January 22, 2016 3:14 PM

Answers

  • The big issue here is that you are not directly accessing the hosts file system.
    You computer is talking to a server programm, wich in turn directly accesses the local file system. That communication with the server will use one of many different Network File System Protocolls. And if the server (and it's protocoll) is not designed to give you that information (and/or GetVersionInfo is not designed to use that provided info), the only way is to download the file to get the data stored in it.

    I think you are trying to build a automatic updater, but are on the wrong track:
    The often used way for automatic updaters is to just have a textfile with the version info - and maybe hash values for every file - in the same folder as the files themself.

    That way a client can just compare it's own known version with the textfiles first line and be certain if it should or should not download further.
    Adding the hash values to said file allows you to make certain the copy process works right and that you only download files you need (the ones not on the local computer, or whose hash does not match what is on the server). Very big projects (like MMO clients in the Gigabyte) might actually cache the local files hashes in a textfile themself, only to be rebuild during a repair scan.

    • Edited by Christopher84 Friday, January 22, 2016 3:31 PM
    • Marked as answer by AdamRowe Monday, January 25, 2016 11:45 AM
    Friday, January 22, 2016 3:29 PM

All replies

  • Hello Adam,

    have a look at below thread

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/d01ff84b-55c6-41b0-9d16-fc9c86c53465/how-can-i-get-a-remote-files-version-without-downloading?forum=vbgeneral


    A user friendly computer first requires a friendly user

    Friday, January 22, 2016 3:24 PM
  • The big issue here is that you are not directly accessing the hosts file system.
    You computer is talking to a server programm, wich in turn directly accesses the local file system. That communication with the server will use one of many different Network File System Protocolls. And if the server (and it's protocoll) is not designed to give you that information (and/or GetVersionInfo is not designed to use that provided info), the only way is to download the file to get the data stored in it.

    I think you are trying to build a automatic updater, but are on the wrong track:
    The often used way for automatic updaters is to just have a textfile with the version info - and maybe hash values for every file - in the same folder as the files themself.

    That way a client can just compare it's own known version with the textfiles first line and be certain if it should or should not download further.
    Adding the hash values to said file allows you to make certain the copy process works right and that you only download files you need (the ones not on the local computer, or whose hash does not match what is on the server). Very big projects (like MMO clients in the Gigabyte) might actually cache the local files hashes in a textfile themself, only to be rebuild during a repair scan.

    • Edited by Christopher84 Friday, January 22, 2016 3:31 PM
    • Marked as answer by AdamRowe Monday, January 25, 2016 11:45 AM
    Friday, January 22, 2016 3:29 PM
  • Great, thanks for the info Christopher84 and bahushekh. I will explore an alternative method. 
    Friday, January 22, 2016 3:41 PM
  • Hi AdamRowe,

    If some of the above replies are helpful to you, you could mark them as answers to close this thread, so that it could be very beneficial for other community members who have the similar questions.

    Thank you for your understanding and support.

    Best Regards,

    Albert Zhang


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, January 25, 2016 8:32 AM