Well, let's start with the tutorial.
Well, it's a simple system, it downloads an program/file/something from your FTP.
in Uses put urlmon,shellapi;
Add the function:
Code:
function DownloadFile(Source, Dest: string): Boolean; begin try Result:= UrlDownloadToFile(nil, PChar(source),PChar(Dest), 0, nil) = 0; except Result:= False; end; end;
Add a TMemo in the standard pallet.
Now, do an archive ".txt" called "Verify" inside it, write the name of your form.
Example: CappieWilliams Likes Chocolate v1.0.
Upload it in an FTP folder, now make a button in your program and add the code below:
Code:
//Gets the Verify.txt and write in the memo
Memo1.Lines.text:=IdHTTP1.Get('http://www.elitepvpers.com/Verify.txt');
//If it's written the same name of the form on the memo, it will say that is already updated
if Memo1.Lines.Text = LoaderForm.caption then begin
MessageBeep(MB_ICONERROR);
showmessage('You already have the newest version!');
end else
//If it's not written in the .txt archive it will update
if messagedlg('There's a new version, want to update?',mtconfirmation,[mbyes,mbno],0)=mryes then
begin
//Download the archive and save in the archive folder with the "CappieWilliams" name XD
if DownloadFile ('http://www.elitepvpers.com/CappieWilliams.exe','CappieWilliams.exe') then
//Make an OK! sound
MessageBeep(MB_OK);
//If the archive exists, appear a succes message
if fileexists('CappieWilliams.exe') then begin
//Give a message telling that it's updated and close the program and open again!
showmessage('Update complete, click on OK to restart the application!');
application.terminate;
shellexecute (handle, 'open', 'CappieWilliams.exe', '', nil, sw_shownormal);
end;
end;
But, in the place of writting "Cappie'sAwesome" you write CappieWilliams Likes Chocolate v2.0 and in the v2.0 you edit from 1.0 to 2.0 to read on the archive, got it?
Credits: Cappie Williams (CappieW), made only for elitepvpers.com.
If you have some question, just ask here or send an PM.
Cya.






