[izpack-users] executable

Scott Plante splante at insightsys.com
Fri Oct 5 23:46:17 CEST 2007


Hi,
  This is a snippet I put at the top of my script:

########################################################################
# Run in a command window
if tty -s
then
  [ pause = "$1" ] &&
    { $0; ret=$?; echo "Press Enter to exit"; read ans; exit $ret; }
else
  xterm -e /bin/bash $0 pause
  exit $?
fi
########################################################################

It detects whether the script is being run from a terminal and if it
isn't, it runs itself within an xterm with a "pause" argument. If it ran
itself in an xterm, it pauses before returning so the user can see any
messages that were generated. If the user running the script was already
in a xterm (or konsole or other terminal) then it proceeds normally
without creating another window.

Scott

david alejandro garcia ortega wrote:
> Thanks Loïc , "xterm" is what i needed
>
> David Alejandro García Ortega
>
>
>     ------------------------------------------------------------------------
>     Date: Fri, 5 Oct 2007 19:56:21 +0200
>     From: lbndev at yahoo.fr
>     To: izpack-users at lists.berlios.de
>     Subject: Re: [izpack-users] executable
>
>
>     A few possibilities :
>
>         * Modify your scripts to redirect all output to log files
>         * Wrap your scripts into another that will run them in an
>           xterm of some kind.
>         * Run your scripts using the ProcessPanel instead of the
>           <executable> tag (direct inputs will not be possible, so
>           you'll have to use a UserInputPanel first to gather the
>           information, and then parse your script with the <parsable>
>           tag to replace the variables).
>
>     I would advise you to use the latter. It is a bit more
>     complicated, but it looks much cleaner to the end-user.
>
>     Good luck,
>
>     Loïc
>
>     david alejandro garcia ortega a écrit :
>
>
>          
>         Hi, i'am making an installer with izpack, i have a packet that
>         contains 2 executables, both are shell scripts for
>         unix. I need this scripts runs in terminal, when I test my
>         installer in Linux,the scripts don´t work because
>         run´s without terminal and i need a terminal to read/write
>         some information. What can i do for get mi script
>         runing in terminal?
>          
>         Here are my executables:
>          
>         <executable
>         targetfile="$INSTALL_PATH/utilidades/installjai32.sh"
>         keep="yes" stage="postinstall" />
>         <executable
>         targetfile="$INSTALL_PATH/utilidades/installjava3d32.sh"
>         keep="yes" stage="postinstall" />  
>          
>         Thanks.
>
>         David Alejandro García Ortega
>
>
>         ------------------------------------------------------------------------
>         Express yourself instantly with MSN Messenger! MSN Messenger
>         <http://clk.atdmt.com/AVE/go/onm00200471ave/direct/01/>
>
>         ------------------------------------------------------------------------
>
>         _______________________________________________
>         izpack-users mailing list
>         izpack-users at lists.berlios.de <mailto:izpack-users at lists.berlios.de>
>         https://lists.berlios.de/mailman/listinfo/izpack-users
>           
>
>
>
> ------------------------------------------------------------------------
> Express yourself instantly with MSN Messenger! MSN Messenger
> <http://clk.atdmt.com/AVE/go/onm00200471ave/direct/01/>
> ------------------------------------------------------------------------
>
> _______________________________________________
> izpack-users mailing list
> izpack-users at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/izpack-users
>   



More information about the izpack-users mailing list