Jump to content
Sign in to follow this  
Demon777

Reading version from server

Recommended Posts

Demon777

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

Share this post


Link to post
Share on other sites
dbzfanatic

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.

Share this post


Link to post
Share on other sites
Demon777

Well. I cant find anythin in search thats why i posted it here.

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.