Program New;
Var
Download: TStringArray;
Downloaded: Array[0..10] Of String;
I, Files: Integer;
currentver, currentversion: string;
const
thisversion = 97;
Procedure DownloadFiles;
Begin
For I := 0 To High(Download) Do
Begin
Downloaded := GetPage('http://scarreflection.googlecode.com/svn/trunk/' + Download);
WriteLn(download);
End;
End;
Procedure Install;
Begin
For I := 0 To High(Download) Do
Begin
Files := RewriteFile(AppPath + '\Includes\SRL\SRL\Reflection\' + Download, False);
WriteFileString(Files, Downloaded);
CloseFile(Files);
End;
End;
Procedure AutoUpdate;
begin
currentver := GetPage('http://scarreflection.googlecode.com/svn/trunk/');
currentversion := Between('<title>Revision ', ': /trunk', currentver);
WriteLn('Our current version is: '+inttostr(thisversion)+' and the latest version is: '+currentversion);
If (thisversion = strtoint(currentversion)) then
begin
WriteLn('We got the latest Reflection !');
exit;
end else
begin
DownloadFiles;
Install;
end;
end;
Begin
Download := ['Changelog.txt', 'Characters.Scar', 'Core.scar',
'Depreciated.scar', 'Hooks.Scar', 'Objects.Scar', 'README.txt',
'Reflection.Scar', 'Walking.Scar', 'Items.scar'];
AutoUpdate;
End.

