Browse Source

* Fixed use of Executable property

git-svn-id: trunk@17551 -
michael 14 years ago
parent
commit
cda78c6360
1 changed files with 11 additions and 16 deletions
  1. 11 16
      packages/fcl-process/src/win/process.inc

+ 11 - 16
packages/fcl-process/src/win/process.inc

@@ -217,25 +217,20 @@ begin
     
   if (FApplicationName='') and (FCommandLine='') and (FExecutable='') then
     Raise EProcess.Create(SNoCommandline);
-  if (FApplicationName='') then
+  if (FApplicationName<>'') then
     begin
-    PCommandLine:=Pchar(FCommandLine)
+    PName:=Pchar(FApplicationName);
+    PCommandLine:=Pchar(FCommandLine);
     end
-  else
+  else If (FCommandLine<>'') then
+    PCommandLine:=Pchar(FCommandLine)
+  else if (Fexecutable<>'') then
     begin
-    PName:=Pchar(FApplicationName);
-    If (FCommandLine<>'') then
-      PCommandLine:=Pchar(FCommandLine)
-    else if (Fexecutable='') then
-      PCommandLine:=Pchar(FApplicationName)
-    else
-      begin
-      Cmd:=MaybeQuote(Executable);
-      For I:=0 to Parameters.Count-1 do
-        Cmd:=Cmd+' '+MaybeQuote(Parameters[i]);
-      PCommandLine:=PChar(Cmd);
-      end;  
-    end;   
+    Cmd:=MaybeQuote(Executable);
+    For I:=0 to Parameters.Count-1 do
+      Cmd:=Cmd+' '+MaybeQuote(Parameters[i]);
+    PCommandLine:=PChar(Cmd);
+    end;
   If FCurrentDirectory<>'' then
     PDir:=Pchar(FCurrentDirectory);
   if FEnvironment.Count<>0 then