home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 7 Games / 07-Games.zip / bemalph0.zip / install.cmd < prev    next >
OS/2 REXX Batch file  |  1996-03-01  |  8KB  |  182 lines

  1. /* INSTALL.cmd - (c) Copyright 1996, Rhintek, Incorporated */
  2.  
  3.    '@echo off'
  4.  
  5.    /* get the system functions involved so that we can use them */
  6.    call RxFuncAdd 'SysLoadFuncs','RexxUtil','SysLoadFuncs'
  7.    call SysLoadFuncs
  8.  
  9.    /* open the readme file in e */
  10.    'start "BEM Readme" /F e readme.1st'
  11.    say 'Installing...'
  12.  
  13.    /* get the current directory */
  14.    thepath = SysSearchPath( PATH, "BEMbook.ico" )
  15.    lastslash = lastpos( '\', thepath)
  16.    thepath = substr( thepath, 1, lastslash )
  17.  
  18.    /* make the folder for the BEM directory on the desktop */
  19.    icons = 'ICONFILE=' || thepath || 'BEMFLDR.ICO;ICONNFILE=1,' || thepath || 'BEMFLDRo.ICO'
  20.    background = 'BACKGROUND=' || thepath || 'tile2blu.bmp,T,1,I;'
  21.    setupstring = 'OBJECTID=<BEMFLDR>;' || background || icons
  22.    rc = SysCreateObject( WPFolder, "BEM Alpha", "<WP_DESKTOP>", setupstring )
  23.    if rc = 0
  24.       then say "error in creating folder on the desktop"
  25.  
  26.    /* add the shadow of the general readme (so its first in the folder) */
  27.    setupstring = 'SHADOWID=' || thepath || 'readme.1st;'
  28.    rc = SysCreateObject( WPShadow, " ", "<BEMFLDR>", setupstring )
  29.    if rc = 0
  30.       then say "error in creating shadow of General Readme"
  31.  
  32.    /* add the shadow of the beta application */
  33.    setupstring = 'SHADOWID=' || thepath || 'betaapp.txt;'
  34.    rc = SysCreateObject( WPShadow, " ", "<BEMFLDR>", setupstring )
  35.    if rc = 0
  36.       then say "error in creating shadow of Beta application"
  37.  
  38.    /* make the program object for the config.exe */
  39.    execstring = 'EXENAME=' || thepath || 'config.exe;'
  40.    startstring = 'STARTUPDIR=' || thepath
  41.    icons = 'ICONFILE=' || thepath || 'bconfig.ICO;'
  42.    setupstring = 'OBJECTID=<BEMCFG>;' || icons || execstring || startstring
  43.    rc = SysCreateObject( WPProgram, "BEM Config", "<BEMFLDR>", setupstring )
  44.    if rc = 0
  45.       then say "error in creating Config object"
  46.  
  47.    /* make the program object for single-player BEM */
  48.    execstring = 'EXENAME=' || thepath || 'single.cmd;'
  49.    startstring = 'STARTUPDIR=' || thepath
  50.    icons = 'ICONFILE=' || thepath || 'single.ICO;'
  51.    setupstring = 'OBJECTID=<BEMSNGL>;MINIMIZED=YES;' || icons || execstring || startstring
  52.    rc = SysCreateObject( WPProgram, "Single-Player", "<BEMFLDR>", setupstring )
  53.    if rc = 0
  54.       then say "error in creating Single-Player"
  55.  
  56.    /* make a program object that points to the inf */
  57.    execstring = 'EXENAME=view.exe;'
  58.    paramstring = 'PARAMETERS=bemhelp.inf;'
  59.    startstring = 'STARTUPDIR=' || thepath
  60.    icons = 'ICONFILE=' || thepath || 'bembook.ICO;'
  61.    setupstring = 'OBJECTID=<BEMHELP>;' || icons || execstring || paramstring || startstring
  62.    rc = SysCreateObject( WPProgram, "BEM Help", "<BEMFLDR>", setupstring )
  63.    if rc = 0
  64.       then say "error in creating BEM Book"        
  65.  
  66.    /* make the folder for the Client in the BEM Alpha folder */
  67.    icons = 'ICONFILE=' || thepath || 'BEMFLDR.ICO;ICONNFILE=1,' || thepath || 'BEMFLDRo.ICO'
  68.    background = 'BACKGROUND=' || thepath || 'tile2grn.bmp,T,1,I;'
  69.    setupstring = 'OBJECTID=<BEMCLNT>;' || background || icons
  70.    rc = SysCreateObject( WPFolder, "Client", "<BEMFLDR>", setupstring )
  71.    if rc = 0
  72.       then say "error in creating client folder in BEM Alpha"
  73.  
  74.    /* add the readme first so that is is the object to the left */
  75.    setupstring = 'SHADOWID=' || thepath || 'readme.clt;'
  76.    rc = SysCreateObject( WPShadow, " ", "<BEMCLNT>", setupstring )
  77.    if rc = 0
  78.       then say "error in creating shadow of Client Readme"
  79.  
  80.    /* add the Direct-Connect client */
  81.    execstring = 'EXENAME=' || thepath || 'rhino.exe;'
  82.    paramstring = 'PARAMETERS=clntdir.rcf "/T=Direct-Connect Client";'
  83.    startstring = 'STARTUPDIR=' || thepath
  84.    icons = 'ICONFILE=' || thepath || 'single.ICO;'
  85.    setupstring = 'OBJECTID=<BEMCDIR>;' || icons || execstring || paramstring || startstring
  86.    rc = SysCreateObject( WPProgram, "Direct-Connect", "<BEMCLNT>", setupstring )
  87.    if rc = 0
  88.       then say "error in creating Client Direct-Connect"
  89.  
  90.    /* add the COM client */
  91.    execstring = 'EXENAME=' || thepath || 'rhino.exe;'
  92.    paramstring = 'PARAMETERS=clntcom.rcf "/T=COM Client";'
  93.    startstring = 'STARTUPDIR=' || thepath
  94.    icons = 'ICONFILE=' || thepath || 'single.ICO;'
  95.    setupstring = 'OBJECTID=<BEMCCOM>;' || icons || execstring || paramstring || startstring
  96.    rc = SysCreateObject( WPProgram, "COM", "<BEMCLNT>", setupstring )
  97.    if rc = 0
  98.       then say "error in creating Client COM"
  99.  
  100.    /* add the Client Internet/TCPIP connection object */
  101.    execstring = 'EXENAME=' || thepath || 'rhino.exe;'
  102.    paramstring = 'PARAMETERS=client.rcf "/T=Internet/TCPIP";'
  103.    startstring = 'STARTUPDIR=' || thepath
  104.    icons = 'ICONFILE=' || thepath || 'single.ICO;'
  105.    setupstring = 'OBJECTID=<BEMCTCPIP>;' || icons || execstring || paramstring || startstring
  106.    rc = SysCreateObject( WPProgram, "Internet/TCPIP", "<BEMCLNT>", setupstring )
  107.    if rc = 0
  108.       then say "error in creating Internet/TCPIP Client"
  109.  
  110.    /* make the folder for Server in the BEM Alpha folder */
  111.    icons = 'ICONFILE=' || thepath || 'BEMFLDR.ICO;ICONNFILE=1,' || thepath || 'BEMFLDRo.ICO'
  112.    background = 'BACKGROUND=' || thepath || 'tile2red.bmp,T,1,I;' 
  113.    setupstring = 'OBJECTID=<BEMSRVR>;' || background || icons
  114.    rc = SysCreateObject( WPFolder, "Server", "<BEMFLDR>", setupstring )
  115.    if rc = 0
  116.       then say "error in creating server folder in BEM Alpha"
  117.  
  118.    /* add the readme first so that it is the leftmost item */
  119.    setupstring = 'SHADOWID=' || thepath || 'readme.svr;'
  120.    rc = SysCreateObject( WPShadow, " ", "<BEMSRVR>", setupstring )
  121.    if rc = 0
  122.       then say "error in creating shadow of Server Readme"
  123.  
  124.    /* add the overseer to the Server Folder (since it has to run first, put it here) */
  125.    execstring = 'EXENAME=' || thepath || 'oseer.exe;'
  126.    startstring = 'STARTUPDIR=' || thepath
  127.    icons = 'ICONFILE=' || thepath || 'overseer.ICO;'
  128.    setupstring = 'OBJECTID=<BEMOSEER>;' || icons || execstring || startstring
  129.    rc = SysCreateObject( WPProgram, "Overseer", "<BEMSRVR>", setupstring )
  130.    if rc = 0
  131.       then say "error in creating overseer"
  132.  
  133.    /* make the program object for local player BEM */
  134.    execstring = 'EXENAME=' || thepath || 'pld.exe;'
  135.    paramstring = 'PARAMETERS=/c=oseer;'
  136.    startstring = 'STARTUPDIR=' || thepath
  137.    icons = 'ICONFILE=' || thepath || 'single.ICO;'
  138.    setupstring = 'OBJECTID=<BEMLCPL>;' || icons || execstring || startstring
  139.    rc = SysCreateObject( WPProgram, "Local-Player", "<BEMSRVR>", setupstring )
  140.    if rc = 0
  141.       then say "error in creating Local-Player"
  142.  
  143.    /* add the Direct-Connect server */
  144.    execstring = 'EXENAME=' || thepath || 'rhino.exe;'
  145.    paramstring = 'PARAMETERS=srvrdir.rcf "/T=Direct-Connect Server";'
  146.    startstring = 'STARTUPDIR=' || thepath
  147.    icons = 'ICONFILE=' || thepath || 'bserver.ICO;'
  148.    setupstring = 'OBJECTID=<BEMSDIR>;' || icons || execstring || paramstring || startstring
  149.    rc = SysCreateObject( WPProgram, "Direct-Connect", "<BEMSRVR>", setupstring )
  150.    if rc = 0
  151.       then say "error in creating Server Direct-Connect"
  152.  
  153.    /* put the COM server in -- we expect this to be the most common connection */
  154.    execstring = 'EXENAME=' || thepath || 'rhino.exe;'
  155.    paramstring = 'PARAMETERS=srvrcom.rcf "/T=COM Server";'
  156.    icons = 'ICONFILE=' || thepath || 'bserver.ICO;'
  157.    setupstring = 'OBJECTID=<BEMSCOM>;' || icons || execstring || paramstring || startstring
  158.    rc = SysCreateObject( WPProgram, "COM", "<BEMSRVR>", setupstring )
  159.    if rc = 0
  160.       then say "error in creating Server COM"
  161.  
  162.    /* add the port BEMs to their folders */
  163.    do i=5000 to 5005 by 1
  164.       execstring = 'EXENAME=' || thepath || 'rhino.exe;'
  165.       startstring = 'STARTUPDIR=' || thepath
  166.       paramstring = 'PARAMETERS=srvr' || i || '.rcf "/T=Port' i || '";'
  167.       icons = 'ICONFILE=' || thepath || 'bserver.ICO;'
  168.       setupstring = 'OBJECTID=<BEMS' || i || '>;' || icons || execstring || paramstring || startstring
  169.       playnum = i - 4999
  170.       titlestring = 'Player #' || playnum '(' || i || ')'
  171.       rc = SysCreateObject( WPProgram, titlestring , "<BEMSRVR>", setupstring )
  172.       if rc = 0
  173.          then say "error in creating Server" i
  174.    end
  175.    say 'Install Complete, read the readme.1st file and have fun, Soldier!'
  176.  
  177. endit:
  178.    
  179.  
  180. /* pause
  181.  'kill e' */
  182.