home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / jigswcmd.zip / jiginst.cmd < prev    next >
OS/2 REXX Batch file  |  1999-04-20  |  3KB  |  84 lines

  1. /* A Rexx CMD to start Jigadm */
  2. parse source operatingSystem commandType sourceFileName
  3. if operatingSystem="OS/2" 
  4. Then DO
  5.     PARSE UPPER ARG wpsInst
  6.     wpsInst= strip(wpsInst)
  7.     pathJigsaw=FileSpec(drive,sourceFileName ) || FileSpec(path,sourceFileName )
  8.     n=setlocal() 
  9.  
  10.     if wpsInst='W'
  11.         then call wpsCreateObjs pathJigsaw
  12.     else if wpsInst='/?'
  13.         then Signal Usage
  14.     else if LENGTH(wpsInst) = 0
  15.                     then do
  16.         call serverJigsawInstall pathJigsaw
  17.         call wpsCreateObjs pathJigsaw
  18.         END
  19.     else
  20.         call serverJigsawInstall pathJigsaw
  21.  
  22.     n=endlocal() 
  23.     exit
  24. END
  25.  
  26. serverJigsawInstall: Procedure
  27.     ARG pathJigsaw
  28.     env='OS2ENVIRONMENT'
  29.     javaPath=Value('CLASSPATH', ,env)
  30.  
  31.     if pos('jigsaw.zip',rc)=0 
  32.     then do
  33.         '@copy *.props '|| pathJigsaw || 'Jigsaw\config'    
  34.         '@cd ' || pathJigsaw || 'Jigsaw'
  35.         javaPath=pathJigsaw  || "classes\" || "jigsaw.zip;" || javaPath  
  36.     end
  37.     rc=Value('CLASSPATH',javaPath ,env)
  38.     '@java  Install' 
  39.     RETURN 0
  40.  
  41. wpsCreateObjs: Procedure
  42.     ARG pathJigsaw
  43.     /* Create an object and update it */
  44.     call RxFuncAdd "SysCreateObject", "REXXUTIL", "SysCreateObject"
  45.  
  46.     /* Create a folder object, and then create a program object */
  47.      /* in that folder.*/
  48.     rc=SysCreateObject("WPFolder", "Jigsaw WWW Server", "<WP_DESKTOP>",,
  49.                              "OBJECTID=<JigFolder>")
  50.     rc=SysCreateObject("WPProgram", "Jigsaw", "<JigFolder>",,
  51.                              "EXENAME=" || pathJigsaw || "jigstart.cmd;" || "PROGTYPE=WINDOWABLEVIO;" || "MINIMIZED=YES;")              
  52.     rc=SysCreateObject("WPProgram", "Jigadm", "<JigFolder>",,
  53.                              "EXENAME=" || pathJigsaw || "jigadm.cmd;" || "PROGTYPE=WINDOWABLEVIO;" || "MINIMIZED=YES;")              
  54.     rc=SysCreateObject("WPProgram", "Kill Jigsaw", "<JigFolder>",,
  55.                              "EXENAME=" || pathJigsaw || "jigkill.cmd;" || "PROGTYPE=WINDOWABLEVIO;"||"PARAMETERS=[Please Input Your Id and Passwd];")              
  56.  
  57.     call rxfuncdrop 'SysCreateObject'
  58.     Return 0
  59.  
  60. USAGE:
  61. SAY ' USAGE: JigInst.CMD <optional argument> '
  62. SAY
  63. SAY ' That is a simple installation script for Jigsaw.'
  64. SAY ' The default way is to run this CMD without any '
  65. SAY ' argument, both the setup of Jigsaw and the '
  66. SAY ' creation of WPS objects procedurs will be called. '
  67. SAY ' However, sometimes you may only want to'
  68. SAY ' re-setup Jigsaw to let it restore the default '
  69. SAY ' configuration  or just want to re-create the WPS  '
  70. SAY ' objs. If this is your case, then you can issue '
  71. SAY ' argument as shown below :' 
  72. SAY
  73. SAY '   JigInst.CMD J'
  74. SAY
  75. SAY ' This will restore the default configuration, and the '
  76. SAY ' argument :'
  77. SAY
  78. SAY '   JigInst.CMD W'
  79. SAY
  80. SAY ' will re-create the WPS objs. '
  81. SAY
  82. exit
  83.  
  84.