On 26.08.2015 22:22, Michael Van Canneyt wrote:
I understand this. That is exactly what AProcess.Environment does.

Michael.

      AProcess.Environment.Add('LD_LIBRARY_PATH=' + fb_RootPath);
      AProcess.Environment.Add('FIREBIRD=' + fb_RootPath);
      for I := 0 to GetEnvironmentVariableCount do begin
        AProcess.Environment.Add(GetEnvironmentString(I));
        Form1.Memo1.Lines.Add(AProcess.Environment.Strings[I]);
      end;

      Form1.Memo1.Lines.Add('');
      Form1.Memo1.Lines.Add('-------------------------------');
      Form1.Memo1.Lines.Add('--------------------');
      Form1.Memo1.Lines.Add('');
 Application.GetEnvironmentList(Form1.Memo1.Lines);

this is result:
1-) AProcess.Environment result
LD_LIBRARY_PATH=/opt/proje_laz/projeler/shared/firebird/Embeded/test/fb_embed_linux64/
FIREBIRD=/opt/proje_laz/projeler/shared/firebird/Embeded/test/fb_embed_linux64/
KDE_FULL_SESSION=true
KDE_FULL_SESSION=true
GNOME_KEYRING_PID=1900
GS_LIB=/home/freeman/.fonts

................................
................................

2-)Application.GetEnvironmentList  result
KDE_FULL_SESSION=true
GNOME_KEYRING_PID=1900
GS_LIB=/home/freeman/.fonts


var AProcess: TProcess;
AProcess := TProcess.Create(Application);

AProcess is different class, is that synchronous with main application's EnvironmentList ? My test is say no. It's not work in same session. For test I made bash sript, I wrote in export bla bla then execute it with tprocess, but not added to application's EnvironmentList.

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

Reply via email to