Post Pacific

Post Pacific (https://postpacific.loc-online.com/index.php)
-   Темы без сохранившегося раздела (https://postpacific.loc-online.com/forumdisplay.php?f=10001)
-   -   [SHARE] AutoUpdater for private servers (https://postpacific.loc-online.com/showthread.php?t=2476)

kazhkaz 08.11.2005 18:53

[SHARE] AutoUpdater for private servers
 
As i promised.
I`m sharing my just finished autoupdater for private servers.

This one uses client-server architecture (this means you`ll have to have it server side application running on your server), and works in pretty similar way the original NCSoft`s autoupdater does.
  • Server side and fully operational demo client included.
  • Source for client included (written in Delphi 7).
  • Source for server available for devs via PM

features:
  • file-by-file checking and downloading
  • UnRAR support (unrar.dll required (included))
  • AutoCheck support
  • Multithreaded (both client and server)

report bugs to [email protected]

If, you`ll use it in your own apps, credit would be appreciated :D

sorry cannot upload to postpacific, use these links:
2006 07 05 update - fixed broken links, added v1.1 autocheck editor (see page 5 for this)

Eliot 08.11.2005 20:28

AWESOME !!!
JUST AWESOME !!!!
Can i have a linux version of server ? You didn't include the files so i cant compile myself.

Anyway, THANK YOU !
Eli

wton 08.11.2005 23:38

=O really good :D

imaznumkay 09.11.2005 00:51

autocheck list editor seems to be broken...
Access violation at address 0046C145 in module 'autocheck_list_editor.exe', Read address of 00000024.


AWSOME program btw :D

edit : nvm i had to run the update server and get the list :D

imaznumkay 09.11.2005 02:27

um another problem....well shellexecute is set as ../system/l2.exe but it does not find the executable for some reason....any idea on that?

kazhkaz 09.11.2005 11:20

Quote:

Originally Posted by imaznumkay
um another problem....well shellexecute is set as ../system/l2.exe but it does not find the executable for some reason....any idea on that?

Shellexecute uses a relative path sytem\l2.exe, however i haven`t tested it :) I`ll post update for this and an access violation fix soon:)

kazhkaz 09.11.2005 11:21

Quote:

Originally Posted by Eliot
AWESOME !!!
JUST AWESOME !!!!
Can i have a linux version of server ? You didn't include the files so i cant compile myself.

Anyway, THANK YOU !
Eli

If you`ll be capable of compiling delphi 7 project into linux - pm me, i`ll send you the sources :D

Eliot 09.11.2005 13:37

I am capable, if it doesn't use windows specific packages, it's possible to compile delphi on linux with Kylix. I did it before.

imaznumkay 10.11.2005 00:48

relative path doesnt work o_O

..\system\l2.exe ../system/l2.exe

same error

im lovin the update feature tho :D

TheOrder 10.11.2005 07:56

:D Hope you finish the Autoupdater Soon !!!
GJ and keep up the good work !!! :D

sab- 10.11.2005 08:01

Quote:

Originally Posted by Eliot
I am capable, if it doesn't use windows specific packages, it's possible to compile delphi on linux with Kylix. I did it before.

kylix won't daemonize it... =\ source need to be rewrited to be cool )))

death_star 10.11.2005 14:58

Hmmm not work for me..
First I try work without rar compression, but autoapderter for client try to unpack downloaded file with rar, so it don`t work.. only with rar compression.
then I compress all files on directories with winrar, and make each file in eache archive, but mass renamer can`t rename file. It`s say that "List index os out of bounds(0)"
What I did wrong? :cry:

PS: I found my mistake. I foget put unrar.dll in to the server folder :-)

kazhkaz 10.11.2005 16:31

Quote:

Originally Posted by imaznumkay
relative path doesnt work o_O

..\system\l2.exe ../system/l2.exe

same error

im lovin the update feature tho :D

Here, replace the TMain.Button2Click(Sender: TObject) method with this - it will definitely work :)
Code:

procedure TMain.Button2Click(Sender: TObject);
var s, s1: string;
    pc, pc1: PChar;
    r: integer;
begin

  // launch lineage2
  s:= ExtractFilePath(ParamStr(0))+'System\l2.exe';
  s1:= ExtractFilePath(s);
  pc:= AllocMem(Length(s)+1);
  pc1:= AllocMem(Length(s1)+1);
  StrPCopy(pc, s);
  StrPCopy(pc1, s1);
  chDir(s1);
  r:= ShellExecute(Handle, 'Open', pc, '', pc1, SW_SHOWNORMAL);
  FreeMem(pc);
  FreeMem(pc1);

  case r of
    0: begin
      MessageBox(Handle, 'System is out of resources',
                'Out of resources', MB_OK+MB_ICONERROR);
    end;
    ERROR_FILE_NOT_FOUND: begin
      MessageBox(Handle, 'Lineage II main executable not found.'#13#10+
                        'Check whether the launcher is in Lineage II installation root directory.'#13#10+
                        'Also, you may have not updated your Lineage II yet.',
                'File Not Found', MB_OK+MB_ICONERROR);
    end;
    ERROR_PATH_NOT_FOUND: begin
      MessageBox(Handle, 'Lineage II main executable path not found.'#13#10+
                        'Check whether the launcher is in Lineage II installation root directory.'#13#10+
                        'Also, you may have not updated your Lineage II yet.',
                'Path Not Found', MB_OK+MB_ICONERROR);
    end;
    else begin
      if r > 33 then Close
      else begin
        MessageBox(Handle, 'Unknown error has occurred while launching Lineage II'#13#10+
                          'Check whether the launcher is in Lineage II installation root directory.'#13#10+
                          'Also, you may have not updated your Lineage II yet.',
                  'Unknown Error', MB_OK+MB_ICONERROR);
      end;
    end;
  end;
end;


serjr 10.11.2005 19:36

Quote:

Originally Posted by imaznumkay
um another problem....well shellexecute is set as ../system/l2.exe but it does not find the executable for some reason....any idea on that?

This error generated because of not right working dir
You can edit it in exe by filing zeros (00) at address 76d82 till 76d8e, or compile with fix that Kazhkaz post

to Kazhkaz:

I have some questions about updater work

1. Why it can't update files with read only attribute placed in rar. It downloads these files again and again.
2. I have a problem with autocheck.lst editor :( can you post this file format, or some little tutorial ? ;)
3. Can you add support for zip archives in mass renaming tool? :)

kazhkaz 11.11.2005 16:52

Quote:

Originally Posted by serjr
Quote:

Originally Posted by imaznumkay
um another problem....well shellexecute is set as ../system/l2.exe but it does not find the executable for some reason....any idea on that?

This error generated because of not right working dir
You can edit it in exe by filing zeros (00) at address 76d82 till 76d8e, or compile with fix that Kazhkaz post

to Kazhkaz:

I have some questions about updater work

1. Why it can't update files with read only attribute placed in rar. It downloads these files again and again.
2. I have a problem with autocheck.lst editor :( can you post this file format, or some little tutorial ? ;)
3. Can you add support for zip archives in mass renaming tool? :)

1. It`s internal limitation of the Pascal. The only way is to manually reset file attributes
2.
Code:

  AChkEntry = record
    fname: string[255];
    crc32_check,
    fsize_check: boolean;
    crc32: LongWord;
    fsize: integer;
  end;

AChkFile = file of AChkEntry;

It`s simply typed file of AChkEntry :D

3. Then you`ll have to rewrite extraction code in both Server and Client - since they also use this format (that`s why unrar.dll must be present in both client and server directories). Also unzip libraries must be added...

serjr 11.11.2005 17:57

unrar.dll can unpack zip
also i have problems with crc calculation on some files :( it always say on them FFFFFFFF :(
here one of them
http://rapidshare.de/files/7490738/L2Font-r.rar.html

dudka 11.11.2005 19:41

damn, how to generate list.fl? :|

kazhkaz 16.11.2005 18:13

Quote:

Originally Posted by serjr
unrar.dll can unpack zip
also i have problems with crc calculation on some files :( it always say on them FFFFFFFF :(
here one of them
http://rapidshare.de/files/7490738/L2Font-r.rar.html

It uses internal rar archive CRC32 field, so it seems to be, that in zip archives this field is missing or unreadable for program...

kazhkaz 16.11.2005 18:15

Quote:

Originally Posted by dudka
damn, how to generate list.fl? :|

you don`t need to generate this file. It is generated automaticcally each time the server is started (by "Start" button)

kazhkaz 16.11.2005 18:32

And here goes fix for the autocheck file list generator:

HF 16.11.2005 19:03

kazhkaz, you can do tool without server side? Or i dont understund - what make server side service? It is no can remove from update process?
I try now make very simple L2Updater. Only client side and simple web share metod from "server-side". With CRC check sure. No have much time for fast finish.
Maybe i wrong. But, why/for what need server side?

kazhkaz 21.11.2005 05:45

Quote:

Originally Posted by HF
kazhkaz, you can do tool without server side? Or i dont understund - what make server side service? It is no can remove from update process?
I try now make very simple L2Updater. Only client side and simple web share metod from "server-side". With CRC check sure. No have much time for fast finish.
Maybe i wrong. But, why/for what need server side?

You see, first of all, the used crc32-checking and rar archive support requires additional programs on the server-side, also it is far easier for the client to ger already complete data on what files are available from the server, their pre-computed crc32, because we use not the crc32 value of the archive, but the crc32 value of the file inside archive, also, this project is only the framework for my main project for the server i`m working on, which uses this, modificated, server side to transfer addidional data to and from the client.

death_star 21.11.2005 13:44

Quote:

Originally Posted by kazhkaz
Quote:

Originally Posted by serjr
unrar.dll can unpack zip
also i have problems with crc calculation on some files :( it always say on them FFFFFFFF :(
here one of them
http://rapidshare.de/files/7490738/L2Font-r.rar.html

It uses internal rar archive CRC32 field, so it seems to be, that in zip archives this field is missing or unreadable for program...

Oh no.. :-) You don`t understand.. I use rar compression, but when server calculate crc of this archive, it think that crc is ffffffff... But it`s was standart rar archive...

kazhkaz 23.11.2005 09:34

Quote:

Originally Posted by death_star
Quote:

Originally Posted by kazhkaz
Quote:

Originally Posted by serjr
unrar.dll can unpack zip
also i have problems with crc calculation on some files :( it always say on them FFFFFFFF :(
here one of them
http://rapidshare.de/files/7490738/L2Font-r.rar.html

It uses internal rar archive CRC32 field, so it seems to be, that in zip archives this field is missing or unreadable for program...

Oh no.. :-) You don`t understand.. I use rar compression, but when server calculate crc of this archive, it think that crc is ffffffff... But it`s was standart rar archive...

Argh, faced this problem myself. Just leave this, at most it will result in re-downloading every time when updating, that`s all :D

midnight 23.11.2005 14:12

I have error: the compilator say: [Fatal Error] l2_updater.dpr(1): Unit not found: 'System.pas' or binary equivalents (DCU,DPU)

Sorry for my english

kazhkaz 24.11.2005 01:05

Quote:

Originally Posted by midnight
I have error: the compilator say: [Fatal Error] l2_updater.dpr(1): Unit not found: 'System.pas' or binary equivalents (DCU,DPU)

Sorry for my english

well, the system.pas is the built-in unit for delphi. Try reinstalling it, because it must be problem with your IDE ;)

GMan 24.11.2005 06:01

I have never used delphi befor, but when i try to compile i get errors

[Error] l2u_client_acthread.pas(80): E2250 There is no overloaded version of 'Connect' that can be called with these arguments
[Error] l2u_client_acthread.pas(81): E2003 Undeclared identifier: 'ReadLn'
[Error] l2u_client_acthread.pas(88): E2003 Undeclared identifier: 'WriteLn'
[Error] l2u_client_acthread.pas(89): E2003 Undeclared identifier: 'ReadLn'
[Error] l2u_client_acthread.pas(96): E2003 Undeclared identifier: 'WriteLn'
[Error] l2u_client_acthread.pas(98): E2003 Undeclared identifier: 'ReadInteger'
[Error] l2u_client_acthread.pas(100): E2003 Undeclared identifier: 'WriteLn'
[Error] l2u_client_acthread.pas(114): E2003 Undeclared identifier: 'ReadInteger'
[Error] l2u_client_acthread.pas(115): E2003 Undeclared identifier: 'WriteLn'
[Error] l2u_client_acthread.pas(121): E2003 Undeclared identifier: 'ReadBuffer'
[Error] l2u_client_acthread.pas(123): E2003 Undeclared identifier: 'WriteLn'
[Warning] l2u_client_acthread.pas(198): W1020 Constructing instance of 'TIdIOHandlerSocket' containing abstract method 'TIdIOHandler.ReadFromSource'
[Fatal Error] l2u_client_uthread.pas(45): F2063 Could not compile used unit 'l2u_client_acthread.pas'

please help. only have 30 days left on trial :)

lich 24.11.2005 15:37

Which version of Delphi do you have? Seems something like Delphi 2005.
Try Delphi 6 or 7.

kazhkaz thanks a lot for the updater!

Small request :) Can you make server side exe to automatically start server on running. May be by using a command line. or putting server into services.

GMan 24.11.2005 21:02

yep i got 2005, anyone know where i can get delphi 7 its not
 
yep i got 2005, anyone know where i can get delphi 7 its not on their webpage, they ony have it so u can get a key if you have the CD :(

wiish i knew delphi better cause i would just port it to a lang. i know

pirateice 25.11.2005 14:14

is there a visual basic version? please.. :)

GMan 26.11.2005 05:43

sorry to be an idiot with delphi, but i finally got delphi 7 personal and when i compile i get

[Fatal Error] l2u_client_uthread.pas(6): File not found: 'IdIOHandler.dcu'

any ideas on this error

GMan 26.11.2005 06:30

Ok i figured something out. if you are going to use 2005 all you have to do is tell delphi to use $(BDS)\Lib\Indy9 not $(BDS)\Lib\Indy10

GMan 26.11.2005 08:03

Im on a role (hope i dont get yelled at for posting so much) but i fould a fix

i noticed that it doesnt overwirigt files if they are on the clienside alread it just keeps redownloading them becaue the CRC is wrong

simple fix

on line 275 in file l2u_client_uthread.pas
add
DelFile(work_dir+s); above
RenameFile(ExtractFilePath(work_dir+s)+temp_f_name , work_dir+s);

havent checked the autocheck code because i cant figure out how to add things to the autocheck.lst file with the updeted maker.
and this is for non rar setup not sure if after it unrars he file if it rus this code or somewhere else

anyway hope this helps

good share and thanks for making me learn delphi it was on my list for a while :)

GMan 01.12.2005 09:07

How do i add files to the autocheck ditor. i downloaded the new version but have no idea how to add files to it. tried dragging files typing files but the add button never enabels

thanks

KTPSMF 01.12.2005 09:08

i think [kazhkaz] is worth an user lace user

kazhkaz 01.12.2005 15:28

Quote:

Originally Posted by GMan
How do i add files to the autocheck ditor. i downloaded the new version but have no idea how to add files to it. tried dragging files typing files but the add button never enabels

thanks


try doubleclicking the edit field ;)

kazhkaz 01.12.2005 15:39

Quote:

Originally Posted by lich
Which version of Delphi do you have? Seems something like Delphi 2005.
Try Delphi 6 or 7.

kazhkaz thanks a lot for the updater!

Small request :) Can you make server side exe to automatically start server on running. May be by using a command line. or putting server into services.

here you go. just start it with -s command line parameter (note: case sensitive). It`ll autostart within 15 seconds.

kazhkaz 01.12.2005 15:41

Quote:

Originally Posted by GMan
Im on a role (hope i dont get yelled at for posting so much) but i fould a fix

i noticed that it doesnt overwirigt files if they are on the clienside alread it just keeps redownloading them becaue the CRC is wrong

simple fix

on line 275 in file l2u_client_uthread.pas
add
DelFile(work_dir+s); above
RenameFile(ExtractFilePath(work_dir+s)+temp_f_name , work_dir+s);

havent checked the autocheck code because i cant figure out how to add things to the autocheck.lst file with the updeted maker.
and this is for non rar setup not sure if after it unrars he file if it rus this code or somewhere else

anyway hope this helps

good share and thanks for making me learn delphi it was on my list for a while :)

in fact ot does overwrite. the bug seems to be hidden somewhere deep inside server. currently investigating this one.

kazhkaz 01.12.2005 15:44

Quote:

Originally Posted by pirateice
is there a visual basic version? please.. :)

sorry, no VB version ;) Unless someone would port the sources into VB.

kazhkaz 01.12.2005 15:56

Btw, it would be very nice if someone would recommend me to digital to let me into the modders section. I`m currently working on a couple of projects and don`t know whether they`d be useful or not :roll:

P.s. thanks in advance ;)


All times are GMT. The time now is 16:23.