2

I'm creating an 'updater' for my software that will automatically retrieve the latest and most up-to-date binary executable (.exe) from my server. The software will generate an Http request to a php script that returns a string that contains the latest software hash back to the application. If the returned hash is different from the hash of the local version of the software then it will automatically update.

My question is, which is the best type of hash to use that can be generated via. both php and c-sharp?

Also, do you think this is a good method for updating? I'm trying to give my application a seamless effect, where the user doesn't realise that the software has been updated and such.

Any opinions are welcome :)

Many Thanks.

Welton v3.62
  • 2,210
  • 7
  • 29
  • 46

1 Answers1

0

which is the best type of hash to use that can be generated via. both php and c-sharp?

You can use either MD5 or SHA-1 hash functions, I believe MD5 most popular for file hash value calculation.

do you think this method of updating is good?

If you keep only the latest version on the server - it would be fine, but if you have many file versions and need to determine the last one - it would not be enought since hash allows determine a difference. In case of multiple versions on the server - why just not keep a folder per each version? So you just need to sort folders by name and get the last one?

Sorted folder names:

-- v1.0
-- v1.1
-- v2.0
-- v2.1
Community
  • 1
  • 1
sll
  • 61,540
  • 22
  • 104
  • 156
  • Yes, I am only keeping the latest version (and maybe the previous just in-case I need to roll-back) on my server, i.e. I'm not archiving older versions. Thanks for the response :) –  Mar 21 '12 at 21:13