un función que uso siempre.
un dia me encontré con ella en Internet y me enamoré de sus ojos.
Código Delphi
[-]
function TForm.AppPath(): String;
var x,y:string;
begin
x := ParamStr(0);
y := ExtractFileName(ParamStr(0));
Result := copy(x,0,length(x) - length(y));
end;