Recent

Author Topic: how to pass environment along to external program  (Read 4456 times)

new2linux

  • Jr. Member
  • **
  • Posts: 60
how to pass environment along to external program
« on: September 02, 2014, 09:17:45 pm »
I am using makeself (self-extractor) to distribute my program. Now I want to do updates, so I have the program download a makeself package and then execute it. But this doesn't work as expected. The package executed from the commandline does work.

makeself apparently uses the shell environment to decide what is available to it. Free Pascal doesn't pass environment info along with methods from:

http://wiki.freepascal.org/Executing_External_Programs

I also tried:

http://forum.lazarus.freepascal.org/index.php?topic=14110.0

which executes the program via the shell ("sh -c" and a string that specifies the target).

Is there any way to pass the environment along? If not I would have to grep makeself for all vars it accesses and pass them along :(



« Last Edit: September 02, 2014, 09:26:20 pm by new2linux »


new2linux

  • Jr. Member
  • **
  • Posts: 60
Re: how to pass environment along to external program
« Reply #2 on: September 04, 2014, 08:08:44 pm »
For those working with makeself: the makeself generated executable accepts a --nox11 ("No X11") parameter. With this parameter the problem goes away. At least that's my conclusion so far.

So I no longer need to pass the environment.

Makes me wonder why it was needed in the first place...



 

TinyPortal © 2005-2018