home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: InfoMgt / InfoMgt.zip / diskct18.zip / INSTALL.CMD < prev    next >
OS/2 REXX Batch file  |  1996-10-16  |  3KB  |  106 lines

  1. /* install DiskCat */
  2.  
  3. call RxFuncAdd "SysLoadFuncs","RexxUtil","SysLoadFuncs"
  4. call SysLoadFuncs
  5. call SysCls
  6.  
  7. say
  8. say   "DiskCat install utility"
  9. say
  10. say
  11. say   "please enter target drive/path :"
  12. say   "(default C:\DiskCat)"
  13. pos = SysCurPos(4,34)
  14. pull  drive
  15. pos = SysCurPos(7,0)
  16.  
  17. map = SysDriveMap("A:")
  18. targetdrive = "C:\DiskCat\"
  19. dp = ":"
  20. bs = "\"
  21.  
  22. if substr(drive,1,1) = ""
  23.    then  target = targetdrive
  24.    else  target = drive
  25. if substr(target,2,1) = ""
  26.    then  target = insert(dp,target,1)
  27. if substr(target,3,1) = ""
  28.    then  target = insert(bs,target,2)
  29.  
  30. if wordpos(substr(target,1,2),map) = 0
  31.    then  do
  32.       say   "drive does not exist!"
  33.       exit
  34.    end
  35.  
  36. if substr(target,length(target),1) = bs
  37.    then  target = delstr(target,length(target),1)
  38.  
  39. if length(target) > 3 then do
  40.  
  41.    rc = SysFileTree(target,"result","D")
  42.    dirfound = 0
  43.  
  44.    if result.0 = 0 then do
  45.  
  46.       say "directory does not exist, create ? y/n :"
  47.       pos = SysCurPos(7,45)
  48.       pull answer
  49.  
  50.       if answer = "Y" then do
  51.          rc = SysMkDir(target)
  52.  
  53.          if rc > 0 then do
  54.             say "could not create target directory !!!"
  55.             exit
  56.          end
  57.          else do
  58.             rc = SysFileTree(target,"result","D")
  59.             if result.0 > 0 then
  60.                dirfound = 1
  61.          end
  62.       end
  63.    end
  64.    else
  65.       dirfound = 1
  66. end
  67.  
  68.  
  69. if dirfound = 1 then do
  70.    "@copy diskcat.exe  >NUL" target
  71.    "@copy diskcat.inf  >NUL" target
  72.    "@copy diskcat.ico  >NUL" target
  73.    "@copy diskcat.msg  >NUL" target
  74.    "@copy file_id.diz  >NUL" target
  75.    "@copy bmtmicro.reg >NUL" target
  76.  
  77.    rc = SysCreateObject("WPFolder", ,
  78.                         "Disk Catalog", ,
  79.                         "<WP_DESKTOP>", ,
  80.                         "OBJECTID=<DSK_CAT>")
  81.  
  82.    rc = SysSetObjectData('<DSK_CAT>', 'ICONFILE='||target||'\diskcat.ico;')
  83.    rc = SysSetObjectData('<DSK_CAT>', 'OPEN=DEFAULT;')
  84.    rc = SysFileDelete(target||'\diskcat.ico')
  85.  
  86.    options = "EXENAME=" || target || "\DiskCat.EXE;" || "STARTUPDIR=" || target || ";"
  87.    rc = SysCreateObject('WPProgram','Disk Catalog','<DSK_CAT>',options,'REPLACE');
  88.  
  89.    options = "EXENAME=VIEW.EXE;PARAMETERS=" || target || "\diskcat.inf;"
  90.    rc = SysCreateObject('WPProgram','Handbook','<DSK_CAT>',options,'REPLACE');
  91.  
  92.    options = "SHADOWID=" || target || "\bmtmicro.reg;OBJECTID=<DSK_CAT_REG>"
  93.    rc = SysCreateObject('WPShadow','Registration^Form','<DSK_CAT>',options,'REPLACE');
  94.  
  95.    drive = substr(target,1,2)
  96.    drive
  97.    "@cd "target
  98.  
  99.    "start diskcat.exe "
  100. end
  101.  
  102.  
  103. call SysDropFuncs
  104. exit
  105.  
  106.