On Wed, 26 Aug 2015, FreeMan wrote:

On 26.08.2015 18:35, Michael Van Canneyt wrote:
AProcess.Environment must be used for this.

Michael.
Sorry, I didn't understand what you mean.
This is my test code, before and after execute, write all environment variables in memo1, but same variables. Tprocess class similar not working.

   if Assigned(AProcess)then FreeAndNil(AProcess);
   AProcess := TProcess.Create(Application);
   AProcess.Options := AProcess.Options + [poWaitOnExit, poUsePipes];
     Form1.Memo1.Clear;
     for I := 1 to GetEnvironmentVariableCount do begin
     AProcess.Environment.Add(GetEnvironmentString(I));

Here you must add

     AProcess.Environment.Add('LD_LIBRARY_PATH='+fb_RootPath);

It is not necessary to execute the shell.

I use this technique myself, so I am sure it works.

Michael.

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to