6

How can i include a license agreement interaction in a .deb file? The question Linux support for click-thru licenses only asks if its possible, but not how. Also, I'm not sure if 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.

Community
  • 1
  • 1
Fredrik Ullner
  • 2,106
  • 2
  • 22
  • 28
  • Similar solution i am looking for RPM http://stackoverflow.com/questions/2132828/adding-license-agreement-in-rpm-package – Adil Feb 18 '10 at 17:16

1 Answers1

7

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
  • 2,942
  • 20
  • 17
  • 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 Feb 19 '10 at 21:53
  • 2
    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 Feb 19 '10 at 22:13
  • This can work, however there are a few things to be aware of. Demanding user input is a Debian Policy violation, so you might want to consider debconf. Debconf won't demand input, it can be run in a headless mode so it doesn't ask for input. If you fail install, you must test that the package can easily be removed without having to complete the install, otherwise you can completely confuse dpkg and nothing will install/remove – AntonPiatek May 27 '14 at 11:39