home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / netdor3.zip / VNDINST / FRNTENDS / 123G-FLG / 123GRUN.CMD next >
OS/2 REXX Batch file  |  1996-04-04  |  4KB  |  118 lines

  1. /******************************************************************
  2. Description:    Lotus 123/G Execution Exec.
  3.  
  4. Details:        This exec is used to run 123/G.
  5.  
  6.                 This exec assigns the LOTUSLOT license alias
  7.                 then starts 123/G.
  8.  
  9. Dependencies:
  10.    Externals:   RXUTILS.DLL - Part of VENDOR.
  11.                 GIME.EXE    - Part of VENDOR.
  12.                 HIDEWIN.EXE - Part of VENDOR.
  13.    Drive(s):    None
  14.    Directories: All DLL and EXE files in same directory.
  15.    Window Type: FS/WIN
  16.    App Title:   Lotus 123/G
  17.  
  18. Last Updated:   7/27/92
  19. ******************************************************************/
  20. '@echo off'
  21. trace 'o'
  22. parse arg params
  23.  
  24. /** Give header **/
  25. say
  26. say ' LOTUS 123/G'
  27. say ' -----------'
  28. say
  29.  
  30. /** Setup Miscellaneous Variables **/
  31. call RxFuncAdd 'RXCLS',    'RXUTILS', 'RXCLS'
  32. call RxFuncAdd 'RXGREP',   'RXUTILS', 'RXGREP'
  33. call RxFuncAdd 'RXPAUSE',  'RXUTILS', 'RXPAUSE'
  34. call RxFuncAdd 'RXOS2INI', 'RXUTILS', 'RXOS2INI'
  35. parse source . . filespec        /* Get the drive, dir and name of  exec   */
  36. LicAlias='LOTUSLOT'              /* Don't touch this one                   */
  37. Env='OS2ENVIRONMENT'             /* Set the REXX environment variable      */
  38. olddir=directory()               /* Get current directory                  */
  39. pdir=GetPersonal()               /* Get personal Lotus dir var if  exists  */
  40. Inst123G = RxOS2Ini( , '123G_FLG', 'INSTALL_123G')
  41. InstFLG  = RxOS2Ini( , '123G_FLG', 'INSTALL_FLG')
  42.  
  43.  
  44. /** If Personal directory not in CONFIG.SYS then exit error **/
  45. if pdir='' then do
  46.  say d2c(7)||d2c(7)
  47.  say ' Cannot determine LOTUS Personal Directory.  Please run the'
  48.  say ' installation program for this package then try again.'; say
  49.  'pause'
  50.  'exit'
  51. end
  52.  
  53.  
  54. /***********************************************************
  55. ** Assign License Drive:                                  **
  56. ** Replace this section of code with NET USE if your site **
  57. ** does not wish to use GIME.                             **
  58. ***********************************************************/
  59. say ' Initializing LOTUS License Drive...'
  60. do queued(); pull .; end
  61. 'gime 'LicAlias' | RXQUEUE'
  62. parse upper pull 'THE NETNAME ' . ' ASSIGNED TO DRIVE ' drive
  63. if drive='' then do
  64.   say d2c(7)
  65.   say ' Error assigning LOTUS License Drive.'
  66.   say ' Please contact an OS/2 Consultant.'; say
  67.   'pause'
  68.   'exit'
  69. end
  70.  
  71.  
  72. /** Setup new path **/
  73. call value 'DPATH', drive';'value('DPATH', ,Env), Env
  74.  
  75.  
  76. /** Setup new directory to run from location of this exec **/
  77. call directory left(filespec, lastpos('\', filespec)-1)
  78.  
  79.  
  80. /** Start the program **/
  81. if Package<>'QUIT' then do
  82.   say
  83.   say ' LOTUS 123/G is starting.  Please wait...'
  84.   say
  85.   say ' Please do not terminate this session.  It will be hidden'
  86.   say ' automatically...'
  87.   'START HIDEWIN /D=20 Lotus 123/G'
  88.   '123G 'params
  89. end
  90.  
  91.  
  92. /** Drop the license drive (don't have a COW if this fails) **/
  93. say ' Exiting...'
  94. call directory olddir
  95. 'gime 'LicAlias' /d>nul'
  96. 'exit'
  97.  
  98. /************************************************************
  99. ** GetPersonal()                                           **
  100. **                                                         **
  101. ** Returns the Lotus Personal Env Var as specified in      **
  102. ** the CONFIG.SYS.  This is needed as the user may change  **
  103. ** this and we would rather not force a reboot to activate **
  104. ** it.                                                     **
  105. **                                                         **
  106. ** Also sets the current LOTUSPERSONAL to that set in the  **
  107. ** CONFIG.SYS (JIC).                                       **
  108. ************************************************************/
  109. GetPersonal:
  110.  if RxGrep('SET LOTUSPERSONAL=',RxBootDrive()'\CONFIG.SYS','grep')=0 then
  111.    if grep.0>0 then
  112.      pdir=space(substr(grep.1, pos('=', grep.1)+1))
  113.    else
  114.      pdir=''
  115.  call value 'LOTUSPERSONAL', pdir, Env
  116. return pdir
  117.  
  118.