home *** CD-ROM | disk | FTP | other *** search
/ The Developer Connection…ice Driver Kit for OS/2 3 / DEV3-D1.ISO / devtools / drdialog / install.cmd < prev    next >
Encoding:
Text File  |  1994-02-14  |  3.4 KB  |  89 lines

  1. /* (c) Copyright IBM Corporation 1993 */
  2.  
  3. /* Install DrDialog's Workplace Shell objects */
  4. CALL RxFuncAdd "SysLoadFuncs", "RexxUtil", "SysLoadFuncs"
  5. Call SysLoadFuncs
  6. dir = Directory()
  7.  
  8. /* Remove old associations, if any */
  9. Call SysIni 'USER', 'PMWP_ASSOC_TYPE', 'DrDialog.RES', 'DELETE:'
  10. Call SysIni 'USER', 'PMWP_ASSOC_TYPE', 'DrRexx.RES',   'DELETE:'
  11.  
  12. /* Create the 'DrDialog' folder (if necessary): */
  13. msg = "create the DrDialog folder"
  14. rc  = SysCreateObject( "WPFolder", "DrDialog", "<WP_DESKTOP>", "OBJECTID=<DRDIALOG>;", "U" )
  15. If \rc Then rc = SysCreateObject( "WPFolder", "DrDialog", "<WP_DESKTOP>", "OBJECTID=<DRDIALOG>;", "R" )
  16. If \rc Then Call FAILED
  17.  
  18. msg = "find DrRexx.EXE"
  19. rc  = SysFileTree( "DRREXX.EXE", "FILE", "FO" )
  20. IF rc \= 0 THEN Signal ABORT
  21. msg = "create DrRexx program object"
  22. rc  = SysCreateObject( "WPProgram", "DrRexx", "<DRDIALOG>", "PROGTYPE=PM;EXENAME="file.1";ASSOCTYPE=DrRexx.RES;STARTUPDIR="dir";", "R" )
  23. If \rc Then Call FAILED
  24.  
  25. /* Create program objects: */
  26. objects = "REStoPGM REStoEXE REStoRXX REView REVise RexxLib DrsAide"
  27. rc = SysFileTree( "DREXAM.RAM", "TEMP", "FO" )
  28. IF temp.0 = 1 THEN objects = objects "DrExam"
  29. DO i = 1 TO words( objects )
  30.    CALL MakeProgramObject word( objects, i )
  31. END
  32.  
  33. /* Create shadows of any necessary data files and directories: */
  34. objects = "SAMPLE DrDialog.RES DrRexx.RES DrsAideT.RES DrsAide.RXL"
  35. DO i = 1 TO words( objects )
  36.    CALL MakeShadowObject word( objects, i )
  37. END
  38.  
  39. msg = "find DrDialog.EXE"
  40. rc  = SysFileTree( "DRDIALOG.EXE", "FILE", "FO" )
  41. IF rc \= 0 THEN Signal ABORT
  42. msg = "create DrDialog program object"
  43. rc  = SysCreateObject( "WPProgram", "DrDialog", "<DRDIALOG>", "PROGTYPE=PM;EXENAME="file.1";ASSOCTYPE=DrDialog.RES,DrRexx.RES;STARTUPDIR="dir";", "R" )
  44. If \rc Then Call FAILED
  45.  
  46. msg  = "find OS/2 system VIEW.EXE program"
  47. view = SysSearchPath( "PATH", "VIEW.EXE" )
  48. IF view = "" THEN Signal ABORT
  49. msg = "find DrDialog on-line reference file"
  50. rc  = SysFileTree( "DRDIALOG.INF", "FILE", "FO" )
  51. IF rc \= 0 THEN Signal ABORT
  52. msg = "create on-line reference object"
  53. rc = SysCreateObject( "WPProgram", "DrDialog reference", "<DRDIALOG>", "PROGTYPE=PM;EXENAME="view";PARAMETERS="file.1";", "R"  )
  54. If \rc Then Call FAILED
  55.  
  56. /* Now make sure that the templates have the correct "Type" EA: */
  57. /* Set the "TEMPLATE=" setup option */
  58. Call SysSetObjectData dir'\DRDIALOG.RES', 'TEMPLATE=YES;'
  59. Call SysSetObjectData dir'\DRREXX.RES',   'TEMPLATE=YES;'
  60. Call SysSetObjectData dir'\DRSAIDET.RES', 'TEMPLATE=YES;'
  61. Call SysPutEA 'DRREXX.RES', ".TYPE", 'DFFF00000100FDFF'x||D2C(Length('DrRexx.RES'))||'00'x||'DrRexx.RES'
  62. Call SysPutEA 'DRDIALOG.RES', ".TYPE", 'DFFF00000100FDFF'x||D2C(Length('DrDialog.RES'))||'00'x||'DrDialog.RES'
  63.  
  64. SAY "DrDialog installation complete..."
  65. SAY "You may now open the 'DrDialog' folder on your desktop"
  66. EXIT
  67.  
  68. FAILED:
  69.   SAY "Failed trying to" msg
  70.   RETURN
  71.  
  72. ABORT:
  73.   SAY "Failed trying to" msg
  74.   EXIT 100
  75.  
  76. MakeProgramObject:
  77.   PARSE ARG object
  78.   msg = "create" object "program object"
  79.   rc  = SysCreateObject( "WPProgram", object, "<DRDIALOG>", "PROGTYPE=PM;EXENAME="file.1";STARTUPDIR="dir";PARAMETERS="dir"\"object "%*", "R" )
  80.   If \rc Then Call FAILED
  81.   RETURN
  82.  
  83. MakeShadowObject:
  84.   PARSE ARG object
  85.   msg = "create shadow of" object
  86.   rc  = SysCreateObject( "WPShadow", object, "<DRDIALOG>", "SHADOWID="dir"\"object";", "R" )
  87.   If \rc Then Call FAILED
  88.   RETURN
  89.