home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / netdor3.zip / DISK_13 / IMAGE12.ZIP / CATALOG / PMCAMERA.CMD < prev    next >
OS/2 REXX Batch file  |  1993-08-23  |  4KB  |  118 lines

  1. /*****************************************************************************
  2.  *                       COREADD backend for pmcamera                        *
  3.  *                     CORE Development (CORE at WATSON)                     *
  4.  *****************************************************************************
  5.  *                    Licensed Materials-Property of IBM                     *
  6.  *               5604-472 (c) Copyright IBM Corporation, 1993                *
  7.  *                           All rights reserved.                            *
  8.  *                  US Government Users Restricted Rights -                  *
  9.  *                 Use, duplication or disclosure restricted                 *
  10.  *                by GSA ADP Schedule Contract with IBM Corp.                *
  11.  ****************************************************************************/
  12. trace 'O'
  13. signal on syntax
  14. signal on novalue
  15. call on halt
  16. call rxfuncadd 'CADDINIT', 'RXCADD', 'CADDINIT'
  17. Ver = 'CAddInit'()
  18. if abbrev(Ver, 'ERROR:')
  19.   then exit 200
  20. Title = RxCAdd.STitle 'Installation'
  21. XCode = 0
  22. select
  23.   when RxCAdd.OpType = 'ADD'
  24.     then do
  25.       call rxfuncadd 'RXCOUINFO', 'COUENV', 'RXCOUINFO'
  26.       CDr = RxCouInfo('GET', 'REMOTE')
  27.       CDr = strip(CDr, 'T', '\')||'\'
  28.       if RxOs2Ver() < 2.00
  29.         then do
  30.            call 'MessageBox' Title, 'PMCAMERA will only work on OS/2 2.0 or higher'
  31.            XCode = 1
  32.         end  /* Do */
  33.         else RxCAdd.ProgInfo.4 = 'EXE='CDr'PMCAMERA.EXE'
  34.     end
  35.   when RxCAdd.OpType = 'REMOVE'
  36.     then do
  37.       nop
  38.     end
  39.   otherwise do
  40.     call 'MessageBox' Title, 'Unexpected operation type "'RxCAdd.OpType'"'
  41.     XCode = 201
  42.   end
  43. end
  44. call AddExit XCode
  45.  
  46. RunItl: procedure expose RXCADD.
  47. parse arg ItlName
  48. CDr = value('CORE.DIR',,'OS2ENVIRONMENT')
  49. List = 'VERSION STITLE OPTYPE PREVIOUS'
  50. do I = 1 to words(List)
  51.   Name = 'RXCADD.'word(List, I)
  52.   call value Name, value(Name), 'OS2ENVIRONMENT'
  53. end I
  54. do I = 1 to RXCADD.PROGINFO.0
  55.   call value 'RXCADD.PROGINFO.'I, RXCADD.PROGINFO.I, 'OS2ENVIRONMENT'
  56. end I
  57. if pos('\', ItlName) = 0
  58.   then do
  59.     parse source . . Me
  60.     ItlName = left(Me, lastpos('\', Me))||ItlName
  61.   end
  62. '@CALL' CDr'IMPIT.CMD /R:'ItlName '/NOPAUSE'
  63. return rc
  64.  
  65. AddExit:
  66. parse arg XCode, Msg
  67. if XCode = ''
  68.   then XCode = 0
  69. if Msg <> ''
  70.   then call 'MessageBox' Title, Msg
  71. call 'CAddComplete' XCode
  72. call 'CAddExit'
  73. exit XCode
  74.  
  75. /***********************************************************************
  76.  *                             ERROR TRAPS                             *
  77.  ***********************************************************************/
  78. BugInit:
  79. signal off error; signal off failure; signal off halt
  80. signal off novalue; signal off notready; signal off syntax
  81. parse upper source . . Me
  82. if symbol('TITLE') = 'LIT'
  83.   then Title = 'COREADD Failure'
  84. Me = Me':'||'0A'x
  85. if symbol('GLOBALS') = 'LIT'
  86.   then do
  87.     Globals = 'TrVal'
  88.     TrVal = 'O'
  89.   end
  90. return
  91.  
  92. Halt:
  93. Where = SigL
  94. call BugInit
  95. call 'MessageBox' Title, Me||'Execution halted by user in line' Where
  96. XXC = 204
  97. signal DebugExit
  98.  
  99. Syntax:
  100. Where = SigL
  101. call BugInit
  102. call 'MessageBox' Title,,
  103.     Me||'Syntax error' rc '('errortext(rc)') in line' Where'.'
  104. XXC = 203
  105. signal DebugExit
  106.  
  107. Novalue:
  108. Where = SigL
  109. call BugInit
  110. call 'MessageBox' Title, Me||'NOVALUE error ('condition('D')') in line' Where'.'
  111. XXC = 203
  112. signal DebugExit
  113.  
  114. DebugExit:
  115. call 'CAddComplete' XXC
  116. call 'CAddExit'
  117. exit XXC
  118.