Jump to content

Reading version from server


 Share

Recommended Posts

Hello there. i have one problem.

Today i tryed to make something like updater for 1 game.

This game has many ini files that are in other folders. There are 3 main folders.

The folders are :

\Data\...\

\Exe\...\

\Dlls\...\

And in each of this folders are more folders with files.

I have a server with same folders. Now i need a script to check files on my server and compare it with files in game folder.

If there any files that are not same size then updater should download last updated file from my server and replace it with old one.

The question is how to do it. I tryed to search but i found nothing. All what i found were how to update just one file form inet.

This is what i got :

This code should read links from ini to every file on server and then compare size with current one but i cant get it work =(

Func _Check()
InetGet("http://myfileurl/check.ini", @TempDir & "\check.ini")
Local $File = @TempDir & "\check.ini"

$Var = IniReadSection($File, "Update")
for $i = 1 To $Var[0][0]
    $Onlinesize = InetGetSize($Var[$i][1])
    $Currentsize = FileGetSize($Path & "\Data\" & $Var[$i][1]
    If Not $OnlineSize = $Currentsize Then
        Exit
    Else
        InetGet($Var[$i][$1], $Path & "\Data\" & $Var[$i][1])
    EndIf
Next
EndFunc

InI File check.ini :

[Update]
Key1 = http://mysite/file.ini
Key2 = http://mystie/file2.ini

Thanks.

P.s sry for bad english.

Edited by Demon777
Link to comment
Share on other sites

You really should have a more descriptive title. Try changing it to something like "Reading version from server" or something. Also this has been asked before with a few solutions. Search a bit deeper.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...