home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / shwfnt11.zip / INSTALL.CMD < prev    next >
OS/2 REXX Batch file  |  1995-10-25  |  2KB  |  108 lines

  1. /* install with german or english language support */
  2.  
  3. call RxFuncAdd "SysLoadFuncs","RexxUtil","SysLoadFuncs"
  4. call SysLoadFuncs
  5. call SysCls
  6.  
  7. say
  8. say   "ShowFont install utility"
  9. say
  10. say
  11. say   "please enter target drive/path :"
  12. say   "(default C:\SHOWFONT)"
  13. pos = SysCurPos(4,34)
  14. pull  laufwerk
  15. pos = SysCurPos(7,0)
  16.  
  17. map = SysDriveMap("A:")
  18. ziellw = "C:\SHOWFONT\"
  19. dp = ":"
  20. bs = "\"
  21.  
  22. if substr(laufwerk,1,1) = ""
  23.    then  ziel = ziellw
  24.    else  ziel = laufwerk
  25. if substr(ziel,2,1) = ""
  26.    then  ziel = insert(dp,ziel,1)
  27. if substr(ziel,3,1) = ""
  28.    then  ziel = insert(bs,ziel,2)
  29.  
  30. if wordpos(substr(ziel,1,2),map) = 0
  31.    then  do
  32.       say   "drive does not exist!"
  33.       exit
  34.    end
  35.  
  36. if substr(ziel,length(ziel),1) = bs
  37.    then  ziel = delstr(ziel,length(ziel),1)
  38.  
  39. if length(ziel) > 3 then do
  40.  
  41.    rc = SysFileTree(ziel,"ergebnis","D")
  42.    dirfound = 0
  43.  
  44.    if ergebnis.0 = 0 then do
  45.  
  46.       say "directory does not exist, create ? y/n :"
  47.       pos = SysCurPos(7,45)
  48.       pull antwort
  49.  
  50.       if antwort = "Y" then do
  51.          rc = SysMkDir(ziel)
  52.  
  53.          if rc > 0 then do
  54.             say "could not create target directory !!!"
  55.             exit
  56.          end
  57.          else do
  58.             rc = SysFileTree(ziel,"ergebnis","D")
  59.             if ergebnis.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.    pos = SysCurPos(7,0)
  71.    say   "please choose language (1=english, 2=german) :"
  72.    pos = SysCurPos(7,48)
  73.    pull  language
  74.    pos = SysCurPos(10,0)
  75.  
  76.    if language < 1 then language = 1
  77.    if language > 2 then language = 1
  78.  
  79.    "@copy showfont.exe >NUL" ziel
  80.  
  81.    if language = 1 then do
  82.       ziel = insert(bs,ziel,length(ziel))
  83.       titel = "Show Font Utility"
  84.       "@copy showf_e.msg" ziel"showfont.msg >NUL"
  85.       end
  86.    if language = 2 then do
  87.       ziel = insert(bs,ziel,length(ziel))
  88.       titel = "OS/2 Fonts"
  89.       "@copy showf_g.msg" ziel"showfont.msg >NUL"
  90.       end
  91.  
  92.    options = "EXENAME=" || ziel || "SHOWFONT.EXE;"
  93.    ziel = delstr(ziel,length(ziel),1)
  94.    options = options || "STARTUPDIR=" || ziel || ";"
  95.    rc=SysCreateObject('WPProgram',titel,'<WP_DESKTOP>',options,'u');
  96.  
  97.    drive = substr(ziel,1,2)
  98.    drive
  99.    "@cd "ziel
  100. 'pause'
  101.    "start showfont.exe "ziel
  102. end
  103.  
  104.  
  105. call SysDropFuncs
  106. exit
  107.  
  108.