To call this function place the next call anywhere inside your code:
SelfCopy('c:\Windows\Temp\myappcopy.exe')
~~~~~~~~~~~~~~~~~~~~~~~~~
function SelfCopy(const sPath : string) : boolean
begin
Result:=True;
if NOT Windows.CopyFile(PChar(ParamStr(0)), PChar(sPath), true) then
begin
RaiseLastWin32Error;
Result:=False;
end;
end;
~~~~~~~~~~~~~~~~~~~~~~~~~
Delphi tips navigator:
» How to convert Seconds to Time
« Correct date format for SQL

