• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 292
  • Last Modified:

how to copy qtintf.dll to system directory when .exe delphi runs?

assalamo alekom,
hello friends..
1) I want to copy qtintf.dll to the system directory when I double clicked my .exe file on the other computers, independent of the windows version.

2) when I want to open windows directory i use %windir%, but how can i open the system directory and the program files and my documents in the same way?
thanx.
0
aelabed
Asked:
aelabed
1 Solution
 
ILECommented:

working solution

var  s:string;
begin
 setlength(s,255);
 getsystemdirectory(pchar(s),255);
 setlength(s,pos(#0,s)-1);
 label1.caption:=s;
end;

this is for system directory



for your application u mey use
extractfilepath(application.exename)



easy aren't:))
0
 
Lukasz LachCommented:
var sdir: string;
begin
  SetLength(sdir, 255);
  GetSystemDirectory(PChar(sdir), 255);
  SetLength(sdir, Pos(#0, sdir)-1);
  CopyFile(PChar(ExtractFilePath(Application.Exename)+'qtintf.dll'), PChar(sdir+'\qtintf.dll'), False);
end;

:-)
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now