1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| chemin:=extractfilepath(paramstr(0));
opendialog.InitialDir:=chemin;
opendialog.Execute;
source:=opendialog.filename;
if source='' then close;
destination:='C:\WINDOWS\Fonts\'
+rightstr(opendialog.filename,pos('\',reversestring(opendialog.filename))-1);
case fileexists(destination) of
false: begin
if messagedlg('Installer la police de caratères'+chr(10)
+rightstr(opendialog.filename,pos('\',reversestring(opendialog.filename))-1)+' ?',mtConfirmation,mbOKCancel,0)
=mrno then close;
MoveFileEx(PChar(Source), PChar(Destination),MOVEFILE_COPY_ALLOWED);
showmessage(rightstr(opendialog.filename,pos('\',reversestring(opendialog.filename))-1)
+chr(10)+'installation réussie');close;end;
true: begin
showmessage('La police de caractères'+chr(10)+
rightstr(opendialog.filename,pos('\',reversestring(opendialog.filename))-1)
+chr(10)+'est déjà installée');close;end;
end; |