mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 08:29:06 +02:00
IDE: fixed checking if TargetExeDirectory(C:\) exists
git-svn-id: branches/fixes_2_0@61655 -
This commit is contained in:
parent
36ddc4233b
commit
86219c1ee7
@ -722,6 +722,7 @@ begin
|
||||
end;
|
||||
|
||||
function PathIsInPath(const Path, Directory: string): boolean;
|
||||
// Note: Under Windows this treats C: as C:\
|
||||
var
|
||||
ExpPath: String;
|
||||
ExpDir: String;
|
||||
|
39
ide/main.pp
39
ide/main.pp
@ -6791,27 +6791,28 @@ begin
|
||||
TargetExeName := Project1.CompilerOptions.CreateTargetFilename;
|
||||
TargetExeDirectory:=ChompPathDelim(ExtractFilePath(TargetExeName)); // Note: chomp is needed by FileExistsCached under Windows
|
||||
if FilenameIsAbsolute(TargetExeDirectory) then begin
|
||||
if FileExistsCached(TargetExeDirectory) then begin
|
||||
if not DirPathExistsCached(TargetExeDirectory) then begin
|
||||
// Note: FileExists('C:\') = false
|
||||
if not DirPathExistsCached(TargetExeDirectory) then begin
|
||||
if FileExistsCached(TargetExeDirectory) then begin
|
||||
Result:=IDEQuestionDialog(lisFileFound,
|
||||
Format(lisTheTargetDirectoryIsAFile, [sLineBreak
|
||||
+TargetExeDirectory]),
|
||||
mtWarning, [mrCancel,mrIgnore]);
|
||||
Format(lisTheTargetDirectoryIsAFile, [sLineBreak
|
||||
+TargetExeDirectory]),
|
||||
mtWarning, [mrCancel,mrIgnore]);
|
||||
if Result<>mrIgnore then exit(mrCancel);
|
||||
end;
|
||||
end else begin
|
||||
if not PathIsInPath(TargetExeDirectory,WorkingDir)
|
||||
then begin
|
||||
Result:=IDEQuestionDialog(lisCreateDirectory,
|
||||
Format(lisTheOutputDirectoryIsMissing, [TargetExeDirectory]),
|
||||
mtConfirmation, [mrYes, lisCreateIt,
|
||||
mrCancel]);
|
||||
if Result<>mrYes then exit;
|
||||
end;
|
||||
Result:=ForceDirectoryInteractive(TargetExeDirectory,[mbRetry]);
|
||||
if Result<>mrOk then begin
|
||||
debugln(['Error: (lazarus) [TMainIDE.DoBuildProject] ForceDirectoryInteractive "',TargetExeDirectory,'" failed']);
|
||||
exit;
|
||||
end else begin
|
||||
if not PathIsInPath(TargetExeDirectory,WorkingDir)
|
||||
then begin
|
||||
Result:=IDEQuestionDialog(lisCreateDirectory,
|
||||
Format(lisTheOutputDirectoryIsMissing, [TargetExeDirectory]),
|
||||
mtConfirmation, [mrYes, lisCreateIt,
|
||||
mrCancel]);
|
||||
if Result<>mrYes then exit;
|
||||
end;
|
||||
Result:=ForceDirectoryInteractive(TargetExeDirectory,[mbRetry]);
|
||||
if Result<>mrOk then begin
|
||||
debugln(['Error: (lazarus) [TMainIDE.DoBuildProject] ForceDirectoryInteractive "',TargetExeDirectory,'" failed']);
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user