views:

35

answers:

3

Is there a commonly used approach for displaying 'how to get started' instructions to a user after a .deb installer has finished installing a package?

I need an approach that works for users working via a terminal as well as from a desktop environment.

Server admins will probably know to check for a README file but many others won't.

+1  A: 

I'd suggest running the "tty" command from your postinstall script. That will tell you if you have a tty and are running as a terminal program. Once you know that you could either "more" a readme file if you're running in terminal mode or you could call "gnome-text-editor" if not. You might also want to put in some detection to check "/etc/lsb-release" so that you know what distribution your .deb is being installed on and which editors will be suitable.

Benj
Thanks, but I just checked the output of the tty command when running my package from the command line, and also by launching the installer from the desktop, and in both cases tty outputs /dev/pts/<some_number>.
codebox_rob
A: 

I use the tty command like Benj suggested, but I use the dialog command to display post install chatter if its available on the system.

Try this command:

dialog --backtitle "All done" --title "Installation complete" --textbox /etc/passwd 0 0

... but replace /etc/passwd with your README of choice. Its a much nicer way to scroll through information.

Tim Post
A: 

After a bit of experimentation it looks like I can detect how the .deb package has been installed by checking the value of the DEBIAN_FRONTEND variable in the postint.sh script. When run from the desktop it contains the value 'gnome', but when run via dpkg from the command-line it isn't set, so something like this might work:

HELP_URL="http://mysite.com/help.html"
if [ "$DEBIAN_FRONTEND" = "gnome" ]; then
    nohup gnome-www-browser $HELP_URL &
else 
    echo For help visit $HELP_URL
fi
codebox_rob