#!/bin/ksh
# IBM_PROLOG_BEGIN_TAG 
# This is an automatically generated prolog. 
#  
# cde720 src/cde/cde1/dtsession/helpnewuser 1.1 
#  
# Licensed Materials - Property of IBM 
#  
# Restricted Materials of IBM 
#  
# COPYRIGHT International Business Machines Corp. 1996 
# All Rights Reserved 
#  
# US Government Users Restricted Rights - Use, duplication or 
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp. 
#  
# IBM_PROLOG_END_TAG 

# -----------------------------------------------------------------
#
#  Name:     helpnewuser
#
#  Purpose:  Determines which help volume should be launched the 
#            1st time a new user logs into the desktop.  Then 
#            actually launches the help volume.
#
#            Basically, we try to get Intromgr.sdl 1st, but if 
#            if it's not available, we use Help4Help.sdl.
#
#  Help volume precedence (in declining order) is defined to be:
#      /usr/dt/appconfig/help/$LANG/Intromgr.sdl
#      /usr/dt/appconfig/help/C/Intromgr.sdl
#      /usr/dt/appconfig/help/$LANG/Help4Help.sdl
#      /usr/dt/appconfig/help/C/Help4Help.sdl
#      Intromgr.sdl
#
#  NOTE:  en_US and En_US values for $LANG map to C.
#      Also, we default to (pathless) Intromgr.sdl in the 
#      event no help volume is found so that the error dialog 
#      will tell what help volume should be installed.
#
# -----------------------------------------------------------------

# ------------------------------------------------------------
#  Determine the target path that should contain the help 
#  volume if it is installed.
# ------------------------------------------------------------

DTHELPVIEW=/usr/dt/bin/dthelpview
HVPATH=/usr/dt/appconfig/help
LAUNCH_VOL=Intromgr.sdl

if [ $LANG = "C" -o $LANG = "en_US" -o $LANG = "En_US" ]; then
  TARGET_PATH=$HVPATH/C               
else
  TARGET_PATH=$HVPATH/$LANG          
fi


# ------------------------------------------------------------
#  Determine the most desirable help volume that is 
#  installed.
# ------------------------------------------------------------

if   [ -f $TARGET_PATH/Intromgr.sdl ]; then
   LAUNCH_VOL=$TARGET_PATH/Intromgr.sdl

elif [ -f $HVPATH/C/Intromgr.sdl ]; then
   LAUNCH_VOL=$HVPATH/C/Intromgr.sdl

elif [ -f $TARGET_PATH/Help4Help.sdl ]; then
   LAUNCH_VOL=$TARGET_PATH/Help4Help.sdl

elif [ -f $HVPATH/C/Help4Help.sdl ]; then
   LAUNCH_VOL=$HVPATH/C/Help4Help.sdl
fi

# ------------------------------------------------------------
#  Launch the helpviewer to display the $LAUNCH_VOL
# ------------------------------------------------------------

$DTHELPVIEW -h $LAUNCH_VOL

exit $?