home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1997 October / PCO1097.ISO / FilesBBS / OS2 / 4OS2300.ARJ / 4OS2300.ZIP / JPOS2INS.CMD < prev    next >
Encoding:
Text File  |  1997-07-24  |  19.7 KB  |  740 lines

  1. /* JPOS2INS.CMD
  2.    24-Jul-97
  3.  
  4.       Creates/removes Desktop objects and modifies CONFIG.SYS for
  5.        JP Software's "4DOS", "4OS2", and "Take Command for OS/2"
  6.  
  7.          Copyright 1997, JP Software Inc., All Rights Reserved.
  8.    
  9. Parameters:
  10. "4DOS" "directory" "CreateFolder"
  11.        "directory" "RemoveFolder"
  12.  
  13. "4OS2" "directory" "UpdatePaths" "config.in" "config.out" "file.log" "cmd.new"
  14.        "directory" "RestorePaths" "config.in" "config.out" "shell.old" "spec.old"
  15.        "directory" "UpdateINI" "ini.in" "ini.out"
  16.        "directory" "CreateFolder"
  17.        "directory" "RemoveFolder"
  18.     
  19. "TCMD" "directory" "UpdatePaths" "config.in" "config.out"
  20.        "directory" "RestorePaths" "config.in" "config.out"
  21.        "directory" "UpdateINI" "ini.in" "ini.out"
  22.        "directory" "CreateFolder"
  23.        "directory" "RemoveFolder"
  24.  
  25. Notes: 
  26. 1) All file names must be fully qualified
  27. 2) Parameters are not checked for validity
  28. 3) Double quote is REQUIRED between parameters as shown above
  29.  
  30.  
  31. */
  32.  
  33. CALL RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs';
  34. CALL SysLoadFuncs;
  35.  
  36. container  = '<WP_DESKTOP>'
  37. jpFolder = '<WP_JP_CMDPRMPT>'
  38. os2ExeId = '<WP_JP_4OS2_EXE>'
  39. os2HelpId = '<WP_JP_4OS2_HELP>'
  40. dosExeId = '<WP_JP_4DOS_EXE>'
  41. dosHelpId = '<WP_JP_4DOS_HELP>'
  42. tcmdExeId = '<WP_JP_TCMDOS2_EXE>'
  43. tcmdHelpId = '<WP_JP_TCMDOS2_HELP>'
  44.  
  45. /*
  46.  ****************************************************************************
  47.  ** MAIN
  48.  ****************************************************************************
  49. */
  50. /* Want case sensitive arguments for HPFS directory names */
  51. PARSE ARG '"' product '"' '"' comDir '"' '"' command '"' '"' parm1 '"' '"' parm2 '"' '"' parm3 '"' '"' parm4 '"' 
  52.  
  53. /* Shift case of command and platform */
  54. PARSE UPPER VALUE command WITH command
  55. PARSE UPPER VALUE product WITH product
  56.  
  57. /* Remove '\' from end of directory if it exists */
  58. comDir = STRIP(comDir)
  59. IF (RIGHT(comDir,1) == '\') THEN
  60.   comDir = LEFT(comDir, LENGTH(comDir) - 1)
  61.  
  62. mainRC = 1
  63.  
  64. IF product == '4DOS' THEN DO
  65.   productName = '4DOS'
  66.   IF command == 'CREATEFOLDER' THEN DO
  67.     mainRC = CreateJPFolder()
  68.     container = jpFolder
  69.   
  70.     IF mainRC = 0 THEN
  71.       mainRC = Create4DOSObjects()
  72.  
  73.     SAY 'Press any key to continue ...'
  74.     SYSGETKEY(NOECHO)
  75.  
  76.   END
  77.   ELSE IF command == 'REMOVEFOLDER' THEN DO
  78.     mainRC = Remove4DOSObjects()
  79.     SAY 'Press any key to continue ...'
  80.     SYSGETKEY(NOECHO)
  81.   END
  82.   ELSE
  83.     CALL ArgError
  84. END  /* 4DOS */
  85.  
  86. ELSE IF product == '4OS2' THEN DO
  87.   productName = '4OS2'
  88.   IF command == 'UPDATEPATHS' THEN
  89.     mainRC = UpdatePaths()
  90.   ELSE IF command == 'RESTOREPATHS' THEN
  91.     mainRC = RestorePaths()
  92.   ELSE IF command == 'UPDATEINI' THEN
  93.     mainRC = UpdateINI()
  94.   ELSE IF command == 'CREATEFOLDER' THEN DO
  95.     mainRC = CreateJPFolder()
  96.     container = jpFolder
  97.   
  98.     IF mainRC = 0 THEN
  99.       mainRC = Create4OS2Objects()
  100.      
  101.   END
  102.   ELSE IF command == 'REMOVEFOLDER' THEN
  103.     mainRC = Remove4OS2Objects()
  104.   ELSE
  105.     CALL ArgError
  106. END  /* 4OS2 */
  107.  
  108. ELSE IF product == 'TCMD' THEN DO
  109.   productName = 'Take Command for OS/2'
  110.   IF command == 'UPDATEPATHS' THEN 
  111.     mainRC = UpdatePaths()
  112.   ELSE IF command == 'RESTOREPATHS' THEN 
  113.     mainRC = RestorePaths()
  114.   ELSE IF command == 'UPDATEINI' THEN
  115.     mainRC = UpdateINI()
  116.   ELSE IF command == 'CREATEFOLDER' THEN DO
  117.     mainRC = CreateJPFolder()
  118.     container = jpFolder
  119.   
  120.     IF mainRC = 0 THEN
  121.       mainRC = CreateTCMDObjects()
  122.      
  123.     /* Look for 4DOS and add to folder? */
  124.   
  125.   END
  126.   ELSE IF command == 'REMOVEFOLDER' THEN
  127.     mainRC = RemoveTCMDObjects()
  128.   ELSE
  129.     CALL ArgError
  130. END  /* TCMD */
  131. ELSE DO 
  132.   CALL ArgError
  133. END
  134.  
  135. EXIT mainRC
  136. /*
  137.  ****************************************************************************
  138.  ** END MAIN
  139.  ****************************************************************************
  140. */
  141.  
  142. UpdatePaths:
  143.  
  144.   SAY ''
  145.   CALL CHAROUT ,'Adding ' || productName || ' directory to CONFIG.SYS paths'
  146.   IF product == '4OS2' THEN DO
  147.     CALL LINEOUT ,' and'
  148.     CALL CHAROUT ,'adding ' || productName || ' executable to OS2_SHELL ' ||,
  149.                    'and COMSPEC variables'
  150.   END
  151.   
  152.   configSys = parm1
  153.   configSysTemp = parm2
  154.   logFile = parm3
  155.   cmdFile = parm4
  156.  
  157.   PARSE UPPER VALUE comDir WITH comDirUp
  158.   holdDir = comDir || ';'
  159.   holdDirUp = comDirUp || ';'
  160.   
  161.   /* Flags */
  162.   libFound = 0
  163.   bookFound = 0
  164.   dFound = 0
  165.   shellFound = 0
  166.   specFound = 0
  167.  
  168.  
  169.   DO WHILE LINES(configSys) > 0
  170.     /* Read one line of file */
  171.     inputLine = LINEIN(configSys) 
  172.     
  173.     /* Get path key and info */
  174.     PARSE VALUE inputLine WITH envarKey '=' envarInfo     
  175.      PARSE UPPER VALUE envarKey WITH envarKey
  176.      PARSE UPPER VALUE envarInfo WITH envarInfoUp
  177.     
  178.     envarKey = STRIP(envarKey)
  179.     pathFound = 0
  180.     envarFound = 0
  181.     
  182.     /* Check to see if this is one of the lines we want to modify */
  183.     IF (envarKey == 'LIBPATH') THEN DO 
  184.       libFound = 1
  185.       pathFound = 1
  186.     END
  187.     IF (envarKey == 'SET BOOKSHELF') THEN DO
  188.       bookFound = 1
  189.       pathFound = 1
  190.     END
  191.     IF (envarKey == 'SET DPATH') THEN DO
  192.       dFound = 1
  193.       pathFound = 1
  194.     END
  195.  
  196.     IF product == '4OS2' THEN DO
  197.       IF (envarKey == 'SET OS2_SHELL') THEN DO 
  198.          currShell = envarInfo 
  199.         shellFound = 1
  200.         envarFound = 1
  201.       END
  202.       IF (envarKey == 'SET COMSPEC') THEN DO 
  203.          currSpec = envarInfo 
  204.         specFound = 1
  205.         envarFound = 1
  206.       END
  207.     END  /* IF 4OS2 */
  208.     
  209.  
  210.     /* Add our directory if it is not already in path */
  211.     IF ((pathFound = 1) & (POS(holdDirUp, envarInfoUp) = 0)) THEN DO     
  212.       /* Remove trailing spaces */
  213.       inputLine = STRIP(inputLine,'t')
  214.  
  215.       /* IF path does not end in ';' or '=', add ';' to end */
  216.       IF ((RIGHT(inputLine,1) \== ';') & (RIGHT(inputLine,1) \== '=')) THEN
  217.         inputLine = inputLine || ';'  
  218.  
  219.       /* Add our path to end */
  220.       inputLine = inputLine || holdDirUp
  221.  
  222.     END  /* pathFound */
  223.  
  224.     IF (envarFound = 1) THEN DO
  225.       /* Write our environment var instead */
  226.       inputLine = envarKey || '=' || cmdFile
  227.     END  /* envarFound */
  228.        
  229.     /* IF none of the keywords were found, inputLine is unchanged */
  230.     CALL LINEOUT configSysTemp,inputLine
  231.   
  232.   END  /* DO while LINES > 0 */
  233.  
  234.   
  235.   /* IF any paths not found */
  236.   IF ((libFound = 0) | (bookFound = 0) | (dFound = 0)) THEN DO
  237.     /* Add the path variables that we did not find in the file */
  238.     IF (libFound = 0) THEN
  239.       CALL LINEOUT configSysTemp,'LIBPATH=' || holdDirUp
  240.     IF (bookFound = 0) THEN
  241.       CALL LINEOUT configSysTemp,'SET BOOKSHELF=' || holdDirUp
  242.     IF (dFound = 0) THEN
  243.       CALL LINEOUT configSysTemp,'SET DPATH=' || holdDirUp
  244.   END  /* IF any paths not found */
  245.      
  246.   /* If 4OS2 install and either envar not found */
  247.   IF ((product == '4OS2') & ((shellFound = 0) | (specFound = 0))) THEN DO
  248.     /* Add the environment variables that we did not find in the file */
  249.     IF (shellFound = 0) THEN
  250.       CALL LINEOUT configSysTemp,'SET OS2_SHELL=' || cmdFile
  251.     IF (specFound = 0) THEN
  252.       CALL LINEOUT configSysTemp,'SET COMSPEC=' || cmdFile
  253.   END  /* If either envar not found */
  254.  
  255.   /* Close files */ 
  256.   CALL LINEOUT configSys
  257.   CALL LINEOUT configSysTemp
  258.  
  259.   /* Write current OS2_SHELL and COMSPEC to log only if they don't reference 
  260.       the same copy of 4OS2.EXE (eg. when someone runs install twice for the
  261.       the same version)
  262.  
  263.      Shareware installation has no logging; need to handle a null log file
  264.       name
  265.    */
  266.   IF (logfile \== '')  THEN DO
  267.     IF ((shellFound = 1) & (POS(comDirUp||'\4OS2.EXE', UCase(currShell)) = 0)) THEN DO     
  268.       CALL WriteLog logFile, 'OS2_SHELL', currShell 
  269.     END
  270.     IF ((specFound = 1) & (POS(comDirUp||'\4OS2.EXE', UCase(currShell)) = 0)) THEN DO     
  271.       CALL WriteLog logFile, 'COMSPEC', currSpec 
  272.     END
  273.   END
  274.   
  275.   CALL charout ,'... OK!'
  276.   SAY ''
  277.  
  278. RETURN 0
  279.  
  280.  
  281. /****************************************************************************/
  282. WriteLog:
  283.   
  284.   PARSE ARG logFileName , matchParm , valueParm 
  285.   PARSE UPPER VALUE matchParm WITH matchParm
  286.   
  287.   n = 0
  288.   itemFound = 0
  289.   dataArray. = '' 
  290.   
  291.   DO WHILE LINES(logFileName) > 0
  292.     /* Read one line of file */
  293.     inputData = LINEIN(logFileName) 
  294.     
  295.     /* Get key and info */
  296.     PARSE VALUE inputData WITH logKey '=' logInfo     
  297.      PARSE UPPER VALUE logKey WITH logKey
  298.     
  299.     logKey = STRIP(logKey)
  300.     
  301.     /* Check to see if this is the line we want to modify */
  302.     IF (logKey == matchParm) THEN DO 
  303.       /* Write our environment var instead */
  304.       inputData = logKey || '=' || valueParm
  305.       itemFound = 1
  306.     END  
  307.        
  308.     /* Store the line in the array
  309.        If none of the keywords were found, inputLine is unchanged 
  310.      */
  311.     dataArray.n = inputData
  312.     n = n + 1
  313.   
  314.   END  /* DO while LINES > 0 */
  315.   
  316.   /* Close file */ 
  317.   CALL LINEOUT logFileName
  318.   
  319.   /* If not found */
  320.   IF (itemFound = 0) THEN DO
  321.     /* Add item to end of file */
  322.     CALL LINEOUT logFileName, matchParm || '=' || valueParm
  323.   END
  324.   ELSE DO
  325.     /* Erase log file and rewrite */
  326.      nn = 0
  327.      IF (SysFileDelete(logFileName) = 0) THEN DO WHILE (nn < n)
  328.       CALL LINEOUT logFileName, dataArray.nn
  329.         nn = nn + 1
  330.      END
  331.      ELSE DO 
  332.        /* Error */
  333.       SAY 'ERROR: Could not modify the installation log file'
  334.     END  
  335.   END
  336.  
  337.   /* Close file */ 
  338.   CALL LINEOUT logFileName
  339.   
  340. RETURN 0
  341.  
  342.  
  343. /****************************************************************************/
  344. RestorePaths:
  345.  
  346.   SAY ''
  347.   CALL CHAROUT ,'Removing ' || productName || ' directory from ' ||,
  348.                 'CONFIG.SYS paths'
  349.   IF product == '4OS2' THEN DO
  350.     CALL LINEOUT ,' and'
  351.     CALL charout ,'removing ' || productName || ' from OS2_SHELL and ' ||,
  352.                   'COMSPEC variables'
  353.   END
  354.   
  355.   configSys = parm1
  356.   configSysTemp = parm2
  357.   shellLine = parm3
  358.   specLine = parm4
  359.   holdDir = comDir || ';'
  360.   
  361.   rcRestorePaths = 0
  362.   
  363.   IF product == '4OS2' THEN DO
  364.     /* Verify that the old OS2_SHELL and COMSPEC files exist */
  365.     PARSE VALUE shellLine WITH holdFile .
  366.     IF STREAM(STRIP(holdFile), C, QUERY EXISTS) \= '' THEN
  367.       shellFound = 1
  368.     ELSE
  369.       shellFound = 0
  370.  
  371.     PARSE VALUE specLine WITH holdFile .
  372.     IF STREAM(STRIP(holdFile), C, QUERY EXISTS) \= '' THEN
  373.       specFound = 1
  374.     ELSE
  375.       specFound = 0
  376.   END  /* If 4OS2 */
  377.  
  378.   PARSE UPPER VALUE holdDir WITH holdDirUp
  379.   
  380.   DO WHILE LINES(configSys) > 0
  381.     /* Read one line of file */
  382.     inputLine = LINEIN(configSys) 
  383.      
  384.     PARSE UPPER VALUE inputLine WITH inputLineUp
  385.   
  386.     /* Get path key and info */
  387.     PARSE VALUE inputLineUp WITH envarKey '=' envarInfo     
  388.     
  389.     envarKey = STRIP(envarKey)
  390.     
  391.     /* If this is one of the paths we want to modify */
  392.     IF (envarKey == 'LIBPATH') | ,
  393.        (envarKey == 'SET BOOKSHELF') | ,
  394.        (envarKey == 'SET DPATH') THEN DO
  395.       
  396.       /* Find our directory (case insensitive) */
  397.       envarPos = POS(holdDirUp, inputLineUp)
  398.       
  399.       IF (envarPos \= 0) THEN DO
  400.         inputLine = DELSTR(inputLine, envarPos, LENGTH(holdDirUp))
  401.       END  
  402.  
  403.     END  /* Path found */
  404.  
  405.     IF product == '4OS2' THEN DO
  406.       /* If we find an OS2_SHELL or COMSPEC line, replace it only if we know
  407.           that the old file exists, otherwise flag it as an error
  408.       */
  409.       IF (envarKey == 'SET OS2_SHELL') THEN DO
  410.         IF (shellFound = 1) THEN
  411.           inputLine = envarKey || '=' || shellLine
  412.         ELSE
  413.           rcRestorePaths = 1
  414.       END
  415.  
  416.       IF (envarKey == 'SET COMSPEC') THEN DO
  417.         IF (specFound = 1) THEN
  418.           inputLine = envarKey || '=' || specLine
  419.         ELSE
  420.           rcRestorePaths = 1
  421.       END
  422.     END  /* If 4OS2 */
  423.        
  424.     /* IF none of the keywords were found, inputLine is unchanged */
  425.     CALL LINEOUT configSysTemp, inputLine
  426.  
  427.   END  /* DO while LINES > 0 */
  428.   
  429.   /* Close files */ 
  430.   CALL LINEOUT configSys
  431.   CALL LINEOUT configSysTemp
  432.  
  433.   IF rcRestorePaths = 0 THEN
  434.     CALL charout ,'... OK!'
  435.   ELSE
  436.     CALL charout ,'... ERROR!'
  437.  
  438.   SAY ''
  439.  
  440. RETURN rcRestorePaths
  441.  
  442.  
  443. /****************************************************************************/
  444. UpdateINI:
  445.  
  446.   iniFile = parm1
  447.   iniFileTemp = parm2
  448.   
  449.   SAY ''
  450.   CALL CHAROUT ,'Updating ' || productName || ' directory in ' || iniFile
  451.   
  452.   /* Check to see if we have [4OS2] as first non-blank, non-comment line */
  453.   IF (product == '4OS2') THEN DO
  454.     searchDone = 0
  455.     foundSection = 0
  456.  
  457.     DO WHILE (LINES(iniFile) > 0) & (searchDone = 0)
  458.       inputLine = STRIP(LINEIN(iniFile))
  459.  
  460.       /* Read until we hit the first line to contain text other than a
  461.          comment
  462.       */
  463.       IF (inputLine \== '') & (LEFT(inputLine, 1) \== ';') THEN DO
  464.         searchDone = 1
  465.         PARSE UPPER VALUE inputLine WITH '[' sectionName ']'
  466.         IF (sectionName == '4OS2') THEN
  467.           foundSection = 1
  468.       END
  469.  
  470.     END  /* DO while LINES > 0 */
  471.  
  472.     /* If we did not find [4OS2], write it to the first line of output file */
  473.     IF foundSection = 0 THEN
  474.       CALL LINEOUT iniFileTemp, '[4OS2]'
  475.  
  476.     /* Close input file */
  477.     CALL LINEOUT iniFile
  478.   END  /* If 4OS2 */
  479.  
  480.  
  481.   DO WHILE LINES(iniFile) > 0
  482.     /* Read one line of file */
  483.     inputLine = LINEIN(iniFile) 
  484.      
  485.     /* Get path key and info */
  486.     PARSE UPPER VALUE inputLine WITH envarKey '=' envarInfo     
  487.     
  488.     envarKey = STRIP(envarKey)
  489.     
  490.     /* If this is one of the directives we want to modify */
  491.     IF (product == '4OS2') & (envarKey == '4STARTPATH') THEN
  492.       inputLine = '4StartPath=' || comDir
  493.     
  494.     IF (product == 'TCMD') & (envarKey == 'TCSTARTPATH') THEN
  495.       inputLine = 'TCStartPath=' || comDir
  496.     
  497.  
  498.     /* If none of the keywords were found, inputLine is unchanged */
  499.     CALL LINEOUT iniFileTemp, inputLine
  500.  
  501.   END  /* DO while LINES > 0 */
  502.   
  503.   /* Close files */ 
  504.   CALL LINEOUT iniFile
  505.   CALL LINEOUT iniFileTemp
  506.  
  507.   CALL charout ,'... OK!'
  508.   SAY ''
  509.  
  510. RETURN 0
  511.  
  512.  
  513. /****************************************************************************/
  514. CreateJPFolder:
  515.  
  516.   /* Create/update the JP command prompts folder */
  517.   classname = 'WPFolder'
  518.   objectname = 'JP Software'||'0d0A'x||'Command Processors'
  519.   msgtext = 'JP Software Command Processors folder'
  520.   location = container
  521.   setup = 'ICONFILE='||comDir||'\JPFOLDER.ICO;'||,
  522.           'ICONNFILE=1,'||comDir||'\JPOPNFLD.ICO;'||,
  523.           'OBJECTID='jpFolder||';'
  524.   CALL DOCreateObject
  525. RETURN RESULT
  526.  
  527.  
  528. /****************************************************************************/
  529. Create4DOSObjects:
  530.  
  531.   /* Create/update the main executable */
  532.   classname = 'WPProgram'
  533.   objectname = '4DOS Window'
  534.   msgtext = '4DOS Window'
  535.   location = container
  536.   setup = 'EXENAME=*;'||,
  537.           'ICONFILE='||comDir||'\4DOSOS2.ICO;'||,
  538.           'STARTUPDIR='||comDir||';'||,
  539.           'PROGTYPE=WINDOWEDVDM;'||,
  540.           'OBJECTID='dosExeId||';'||,
  541.           'SET DOS_SHELL='||comDir||'\4DOS.COM '||comdir||' /P;'
  542.   CALL DOCreateObject
  543.   
  544.   IF RESULT = 0 THEN DO
  545.     /* Create/update the help object */
  546.     classname = 'WPProgram'
  547.     objectname = '4DOS Help'
  548.     msgtext = '4DOS Help'
  549.     location = container
  550.     setup = 'EXENAME=*;'||,
  551.             'PARAMETERS=/C '||comDir||'\4HELP.EXE;'||,
  552.             'PROGTYPE=WINDOWEDVDM;'||,
  553.             'OBJECTID='dosHelpId||';'||,
  554.             'SET DOS_SHELL='||comDir||'\4DOS.COM '||comdir||' /P;'
  555.     CALL DOCreateObject
  556.   END
  557. RETURN RESULT
  558.  
  559.  
  560. /****************************************************************************/
  561. Create4OS2Objects:
  562.  
  563.   /* Create/update the main executable */
  564.   classname = 'WPProgram'
  565.   objectname = '4OS2 Window'
  566.   msgtext = '4OS2 program file'
  567.   location = container
  568.   setup = 'EXENAME='||comDir||'\4OS2.EXE;'||,
  569.           'STARTUPDIR='||comDir||';'||,
  570.           'PROGTYPE=WINDOWABLEVIO;'||,
  571.           'OBJECTID='os2ExeId||';'
  572.   CALL DOCreateObject
  573.   
  574.   IF RESULT = 0 THEN DO
  575.     /* Create/update the help object */
  576.     classname = 'WPProgram'
  577.     objectname = '4OS2 Help'
  578.     msgtext = '4OS2 help file'
  579.     location = container
  580.     setup = 'EXENAME=VIEW.EXE;'||,
  581.             'PARAMETERS='||comDir||'\4OS2.INF;'||,
  582.             'PROGTYPE=PM;'||,
  583.             'OBJECTID='os2HelpId||';'
  584.     CALL DOCreateObject
  585.   END
  586. RETURN RESULT
  587.  
  588.  
  589. /****************************************************************************/
  590. CreateTCMDObjects:
  591.   /* Create/update the main executable */
  592.   classname = 'WPProgram'
  593.   objectname = 'Take Command'||'0d0A'x||'for OS/2'
  594.   msgtext = 'Take Command for OS/2 program file'
  595.   location = container
  596.   setup = 'EXENAME='||comDir||'\TCMDOS2.EXE;'||,
  597.           'STARTUPDIR='||comDir||';'||,
  598.           'PROGTYPE=PM;'||,
  599.           'OBJECTID='tcmdExeId||';'
  600.   CALL DOCreateObject
  601.  
  602.   IF RESULT = 0 THEN DO
  603.     /* Create/update the help object */
  604.     classname = 'WPProgram'
  605.     objectname = 'Take Command'||'0d0A'x||'for OS/2 Help'
  606.     msgtext = 'Take Command for OS/2 help file'
  607.     location = container
  608.     setup = 'EXENAME=VIEW.EXE;'||,
  609.             'PARAMETERS='||comDir||'\TCMDOS2.INF;'||,
  610.             'PROGTYPE=PM;'||,
  611.             'OBJECTID='tcmdHelpId||';'
  612.     CALL DOCreateObject
  613.   END
  614.  
  615. RETURN RESULT
  616.  
  617.  
  618. /****************************************************************************/
  619. RemoveFolder:
  620.   /* Delete the folder */
  621.   msgtext = 'JP Software Command Processors folder'
  622.   object = jpFolder
  623.   
  624.   CALL DODestroyObject
  625.  
  626.   IF (RESULT = 0) THEN
  627.     holdRC = 0
  628.   ELSE  
  629.     holdRC = 1
  630.  
  631. RETURN holdRC
  632.  
  633.  
  634. /****************************************************************************/
  635. Remove4DOSObjects:
  636.   /* Delete the objects */
  637.   msgtext = '4DOS Window'
  638.   object = dosExeId
  639.   CALL DODestroyObject
  640.   holdRC = RESULT
  641.   
  642.   msgtext = '4DOS Help'
  643.   object = dosHelpId
  644.   CALL DODestroyObject
  645.  
  646.   IF (RESULT \= 0) | (holdRC \= 0) THEN
  647.     holdRC = 1
  648.  
  649. RETURN holdRC
  650.  
  651.  
  652. /****************************************************************************/
  653.  
  654.  
  655. /****************************************************************************/
  656. Remove4OS2Objects:
  657.   /* Delete the objects */
  658.   msgtext = '4OS2 program file'
  659.   object = os2ExeId
  660.   CALL DODestroyObject
  661.   holdRC = RESULT
  662.   
  663.   msgtext = '4OS2 help file'
  664.   object = os2HelpId
  665.   CALL DODestroyObject
  666.  
  667.   IF (RESULT \= 0) | (holdRC \= 0) THEN
  668.     holdRC = 1
  669.  
  670. RETURN holdRC
  671.  
  672.  
  673. /****************************************************************************/
  674. RemoveTCMDObjects:
  675.   /* Delete the objects */
  676.   msgtext = 'Take Command for OS/2 program file'
  677.   object = tcmdExeId
  678.   CALL DODestroyObject
  679.   holdRC = RESULT
  680.   
  681.   msgtext = 'Take Command for OS/2 help file'
  682.   object = tcmdHelpId
  683.   CALL DODestroyObject
  684.  
  685.   IF (RESULT \= 0) | (holdRC \= 0) THEN
  686.     holdRC = 1
  687.  
  688. RETURN holdRC
  689.  
  690.  
  691. /****************************************************************************/
  692. DOCreateObject:
  693.   SAY ''
  694.   CALL charout, 'Creating/updating object:  ' msgtext
  695.   rc = SysCreateObject(classname, objectname, location, setup, 'U')
  696.   IF rc <> 0 THEN DO
  697.     CALL charout ,'... OK!'
  698.     objRC = 0
  699.   END
  700.   ELSE DO
  701.     CALL charout ,'... ERROR #'rc
  702.     objRC = 1
  703.   END
  704.  
  705.   SAY '';
  706. RETURN objRC
  707.  
  708.  
  709. /****************************************************************************/
  710. DODestroyObject:
  711.   SAY ''
  712.   CALL charout, 'Removing object:  ' msgtext
  713.   rc = SysDestroyObject(object)
  714.   IF rc <> 0 THEN DO
  715.     CALL charout ,'... OK!'
  716.     objRC = 0
  717.   END
  718.   ELSE DO
  719.     CALL charout ,'... ERROR #'rc
  720.     objRC = 1
  721.   END
  722.  
  723.   SAY '';
  724. RETURN objRC
  725.  
  726.  
  727. /****************************************************************************/
  728. ArgError:
  729.   SAY ''
  730.   SAY 'This program can only be run by the JP Software INSTALL program.'
  731.   SAY 'It will not work if you attempt to execute it manually.'
  732. RETURN
  733.  
  734.  
  735. /****************************************************************************/
  736. UCase:
  737.   PARSE UPPER ARG ucReturn
  738. RETURN ucReturn
  739.  
  740.