UPDD version 5.1 for Linux supports an extensible scripting framework to support the installation of software on a range of target distributions.

The requirements for installing and running the software vary widely as many distributions implement alternate strategies for launching programs.

 

This framework is implemented to achieve two aims.

 

1)      To provide an off the shelf solution for installing the UPDD software on a range of Linux distributions.

2)      To allow an OEM to customise the installer package to install on currently unsupported distributions.

 

The intention is to facilitate an easy to use GUI based installer for end users. Integrators of embedded systems for example may prefer to use a manual installation approach to support unusual environments.

 

The framework compromises a number of perl scripts with the suffix xxns.

These are divided into two categories.

 

Detection scripts.

 

Detection scripts identify a given distribution or distribution family.

The updd installer executes each such script to determine if it matches the active distribution and if so proceeds to install as appropriate.

After a match is found no further scripts are executed.

 

Detection scripts have a name in the form

 

NNN_<info>_updddetect.xxns.

 

NNN is a 3 digit number, normally 500. UPDD executes the scripts in alphabetic order so if necessary the implementor of sucha script can choose a different number to determine the sequence of the execution of the script.

<info> is any appropriate descriptive test. Note that this is only to identify the script, the script itself will give a user friendly description.

 

The detection script can be called with any of 3 arguments and it must take the following actions.

 

Argument: “announce”

Action: Print a user friendly description of the distribution or distribution family this script supports.

 

Argument: “identify”

Action: Test to determine if the running distribution is that supported by the script. If so exit with code 1, otherwise exit with code 0.;

 

Argument: “install”

Action: Call the required install scripts to perform the required actions.

 

The following is an example of such a script

 

500_debian_wheezy_updddetect.xxns

 

#!/usr/bin/perl

 

use strict;

 

my $argc = @ARGV;

 

die "missing parameter" unless $argc > 0;

 

if(@ARGV[0] eq "announce")

{

  print "Debian 7 (Wheezy)\n";

}

 

if(@ARGV[0] eq "identify")

{

  my @test = grep { /Debian GNU\/Linux wheezy/ } `cat /etc/*-release`;

  my $res = @test;

  if($res)

  {

    exit 1;

  }

  else

  {

    exit 0;

  }

}

 

if(@ARGV[0] eq "install")

{

  system("perl rc_local_action.xxns"); # configure /etc/rc.local to autorun the startupdd script

  system("perl std_desktop_icons_action.xxns"); # add icons to desktop

  system("perl configure_qt4_action.xxns"); # create symbolic links to Qt 4 libs for install and runtime 

 }

 

 

Installation action scripts.

 

Installation action scripts perform the actual installation actions. The intention is to split these actions into functional units to allow reuse between distributions and thus simplify the individual scripts. It is of course possible to code these functions in the “install” section of the detection script, but this approach is not recommended.

Scripts in the mater updd package must follow this approach so if you wish to provide scripts for inclusion in this package please follow this approach.

 

Installation action scripts can have any name (so long as it does not end updddetect.xxns); but the suggested naming is <info>_action.xxns

 

Extending the UPDD package

 

The updd installer is supplied as a tgz package. Additional scripts can be added to this package simply by extracting and re packaging.

 

Eg

cd ~

mkdir tmp

cd tmp

 

tar –xzvf <package name>

 

add files in ~/tmp/opt/tbupddlx

 

tar –czvf <package name> .

 

Including files in the UPDD master installer.

 

If you would like Touch-Base to include files for an unsupported distribution, or suggest changes to existing scripts, please email your scripts and a brief description of the changes. Please ensure the coding and naming guidelines above are followed.