[patch] Terminal spawing

Gerry JJ trick at icculus.org
Wed Sep 26 01:25:30 EDT 2007

Hello.  Currently MojoSetup just silently fails in the event that all
GUI plugins (except stdio) fails, and there's no stdio available.
The attached patch changes this so that if all GUI plugins fail,
MojoSetup will attempt to launch a terminal, and then relaunch itself
inside that terminal.  It seems to work.

A new command-line argument and environment variable is added to
disable this behaviour: -notermspawn and MOJOSETUP_NOTERMSPAWN.

The patch also includes a fix for a segfault when not using an archive
for the files (the fileio.c part).

Possible issues:

* This changes the stdio plugin to fail if stdin and stdout are not
 connected to a tty unless terminal spawning is disabled, which
 obviously means that automated runs of the installer with piped
 input/output probably won't work anymore unless the -notermspawn
 argument is passed.

* The list of terminals to try is hard-coded (mostly yanked from
 MakeSelf).  Probably needs tweaking, and it'd be better to try to
 get the system default if possible anyway.  (xdg?)

* Don't know how portable execvp is..

* A compile-time option to enable/disable this might be nice.

- Gerry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: spawnterm.patch
Type: text/x-patch
Size: 4420 bytes
Desc: not available
URL: <http://icculus.org/pipermail/mojosetup/attachments/20070926/44fe98e3/attachment.bin>

More information about the mojosetup mailing list