/****************************** Module Header ******************************* * * Module Name: usertree.cmd * * Helper batch for to create all directories of the personal subdirectory * tree. (A WarpIN package cannot include empty directories.) * * Additionally, it creates shadow objects for the user and the root folder * and also applies help panels to make F1 show help for objects. * * This program is intended to be called only by POSTWPI2.CMD during NEPMD * installation or by RECROBJ.CMD. * * Copyright (c) Netlabs EPM Distribution Project 2002 * * $Id$ * * =========================================================================== * * This file is part of the Netlabs EPM Distribution package and is free * software. You can redistribute it and/or modify it under the terms of the * GNU General Public License as published by the Free Software * Foundation, in version 2 as it comes in the "COPYING" file of the * Netlabs EPM Distribution. This library is distributed in the hope that it * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * ****************************************************************************/ /* ############## Maintainer: modify directory list here ######################## */ UserDirList = 'bar bin bmp dll ex hilite macros ndx autolink spellchk epmkwds' /* epmkwds is added for supporting epmkwds.* files and remains usually empty. */ /* Additionally, the UserDir is created by this script. */ /* ################################################################################# */ IF ADDRESS() <> 'EPM' THEN '@ECHO OFF' /* ----------------- Standard CMD initialization follows ----------------- */ SIGNAL ON HALT NAME Halt SIGNAL ON NOVALUE NAME RexxError SIGNAL ON SYNTAX NAME RexxError SIGNAL ON FAILURE NAME RexxError env = 'OS2ENVIRONMENT' TRUE = (1 = 1) FALSE = (0 = 1) CrLf = '0d0a'x Redirection = '>NUL 2>&1' PARSE SOURCE . . ThisFile GlobalVars = 'env TRUE FALSE Redirection ERROR. ThisFile' /* Some OS/2 Error codes */ ERROR.NO_ERROR = 0 ERROR.INVALID_FUNCTION = 1 ERROR.FILE_NOT_FOUND = 2 ERROR.PATH_NOT_FOUND = 3 ERROR.ACCESS_DENIED = 5 ERROR.NOT_ENOUGH_MEMORY = 8 ERROR.INVALID_FORMAT = 11 ERROR.INVALID_DATA = 13 ERROR.NO_MORE_FILES = 18 ERROR.WRITE_FAULT = 29 ERROR.READ_FAULT = 30 ERROR.SHARING_VIOLATION = 32 ERROR.GEN_FAILURE = 31 ERROR.INVALID_PARAMETER = 87 ERROR.ENVVAR_NOT_FOUND = 204 rc = ERROR.NO_ERROR CALL RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs' CALL SysLoadFuncs /* ----------------- Standard CMD initialization ends -------------------- */ /* ------------- Configuration ---------------- */ ErrorQueueName = VALUE( 'NEPMD_RXQUEUE',, env) ErrorMessage = '' /* Some INI app names and keys of NEPMD project from OS2.INI, defined in nepmd.h */ NEPMD_INI_KEYNAME_ROOTDIR = "RootDir" NEPMD_INI_KEYNAME_LANGUAGE = "Language" NEPMD_INI_KEYNAME_USERDIR = "UserDir" FolderId = '' ObjectIdStart = ' '' THEN CALL SayErrorText EXIT( rc) /* ----------------------------------------------------------------------- */ SayErrorText: PROCEDURE EXPOSE (GlobalVars) SELECT WHEN (ErrorMessage = '') THEN NOP /* Called by frame program: insert error */ /* message into private queue */ WHEN (ErrorQueueName <> '') THEN DO rcx = RXQUEUE( 'SET', ErrorQueueName) PUSH ErrorMessage END /* Called directly */ OTHERWISE DO SAY ErrorMessage 'PAUSE' END END RETURN( '') /* ----------------------------------------------------------------------- */ Halt: ErrorMessage = 'Interrupted by user.' CALL SayErrorText EXIT( 99) /* ----------------------------------------------------------------------- */ /* Give a standard REXX error message. */ /* This is for REXX error conditions only. */ /* System error codes and REXX error codes are different. */ RexxError: /* SIGL must be saved to not get overwritten later. */ ErrorLine = SIGL /* As an extension to the standard REXX error messages, */ /* the error condition will be appended to the error text. */ ConditionText = 'Condition: 'CONDITION( 'C') ConditionDescription = CONDITION( 'D') IF ConditionDescription <> '' THEN ConditionText = ConditionText', Reason: 'ConditionDescription ErrText = '' IF SYMBOL( 'rc') = 'VAR' THEN DO IF rc > 0 & rc < 100 THEN ErrText = ERRORTEXT( rc) END IF ErrText = '' THEN ErrText = ConditionText ELSE ErrText = ErrText', 'ConditionText /* Ensure that rc is set and that rc <> 0 is returned */ IF SYMBOL( 'rc') = 'VAR' THEN DO IF \( rc > 0 & rc < 100) THEN rc = 999 END ELSE rc = 999 ErrorMessage = '' IF ErrorLine > 0 THEN ErrorMessage = RIGHT( ErrorLine, 6)' +++ 'SOURCELINE( ErrorLine) IF ErrorMessage <> '' THEN ErrorMessage = ErrorMessage''CrLf ErrorMessage = ErrorMessage ||, 'REX'RIGHT( rc, 4, 0)': Error 'rc' running 'ThisFile', line 'ErrorLine': 'ErrText CALL SayErrorText EXIT( rc)