home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Spezial / SPEZIAL2_97.zip / SPEZIAL2_97.iso / ANWEND / MULTIMED / BTALK13 / install.cmd < prev    next >
OS/2 REXX Batch file  |  1997-03-18  |  9KB  |  323 lines

  1. /* BackTalk installation. You will need UNZIP.EXE in your path or current */
  2. /* directory.  The installer will use its execution directory files, NOT  */
  3. /* the ones from the directory you were at the prompt.                    */
  4. /*                                        Samuel Audet <guardia@cam.org>  */
  5.  
  6. /* Load necessary RexxUtil functions */
  7.  
  8. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs' 
  9. call SysLoadFuncs
  10.  
  11. parse arg parm
  12. parm = strip(parm)
  13.  
  14. /* Help screen */
  15.  
  16. if (parm = '' | pos('?',parm) > 0) then do
  17.    say 'Usage:  INSTALL <target directory>'
  18.    say 'ie:  install g:\backtalk'
  19.    exit
  20. end
  21.  
  22. /* Finding and switching execution directory */
  23.  
  24. parse source . . sourcename
  25. sourcedir = filespec('D', sourcename)||filespec('P', sourcename)
  26. sourcedir = left(sourcedir, length(sourcedir)-1)
  27. call directory sourcedir
  28.  
  29. /* Remove trailing backslash */
  30.  
  31. if lastpos('\',parm) = length(parm) then parm = left(parm,length(parm) - 1)
  32.  
  33. /* Introduction */
  34.  
  35. say
  36. Say 'BackTalk 1.3 installer powered by REXX POWER!!'
  37. Say 'This installer uses and includes freeware Info-ZIP UNZIP 5.x'
  38. Say 'You will *NEED* the EMX runtime librairies during the installation.'
  39. Say 'Note: if you have a previous version of BackTalk, please remove the'
  40. say 'program directory and the WPS Folder with the Program Objects.'
  41. say
  42.  
  43. /* Finding UNZIP.EXE */
  44.  
  45. if search('UNZIP.EXE','PATH') = 2 then exit
  46.  
  47. /* Queries */
  48.  
  49. Call CharOut, 'Install BackTalk in 'parm' ? '
  50. AKey = SysGetKey( 'ECHO' )
  51. If AKey <> 'y' & AKey <> 'Y' Then Exit
  52.  
  53. /* Making specified directory */
  54.  
  55. say
  56.  
  57. rc = SysMkDir(parm)
  58. if rc > 0 then do
  59.   say 'Failed creating' parm
  60.   if rc = 5 then say 'Please remove the existing directory first'
  61.   exit
  62. end
  63.  
  64. say
  65.  
  66. Call CharOut, 'Install flip (necessary for MR/2 ICE)? '
  67. AKey = SysGetKey( 'ECHO' )
  68. If AKey = 'y' | AKey = 'Y' Then mr2 = 1
  69.  
  70. /* define the default install options */
  71.  
  72. ver = '22'
  73. spch = 'spch-16b.cmd'
  74. pmaud = 0
  75. akey = 1
  76.  
  77. /* Testing for possible kludge, and let the user try */
  78.  
  79. do until akey = d2c(27)
  80.    'cls'
  81.    say 'The following options will test your system "capability".'
  82.    say 'The first options are better if working, please try them first.'
  83.    say 'Press ESC when you have made your choice, the latter will reflect'
  84.    say 'the last option you tried.'
  85.    say
  86.    say 'Currently selected option is:' akey
  87.    say '1. Rsynth 2.2 with 16 bit audio'
  88.    say '2. Rsynth 2.2 with 8 bit audio'
  89.    say '3. Rsynth 2.1 with 16 bit audio'
  90.    say '4. Rsynth 2.1 with 8 bit audio'
  91.    say '5. Rsynth 2.1 with chipmunk voice fix'
  92.    say '6. AU sound file dumping'
  93.    say '7. WAV sound file dumping'
  94.    Call CharOut, 'Choice: '
  95.    AKey = SysGetKey( 'ECHO' )
  96.    Select
  97.       when akey = '1' then do
  98.          'unzip rsynth22.zip say.exe'
  99.          'say -b 16 "hello world"'
  100.          'del say.exe'
  101.          ver = '22'
  102.          spch = 'spch-16b.cmd'
  103.          pmaud = 0
  104.          end
  105.       when akey = '2' then do
  106.          'unzip rsynth22.zip say.exe'
  107.          'say "hello world"'
  108.          'del say.exe'
  109.          ver = '22'
  110.          spch = 'spch-8b.cmd'
  111.          pmaud = 0
  112.          end
  113.       when akey = '3' then do
  114.          'unzip rsynth21.zip say.exe'
  115.          'say -b 16 "hello world"'
  116.          'del say.exe'
  117.          ver = '21'
  118.          spch = 'spch-16b.cmd'
  119.          pmaud = 0
  120.          end
  121.       when akey = '4' then do
  122.          'unzip rsynth21.zip say.exe'
  123.          'say "hello world"'
  124.          'del say.exe'
  125.          ver = '21'
  126.          spch = 'spch-8b.cmd'
  127.          pmaud = 0
  128.          end
  129.       when akey = '5' then do
  130.          'unzip rsynth21.zip say.exe'
  131.          'say +C "hello world"'
  132.          'del say.exe'
  133.          ver = '21'
  134.          spch = 'spch-chip.cmd'
  135.          pmaud = 0
  136.          end
  137.       when akey = '6' then do
  138.          'unzip rsynth22.zip say.exe'
  139.          'unzip pmaud11.zip audt.exe'
  140.          'say +Q -o temp.wav "hello world"'
  141.          'audt temp.wav'
  142.          'del say.exe'
  143.          'del audt.exe'
  144.          'del temp.wav'
  145.          ver = '22'
  146.          spch = 'spch-au.cmd'
  147.          pmaud = 1
  148.          end
  149.       when akey = '7' then do
  150.          'unzip rsynth22.zip say.exe'
  151.          'unzip pmaud11.zip audt.exe'
  152.          'say +Q -w temp.wav "hello world"'
  153.          'audt temp.wav'
  154.          'del say.exe'
  155.          'del audt.exe'
  156.          'del temp.wav'
  157.          ver = '22'
  158.          spch = 'spch-wav.cmd'
  159.          pmaud = 1
  160.          end
  161.       otherwise
  162.          if akey <> d2c(27) then akey = 1
  163.    end
  164. end
  165.  
  166. /* Unzipping, copying, deleting files */
  167.  
  168. 'unzip rsynth'ver' -d 'parm'\RSynth'
  169. 'unzip rexx -d 'parm'\REXX'
  170. 'unzip uptime -d 'parm'\Uptime'
  171. if pmaud = 1 then 'unzip pmaud11.zip audt.exe -d 'parm'\RSynth'
  172. if mr2 = 1 then 'unzip flip1os2 -d 'parm'\flip'
  173. 'copy readme 'parm
  174. 'ren' parm'\REXX\'spch 'speechq.cmd'
  175. 'copy 'parm'\rexx\speechq.cmd 'parm'\rsynth'
  176. 'copy 'parm'\rexx\spkstart.cmd 'parm'\rsynth'
  177. 'copy 'parm'\rexx\spkstats.cmd 'parm'\uptime'
  178. 'del' parm'\REXX\spch-*'
  179. 'del' parm'\REXX\speechq.cmd'
  180. 'del' parm'\REXX\spkstart.cmd'
  181. 'del' parm'\REXX\spkstats.cmd'
  182.  
  183. /* Creating WPS Objects */
  184.  
  185. say
  186.  
  187. classname='WPFolder'
  188. title='BackTalk'
  189. location='<WP_DESKTOP>'
  190. setup='OBJECTID=<BACK_TALK>;'||,
  191.       'ICONFILE='sourcedir'\backfld.ico;'||,
  192.       'ICONNFILE=1,'sourcedir'\backfldn.ico;'
  193. Call BldObj
  194.  
  195. classname='WPProgram'
  196. title='Speech Queue'
  197. location='<BACK_TALK>'
  198. setup='OBJECTID=<SPCH_QUEUE>;'||,
  199.       'EXENAME='parm'\rsynth\speechq.cmd;'||,
  200.       'MINIMIZED=YES;'||,
  201.       'ICONFILE='sourcedir'\speech.ico;'
  202. Call BldObj
  203.  
  204. classname='WPProgram'
  205. title='Stop Speech'
  206. location='<BACK_TALK>'
  207. setup='OBJECTID=<STOP_SPCH>;'||,
  208.       'EXENAME='parm'\rexx\spchcmd.cmd;'||,
  209.       'PARAMETERS=COMMAND_END;'||,
  210.       'MINIMIZED=YES;'||,
  211.       'ICONFILE='sourcedir'\speech.ico;'
  212. Call BldObj
  213.  
  214. classname='WPProgram'
  215. title='Mute Speech'
  216. location='<BACK_TALK>'
  217. setup='OBJECTID=<MUTE_SPCH>;'||,
  218.       'EXENAME='parm'\rexx\spchcmd.cmd;'||,
  219.       'PARAMETERS=COMMAND_MUTE;'||,
  220.       'MINIMIZED=YES;'||,
  221.       'ICONFILE='sourcedir'\speech.ico;'
  222. Call BldObj
  223.  
  224. classname='WPProgram'
  225. title='Unmute Speech'
  226. location='<BACK_TALK>'
  227. setup='OBJECTID=<UNMUTE_SPCH>;'||,
  228.       'EXENAME='parm'\rexx\spchcmd.cmd;'||,
  229.       'PARAMETERS=COMMAND_UNMUTE;'||,
  230.       'MINIMIZED=YES;'||,
  231.       'ICONFILE='sourcedir'\speech.ico;'
  232. Call BldObj
  233.  
  234. classname='WPProgram'
  235. title='Discard Messages'
  236. location='<BACK_TALK>'
  237. setup='OBJECTID=<DISCARD_SPCH>;'||,
  238.       'EXENAME='parm'\rexx\spchcmd.cmd;'||,
  239.       'PARAMETERS=COMMAND_DISCARD;'||,
  240.       'MINIMIZED=YES;'||,
  241.       'ICONFILE='sourcedir'\speech.ico;'
  242. Call BldObj
  243.  
  244. classname='WPProgram'
  245. title='Say Queued'
  246. location='<BACK_TALK>'
  247. setup='OBJECTID=<QUEUED_SPCH>;'||,
  248.       'EXENAME='parm'\rexx\spchcmd.cmd;'||,
  249.       'PARAMETERS=COMMAND_NUMQUEUED;'||,
  250.       'MINIMIZED=YES;'||,
  251.       'ICONFILE='sourcedir'\speech.ico;'
  252. Call BldObj
  253.  
  254. classname='WPProgram'
  255. title='Say Something'
  256. location='<BACK_TALK>'
  257. setup='OBJECTID=<SPEECH>;'||,
  258.       'EXENAME='parm'\rexx\spchsnd.cmd;'||,
  259.       'PARAMETERS=[Enter text to say:];'||,
  260.       'MINIMIZED=YES;'||,
  261.       'ICONFILE='sourcedir'\speech.ico;'
  262. Call BldObj
  263.  
  264. classname='WPProgram'
  265. title='System Stats'
  266. location='<BACK_TALK>'
  267. setup='OBJECTID=<SYS_SPCH>;'||,
  268.       'EXENAME='parm'\uptime\spkstats.cmd;'||,
  269.       'PARAMETERS=COMMAND_END;'||,
  270.       'MINIMIZED=YES;'||,
  271.       'ICONFILE='sourcedir'\speech.ico;'
  272. Call BldObj
  273.  
  274. classname='WPProgram'
  275. title='Speaking Clock'
  276. location='<BACK_TALK>'
  277. setup='OBJECTID=<CLOCK_SPCH>;'||,
  278.       'EXENAME='parm'\rexx\spkclock.cmd;'||,
  279.       'MINIMIZED=YES;'||,
  280.       'ICONFILE='sourcedir'\speech.ico;'
  281. Call BldObj
  282.  
  283. a = 'PARAMETERS=-t1 [countdown time (minutes):]'
  284. b = '-l1 [laps time(seconds):] -m1 [speaking message:]'
  285. c = '-t2 [time left to fall in urgent mode(minutes):]'
  286. d = '-l2 [laps time in urgent mode (seconds):] -m2 [message in urgent mode:]'
  287. e = '-m3 [alert message when timer has stopped:];'
  288. classname='WPProgram'
  289. title='Speaking Timer'
  290. location='<BACK_TALK>'
  291. setup='OBJECTID=<TIMER_SPCH>;'||,
  292.       'EXENAME='parm'\rexx\spktimer.cmd;'||,
  293.       'MINIMIZED=YES;'||,
  294.       a b c d e||,
  295.       'CCVIEW=YES;'||,
  296.       'ICONFILE='sourcedir'\speech.ico;'
  297. Call BldObj
  298.  
  299. say 'Creating Shadow: README'
  300. if SysCreateShadow(parm'\README','<BACK_TALK>') = 0 then
  301.    say 'Error: Object not created.'
  302.  
  303. Exit
  304.  
  305. /* Build Object */
  306.  
  307. BldObj:
  308.    say 'Creating Object: 'title
  309.    result = SysCreateObject(classname, title, location, setup, 'R')
  310.    If result > 1 Then say 'Error: Object not created. Return code='result
  311. Return
  312.  
  313. /* Search 'filename' in 'path' and give error msg and error level */
  314.  
  315. Search:
  316.    parse arg filename, path
  317.    found = 0
  318.    if SysSearchPath(path,filename) = '' then do
  319.       say filename' not found.'
  320.       found = 2
  321.    end
  322. return found
  323.