home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / gz-311a.zip / install.cmd < prev    next >
OS/2 REXX Batch file  |  1998-07-15  |  5KB  |  149 lines

  1. /* install program for GemZ script (for OpenChat/2) */
  2. call rxfuncadd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  3. call sysloadfuncs
  4. cls
  5. say ''
  6. say ' '
  7. say '           ▒                                       ▒ '
  8. say '        ░▓█░█      ▄▀▀░▀▀  ▄▄       ░   ▄    ▒ ▄ ▄▄▓▓▄■ ▀ '
  9. say '       ▐░▀▀▀▀▀▀  ▀ ▒▀▀▀▀▀▀▄ ▄ ▄▄░▄▄  ▄▄▀▀▀▀▀▒▀▀▀▀▀▀▓█ '
  10. say '  ▀ ■ ▄▓ ▄▓▀▀▀▀▀▀▀▀  ▄▄▄▄▄ ▀▓▄▄▄▄▄▄▄▄▄▄▄▓▀▀▀▀▀▀▀▀▓▄ ▓ '
  11. say '       ▓ ▓ ▄▓▀░▒▓▓▄ ▓█ █▓░█  ▄▄▄▄▄▄▄▄▄▄  ▄▓▓▒░▀▓▄ █ ▓ '
  12. say '       ▒ ▓ ▓▓ ▄▄▄▄  ▓▒░▒▓▓░ ▒░ ░▒▒▓ ▒░▒░  ▄▄▄▄▄▓▓ █ ▒ '
  13. say '       ░ ▓ ▓█  ▓▓▓▓ ░▒▀▀▀▀  ▒░ ░░█▒ ▒█▒░ ▓▓▓▓▒ ▀▀ ▓ ░ '
  14. say '       ░ ▓ ▓▒ ▐░▒▓█ █░ █░██ ██ ███░ ██░█ █▓▒░█ ▄▓ ▓ ░ '
  15. say '       ▒ ▓ █▓▄██░░▓ ██▄██▓█ █▓ ███▓ ███▒ ▓░░██▄▓█ █ ░ '
  16. say '       ▓ ▓  ▀▀▀▀▀▀   ▀▀▀▀▀  ▀▀ ▀▀▀▀ ▀▀▀▀  ▀▀▀▀▀▀  █ ▒ '
  17. say '       █▄▀▓▄▄▄▄▄▄▄▓▀▓▄▄▄▄▄▓▀▓▄▄▄▄▄▄▄▄▄▄▓▀▓▄▄▄▄▄▄▄▄▓ ▓ '
  18. say '      ▐▒▒▄▄▄▄▄▄▄ ▄  ▄▄▄█▄▄▄ ▄  ▄ ▄░▄▄ ▄   ▄ ▄ ▄▄▄▄▄█▓▄▒ '
  19. say '     ■▀▒              ▒▀    ░     ▀▓      ░ jui▒ce▀▓█▓▀ '
  20. say '    ▀   GemZ for OpenChat/2        ░                ▀ '
  21. say '                     by Gemini (gemini@silcom.com)'
  22. say ''
  23. say ''
  24. say ''
  25. say 'GemZ for OpenChat/2 install program'
  26. say ''
  27.  
  28. installpath = SysIni('USER', 'OpenChat', 'InstallDir')
  29. installpath = left(installpath, length(installpath)-1)
  30. if substr(installpath, length(installpath)) <> '\' then do
  31.     installpath = installpath'\'
  32. end
  33.  
  34. if installpath = '' then do
  35.     say '╔══════════════════════════════════════════════════════╗'
  36.     say '║ Please input the path where OpenChat/2 is installed. ║'
  37.     say '║ (eg. C:\OPENCHAT\)                                   ║'
  38.     say '╚══════════════════════════════════════════════════════╝'
  39.     say ''
  40.     pull installpath
  41.     if substr(installpath, length(installpath)) <> '\' then do
  42.         installpath = installpath'\'
  43.     end
  44. end
  45.  
  46.  
  47. install:
  48.  
  49. rc = stream( installpath'ircrc', 'Command', 'QUERY EXISTS')
  50. upgrading = stream( installpath'script2\gemz2fp.irc', 'Command', 'QUERY EXISTS')
  51. if rc = '' then do
  52.  if installpath != '' then do
  53.   say installpath 'does not contain OpenChat'
  54.  end
  55.  say 'please make sure the path you stated is the root of the OpenChat'
  56.  say 'directory.  eg. C:\OPENCHAT\'
  57.  say 'Please enter your install path'
  58.  pull installpath
  59.  if substr(installpath, length(installpath)) <> '\' then do
  60.   installpath = installpath'\'
  61.  end
  62.  call install
  63. end
  64.  
  65.  
  66.  say 'installing GemZ to OpenChat Directory:'
  67.  say installpath
  68.  say ''
  69.  say 'Is this ok?  [Y/n]'
  70.  pull responce
  71.  if responce = 'N' then do
  72.   installpath = ''
  73.   call install
  74.  end
  75.  gemzfile = 'gemz2fp.irc'
  76.  menufile = 'gemzmenu.irc'
  77.  readmefl = 'gmzread.me'
  78.  plugfile = 'actplug.gmz'
  79.  histfile = 'gmzhist.txt'
  80.  docsfile = 'gemzhelp.new'
  81.  extrfile = 'gzextras.irc'
  82.  colrfile = '*.gzc'
  83.  furlfile = 'furl.exe'
  84.     
  85.  say '╔══════════════════╗'
  86.  say '║ Copying Files... ║ Destination: 'installpath'SCRIPT2\'
  87.  say '╚══════════════════╝'
  88.  '@copy ' gemzfile installpath'script2\'gemzfile
  89.  '@copy ' menufile installpath'script2\'menufile
  90.  '@copy ' readmefl installpath'script2\'readmefl
  91.  '@copy ' plugfile installpath'script2\'plugfile
  92.  '@copy ' histfile installpath'script2\'histfile
  93.  '@copy ' colrfile installpath'script2\'colrfile
  94.  '@copy ' docsfile installpath'script2\'docsfile
  95.  '@copy ' extrfile installpath'script2\'extrfile
  96.  '@copy ' furlfile installpath   
  97.  say '╔══════════════════╗'
  98.  say '║ Copying Complete ║'
  99.  say '╚══════════════════╝'
  100.  
  101.   /* Let's create a shadow in the OpenChat/2 folder if it exists */
  102.   rc = SysCreateObject('WPProgram', 'GemZ Readme File', '<OCHAT_FOLDER>',,
  103.        'EXENAME=E.EXE;PARAMETERS='installpath'script2\'readmefl,'u' )
  104.  
  105.   rc = SysCreateObject('WPProgram', 'GemZ History File', '<OCHAT_FOLDER>',,
  106.        'EXENAME=E.EXE;PARAMETERS='installpath'script2\'histfile,'u' )
  107.  
  108.   rc = SysCreateObject('WPProgram', 'GemZ Help', '<OCHAT_FOLDER>',,
  109.        'EXENAME=VIEW.EXE;PARAMETERS='installpath'script2\gemzhelp.hlp','u' )
  110.  
  111.  
  112. if upgrading = '' then do
  113.   inputfile = installpath'openchat.irc'
  114.   outputfile = installpath'gmztmp.tmp'
  115.   call stream inputfile, 'command', 'open read'
  116.   call stream outputfile, 'command', 'open write'
  117.   do while Lines(inputfile) > 0
  118.    dataline = linein(inputfile)
  119.    if dataline = '^load sample.irc' then
  120.     call lineout outputfile, '#^load sample.irc'
  121.    else
  122.     if dataline = '^load openmenu.scr' then
  123.      call lineout outputfile, '#^load openmenu.scr'
  124.     else
  125.      if dataline \= '^load gemz2fp.irc' then
  126.       call lineout outputfile, dataline
  127.  
  128.   end /* while */
  129.   call lineout outputfile, '^load gemz2fp.irc'
  130.   call stream inputfile, 'command', 'close'
  131.   call stream outputfile, 'command', 'close'
  132.   '@copy ' outputfile inputfile
  133.   '@del ' outputfile
  134.   say '╔══════════════════════════════════════════════════════════════╗'
  135.   say '║ Install Complete... Your openchat.irc file has been updated  ║'
  136.   say '║ GemZ will be autloaded, please make sure all other scripts   ║'
  137.   say '║ Have been removed from both your ircrc file and openchat.irc ║'
  138.   say '║ file.                                                        ║'
  139.   say '╚══════════════════════════════════════════════════════════════╝'
  140.  
  141.  end
  142. else do
  143.  say '╔═══════════════════════════════════╗'
  144.  say '║ Upgrade Completed... Reload GemZ  ║'
  145.  say '╚═══════════════════════════════════╝'
  146.  end
  147.  
  148.  
  149.