views:

53

answers:

1

How can i include a license agreement interaction in a .deb file? The question http://stackoverflow.com/questions/668838/linux-support-for-click-thru-licenses only asks if its possible, but not how. Also, I'm not sure if http://stackoverflow.com/questions/1884753/license-info-of-a-deb-package is actually something one could use...

I know it's possible to include the text as part of the package description, but I'd much rather have it similar to a Windows MSI installer.

Note that I don't want to have the license pop up the first time the application runs.

I'm using dpkg-deb to generate the .deb file on Ubuntu 8.10.

+2  A: 

Put the question in the preinst script for your package, and if they answer incorrectly (or don't answer), exit the script with an error code and the package won't be installed.

The typical way to ask the user questions during package installation is with debconf. There are alternatives to debconf, including just using the bash read builtin. Debconf just makes it easy for you. There's a tutorial at http://www.fifi.org/doc/debconf-doc/tutorial.html

Eric Warmenhoven
I suppose there's no way to do this GUI wise? (I'll gladly accept your reply as the answer, regardless.) preinst script it is...
Fredrik Ullner
debconf can be configured to use a variety of UIs, including a graphical one. But that configuration is done by the system administrator independently of any package, so you can't control that if you use debconf. But I think debconf provides a better user experience because it lets the user control how they see questions.
Eric Warmenhoven