home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: OtherApp / OtherApp.zip / efz.zip / INSTALL.CMD < prev    next >
OS/2 REXX Batch file  |  1994-09-26  |  6KB  |  143 lines

  1. /****************************************************************/
  2. /*  Installation Procedure for IBM Tutorial Manager/2 Demo      */
  3. /*                                                              */
  4. /****************************************************************/
  5. /*  Overall function:                                           */
  6. /*    -Initialization                                           */
  7. /*    -Determine Target drive and subdirectory                  */
  8. /*    -Install                                                  */
  9. /*      -Copy files to target directories                       */
  10. /*      -Unpack                                                 */
  11. /*      -erase packed files                                     */
  12. /*      -Create Folder and Objects                              */
  13. /*    -Tell installer about progress and completion             */
  14. /****************************************************************/
  15. /* initialization */
  16. '@ECHO OFF'
  17. ver = os2ver()
  18. if ver>=2 then do
  19.    call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  20.    call SysLoadFuncs
  21.    end
  22.  
  23. /* menu to determine where it should be installed */
  24. idrive = 'C'
  25. ipath='\TMDEMO'
  26. do until ok='Y'
  27.    'CLS'
  28.    say '******************************************************************'
  29.    say '***       IBM Tutorial Manager/2 Demo Installation             ***'
  30.    say '***                     Installation Target                    ***'
  31.    say '***                                                            ***'
  32.    say '***  Install on Drive: 'idrive'                                      ***'
  33.    say '***      in Directory: 'ipath||copies(' ',40-length(ipath))'***'
  34.    say '***                                                            ***'
  35.    say '******************************************************************'
  36.    say 'OK? Please enter (Y)es, (N)o or (Q)uit'
  37.    pull ok; ok=strip(ok); ok=left(ok,1)
  38.    if ok='Q' then exit
  39.    if ok='N' then do
  40.       say ' '
  41.       say 'Enter drive: '
  42.       pull idrive
  43.       idrive = left(idrive,1)
  44.       say 'Enter path: '
  45.       pull ipath
  46.       if left(ipath,1)<>'\' then ipath = '\'ipath
  47.       end /* of if ok=no */
  48.    end /* of do until ok=yes */
  49.  
  50.  
  51. /****************************************************************/
  52. /*  Install the diskettes                                       */
  53. /*                                                              */
  54. /****************************************************************/
  55. /* install it */
  56. idrive':'       /* get to the drive */
  57. 'MD' ipath      /*   and directory  */
  58. 'CD' ipath
  59.  
  60. say 'Copying packed demo to fixed disk...'
  61. 'COPY A:demo2.XEX > NUL'
  62. 'RENAME demo2.XEX demo2.EXE > NUL'
  63. say 'Unpacking demo....'
  64. 'demo2 -o > NUL'
  65. say 'Deleting self-extracting file ....'
  66. 'ERASE demo2.EXE'
  67.  
  68. /****************************************************************/
  69. /*  Optionally create the TutMgr Folder and Objects             */
  70. /****************************************************************/
  71. if ver>=2  then do
  72.    say 'Creating WPS objects ...'
  73.  
  74.    object.class = 'WPFolder'
  75.    object.title = 'IBM Tutorial Manager/2 Demos'
  76.    object.location = '<WP_DESKTOP>'
  77.    object.setup = 'OBJECTID=<WP_TUTMGRFOLDER>;'
  78.    object.update = 'UPDATE'
  79.    Created = BldObj()
  80.  
  81.    object.class = 'WPProgram'
  82.    object.title = 'Overview Demo'
  83.    object.location = '<WP_TUTMGRFOLDER>'
  84.    object.setup = 'EXENAME='idrive':'ipath'\efztmmnl.exe;'
  85.    object.setup = object.setup'STARTUPDIR='idrive':'ipath';'
  86.    object.setup = object.setup'PARAMETERS=demo.pac /nobookmark;'
  87.    Created = BldObj()
  88.  
  89.    end /* of if ver>=2  */
  90.  
  91. say ' '
  92. say ' '
  93. say '******************************************************************'
  94. say '***       IBM Tutorial Manager/2 Demo Installation             ***'
  95. say '***                                                            ***'
  96. say '***                    Installation Completed.                 ***'
  97. say '***                                                            ***'
  98. if ver>=2 then do
  99.    say '*** The TutMgr/2 folder and the demo objects have been created.***'
  100.    say '***                                                            ***'
  101.    end
  102. say '*** For additional information please see the READ.ME file on  ***'
  103. say '*** the diskette.                                              ***'
  104. say '***                                                            ***'
  105. say '*** To start the demo enter DEMO here on                       ***'
  106. say '*** the command line or use the objects generated on the WPS   ***'
  107. say '*** (OS/2 V2.x only).                                          ***'
  108. say '***                                                            ***'
  109. say '******************************************************************'
  110.  
  111.  
  112. exit
  113. /****************************************************************/
  114. /*  Get the OS/2 Version                                        */
  115. /*                                                              */
  116. /****************************************************************/
  117. OS2Ver: procedure
  118. PreQ = queued()
  119. '@VER | RXQUEUE /LIFO'
  120. Output = ''
  121. do while queued() > PreQ
  122.   Output = Output linein('QUEUE:')
  123.   end
  124. Ver = '?'
  125. do while Output <> '' & Ver = '?'
  126.    parse var Output Test Output
  127.    if verify(Test, '0123456789.') = 0 then Ver = Test
  128.    end
  129. return Ver
  130.  
  131. /****************************************************************/
  132. /* Build Object - create an object                              */
  133. /*                                                              */
  134. /****************************************************************/
  135. BldObj: Procedure Expose object.
  136.    result = SysCreateObject(object.class, object.title, object.location,,
  137.                             object.setup, object.update) /* Generic create using global var */
  138.    If result<>1 Then Do
  139.       Say object.title 'not created, return code='result
  140.       end
  141.    else say object.title 'object created'
  142. Return result
  143.