mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-01 21:20:28 +02:00
IDE: using process Executable instead of CommandLine
git-svn-id: trunk@51678 -
This commit is contained in:
parent
dabcac3009
commit
85acb5b2f9
27
ide/main.pp
27
ide/main.pp
@ -6895,9 +6895,9 @@ const
|
|||||||
StartLazProcess : TProcessUTF8;
|
StartLazProcess : TProcessUTF8;
|
||||||
ExeName : string;
|
ExeName : string;
|
||||||
Params : TStrings;
|
Params : TStrings;
|
||||||
Dummy : Integer;
|
Dummy , i: Integer;
|
||||||
Unused : boolean;
|
Unused : boolean;
|
||||||
CmdLine: string;
|
aParam: string;
|
||||||
begin
|
begin
|
||||||
StartLazProcess := TProcessUTF8.Create(nil);
|
StartLazProcess := TProcessUTF8.Create(nil);
|
||||||
try
|
try
|
||||||
@ -6922,18 +6922,23 @@ const
|
|||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
//DebugLn('Setting CommandLine');
|
//DebugLn('Setting CommandLine');
|
||||||
CmdLine := ExeName +
|
StartLazProcess.Executable:=ExeName;
|
||||||
' --lazarus-pid='+IntToStr(GetProcessID) + ' '+
|
StartLazProcess.Parameters.Add('--lazarus-pid='+IntToStr(GetProcessID));
|
||||||
GetCommandLineParameters(Params, False);
|
StartLazProcess.Parameters.AddStrings(Params);
|
||||||
|
|
||||||
DebugLn('Hint: (lazarus) CommandLine 1 : %s', [CmdLine]);
|
i:=StartLazProcess.Parameters.Count-1;
|
||||||
|
while (i>=0) do begin
|
||||||
|
aParam:=StartLazProcess.Parameters[i];
|
||||||
|
if (LeftStr(aParam,length(PrimaryConfPathOptLong))=PrimaryConfPathOptLong)
|
||||||
|
or (LeftStr(aParam,length(PrimaryConfPathOptShort))=PrimaryConfPathOptShort)
|
||||||
|
then break;
|
||||||
|
dec(i);
|
||||||
|
end;
|
||||||
|
|
||||||
if (pos(PrimaryConfPathOptLong, CmdLine) = 0) and
|
if i<0 then
|
||||||
(pos(PrimaryConfPathOptShort, CmdLine) = 0) then
|
StartLazProcess.Parameters.Add(PrimaryConfPathOptLong + GetPrimaryConfigPath);
|
||||||
CmdLine := CmdLine + ' "' + PrimaryConfPathOptLong + GetPrimaryConfigPath+'"';
|
|
||||||
|
|
||||||
DebugLn('Hint: (lazarus) CommandLine 2 : %s', [CmdLine]);
|
DebugLn('Hint: (lazarus) CmdLine=[',StartLazProcess.Executable,' ',MergeCmdLineParams(StartLazProcess.Parameters),']');
|
||||||
StartLazProcess.CommandLine := CmdLine;
|
|
||||||
StartLazProcess.Execute;
|
StartLazProcess.Execute;
|
||||||
finally
|
finally
|
||||||
FreeAndNil(Params);
|
FreeAndNil(Params);
|
||||||
|
Loading…
Reference in New Issue
Block a user