Salome HOME
a32f015617daa9bf86a92c1e8146d75c5548fc20
[tools/install.git] / config_files / release_notes.sh
1 #!/bin/bash -noprofile
2
3 ####################################################################################
4 #  File      : release_notes.sh
5 #  Created   : Tue Oct 30 11:11:23 2006
6 #  Author    : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
7 #  Project   : SALOME
8 #  Module    : Installation Wizard
9 #  Copyright : 2002-2006 CEA
10 #
11 #  This script is the part of the SALOME installation procedure.
12 #
13 ####################################################################################
14
15 # This procedure checks if the Release Notes file can be shown.
16 # Returns 0 in success and 1 if any error occurs.
17 check_enabled()
18 {
19     ROOT_DIR=`(cd ${SRC_DIR}\.. ; pwd)`;
20     if [ "${ROOT_DIR}" != "" ] ; then 
21         rn_files=`find ${ROOT_DIR} -name "*Release_Notes.pdf"`
22         if [ "$?" == "0" ] && [ "$rn_files" != "" ] ; then
23             return 0;
24         fi
25     fi
26     return 1;
27 }
28
29 # This procedure is used to show Release Notes file.
30 # Returns 0 in success and 1 if any error occurs.
31 execute()
32 {
33     ROOT_DIR=`(cd ${SRC_DIR}\.. ; pwd)`;
34     if [ "${ROOT_DIR}" != "" ] ; then 
35         rn_file=`find ${ROOT_DIR} -name "*Release_Notes.pdf"`
36         if [ "$?" == "0" ] && [ "$rn_file" != "" ] ; then
37             xpdf=`which xpdf >& /dev/null`
38             if [ "$?" == "0" ] ; then
39                 xpdf ${rn_file} &
40                 return 0;
41             fi
42         fi
43     fi
44     return 1;
45 }
46
47 # Set general usage variables from the command line parameters:
48 #     $0 is the path to this script itself
49 #     $1 is the name of the procedure to be run
50 #     $2 is the installation directory path
51 #     $3 is the temporary directory path
52 SCRIPT_DIR=`dirname $0`
53 PROCEDURE=$1;
54 INSTALL_ROOT=$2;
55 INSTALL_WORK=$3;
56
57 # Run the procedure
58 $PROCEDURE