home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Multimed / Multimed.zip / mmscp12.zip / INSTALL.CMD < prev    next >
OS/2 REXX Batch file  |  1995-11-05  |  2KB  |  95 lines

  1. /* MMScope installation procedure */
  2.  
  3. call RxFuncAdd "SysLoadFuncs","RexxUtil","SysLoadFuncs"
  4. call SysLoadFuncs
  5. call SysCls
  6.  
  7. title  = "MMPM/2 Scope"
  8. prog   = "MMScope"
  9. map    = SysDriveMap("A:")
  10. target = "C:\" || prog || "\"
  11. dp = ":"
  12. bs = "\"
  13.  
  14. say
  15. say   "MMScope install utility"
  16. say
  17. say
  18. say   "please enter target drive/path :"
  19. say   "(default C:\"prog")"
  20. pos = SysCurPos(4,34)
  21. pull  drive
  22. pos = SysCurPos(7,0)
  23.  
  24. if substr(drive,1,1) = ""
  25.    then  ziel = target
  26.    else  ziel = drive
  27. if substr(ziel,2,1) = ""
  28.    then  ziel = insert(dp,ziel,1)
  29. if substr(ziel,3,1) = ""
  30.    then  ziel = insert(bs,ziel,2)
  31.  
  32. if wordpos(substr(ziel,1,2),map) = 0
  33.    then  do
  34.       say   "drive does not exist!"
  35.       exit
  36.    end
  37.  
  38. if substr(ziel,length(ziel),1) = bs
  39.    then  ziel = delstr(ziel,length(ziel),1)
  40.  
  41. if length(ziel) > 3 then do
  42.  
  43.    rc = SysFileTree(ziel,"ergebnis","D")
  44.    dirfound = 0
  45.  
  46.    if ergebnis.0 = 0 then do
  47.  
  48.       say "directory does not exist, create ? y/n :"
  49.       pos = SysCurPos(7,45)
  50.       pull antwort
  51.  
  52.       if antwort = "Y" then do
  53.          rc = SysMkDir(ziel)
  54.  
  55.          if rc > 0 then do
  56.             say "could not create target directory !!!"
  57.             exit
  58.          end
  59.          else do
  60.             rc = SysFileTree(ziel,"ergebnis","D")
  61.             if ergebnis.0 > 0 then
  62.                dirfound = 1
  63.          end
  64.       end
  65.    end
  66.    else
  67.       dirfound = 1
  68. end
  69.  
  70.  
  71. if dirfound = 1 then do
  72.    "@copy "prog".exe >NUL" ziel
  73.    "@copy "prog".msg >NUL" ziel
  74.    "@copy file_id.diz >NUL" ziel
  75.    "@copy install.cmd >NUL" ziel
  76.    "@copy readme.txt  >NUL" ziel
  77.    "@copy bmtmicro.reg  >NUL" ziel
  78.  
  79.    ziel = insert(bs,ziel,length(ziel))
  80.    options = "EXENAME=" || ziel || prog || ".EXE;"
  81.    ziel = delstr(ziel,length(ziel),1)
  82.    options = options || "STARTUPDIR=" || ziel || ";"
  83.    rc=SysCreateObject('WPProgram',title,'<WP_DESKTOP>',options,'u');
  84.  
  85.    drive = substr(ziel,1,2)
  86.    drive
  87.    "@cd "ziel
  88.    "start "prog".exe "ziel
  89. end
  90.  
  91.  
  92. call SysDropFuncs
  93. exit
  94.  
  95.