Well, the idea shared with Naums was pretty close:
1)The user launchs Updater.exe
2) Updater.exe checks if there is a list of MD5s of current system files:
2A)If so: We send that list to the Server.
2B)If not: We create the list and send it to the Server.
3)The Server recives this list.
4)The Server checks if it has the latest iso from iso.reactos.org.
4B)If not: The Server downloads the latest ISO from iso.reactos.org,creates a folder for the ISO, unzips the ISO and its .cab files there, and creates a MD5 list of those files.
4B)If so: Checks the integrity of the folder: All the files and MD5 list exist.
5)The Server compares MD5 list coming from the user, with the one in the Server folder.
6)Are there any files with different MD5?or any files in the Server list that doesnt exist in the User list(a new dll,app,module added)?
6A)If so: The Server creates a .cab with the modified-new files and the reactos.inf file.
6B)If not: The Server sends a "Your version is totally updated".The connection is closed.END
7)Updater.exe recives the .cab and stores somewhere in C:
8)The connection to the Server is closed.
9)The Updater calls MoveFileEx with the flag MOVEFILE_DELAY_UNTIL_REBOOT that will perform the copy of the files when rebooting for those apps or dlls which are in use.
This way the Server will store just the ISOs requested by the users, and not all the isos from iso.reactos.org, preserving HDD space. These ISOs are stored for concurrent request, so a second request will be served much faster.
Statistiscally, with zillions of users, all the ISOs from Iso.reactos.org will be requested and stored in The Server.But we're not there yet
For that time, the Server will have plenty space to store all the ISOs or the updater will work linked to the Builders detecting the modified files on compiling time and creating diffs with those modified modules instead.
Improvements:
-Instead sending the MD5 of all the ReactOS files, Updater.exe can retrieve the revision from a registry key. The problem would be that if there is any error during the MoveFileEx, some files will be updated, other wont, but the revision in the registry is updated(or not). Managing ReactOS as a whole is more prone to errors that managing by file.
Problems:
-If Hto is right, and he is because he knows better, two dlls with the same code will have different MD5 because the "PE Header". The Hash algorithm(that is included not just by Security reasons but also to discover differences between the Dll installed in the User PC and the latest version of the Dll stored in the Server) must be, then, a different one.
Is there a Hash algorithm that could be used for this purpose?
Maybe we can create a really easy Hash,one that takes the "Name of the file","Extension of the file" and "Size in bytes". It won't be supersecure but at least will work to check for differences.
- Do you see any other issue?