home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 3 Comm / 03-Comm.zip / romes100.zip / install.cmd < prev    next >
OS/2 REXX Batch file  |  1999-09-12  |  5KB  |  172 lines

  1. /* Install of RoboticsMessenger/2 */
  2.  
  3. call RxFuncAdd "SysLoadFuncs", "REXXUTIL", "SysLoadFuncs"
  4. call SysLoadFuncs
  5.  
  6. CALL SysCls
  7.  
  8. say 'Rexx Installer for RoboticsMessenger/2'
  9. say '--------------------------------------------'
  10. say
  11. say '   Installation...'
  12. say
  13. say '   copies files to destination directory'
  14. say '   creates folder and objects on desktop'
  15. say '   makes the settings for correct operation'
  16. say
  17. say '   Please read the supplied information'
  18. say '   file for correct operation'
  19. say
  20.  
  21. /* Ask Directory */
  22.  
  23. say 'Enter target directory (e.g.: C:\ROMES):'
  24. say '(<return> = current directory, object creation only, no copy operation)'
  25. PARSE PULL InstDir
  26. InstDir = STRIP(InstDir, 'T', '\')
  27.  
  28. IF InstDir="" THEN
  29.  DO
  30.    InstDir=directory()
  31.    SIGNAL MakeIcons
  32.  END
  33.  
  34. /* Create Directory */
  35. say
  36. say '--------------------------------------------'
  37. say 'creating directories'
  38. say '--------------------------------------------'
  39.  
  40. if InstDir <> "." then
  41.    DO
  42.      call SysFileTree InstDir, "SearchDir", "D"
  43.      if SearchDir.0 = 0 then do
  44.          rc = SysMkDir(InstDir)
  45.             if rc <> 0 then do
  46.                  say "Error: Cannot create directory!" InstDir
  47.                  exit
  48.             end
  49.      end
  50. end
  51.  
  52. /* Copy files */
  53. say
  54. say '--------------------------------------------'
  55. say 'copying files'
  56. say '--------------------------------------------'
  57.  
  58. '@Copy ROMES.exe 'InstDir'\ROMES.exe'
  59. '@Copy Splitdump.exe 'InstDir'\splitdump.exe'
  60. '@Copy ROMES.INF 'InstDir'\ROMES.INF'
  61. '@Copy convert.cmd 'InstDir'\convert.cmd'
  62. '@Copy faxview.cmd 'InstDir'\faxview.cmd'
  63. '@Copy faximg.dll 'InstDir'\faximg.dll'
  64. '@Copy faxlog.dll 'InstDir'\faxlog.dll'
  65. '@Copy faxpm.dll 'InstDir'\faxpm.dll'
  66. '@Copy faxrtl.dll 'InstDir'\faxrtl.dll'
  67. '@Copy faxproc.dll 'InstDir'\faxproc.dll'
  68. '@Copy faxview.dll 'InstDir'\faxview.dll'
  69. '@Copy faxview.exe 'InstDir'\faxview.exe'
  70. '@Copy frec.cfg 'InstDir'\frec.cfg'
  71. '@Copy frec.dll 'InstDir'\frec.dll'
  72. '@Copy frec.exe 'InstDir'\frec.exe'
  73. '@Copy fontedit.exe 'InstDir'\fontedit.exe'
  74. '@Copy gsm.zip 'InstDir'\gsm.zip'
  75. '@Copy pcm2wav.dll 'InstDir'\pcm2wav.dll'
  76. '@Copy pcm2wav.exe 'InstDir'\pcm2wav.exe'
  77. '@Copy pcm2wav.ico 'InstDir'\pcm2wav.ico'
  78. '@Copy ROMESFOLD1.ICO 'InstDir'\ROMESFOLD1.ICO'
  79. '@Copy ROMESFOLD2.ICO 'InstDir'\ROMESFOLD2.ICO'
  80. '@mkdir 'InstDir'\FAX'
  81. '@mkdir 'InstDir'\VOICE'
  82.  
  83. MakeIcons:
  84. /* Make icons */
  85. say
  86. say '--------------------------------------------'
  87. say 'creating icons'
  88. say '--------------------------------------------'
  89.  
  90.  
  91. classname = 'WPFolder'
  92. title     = 'Robotics^Messenger/2'
  93. location  = '<WP_DESKTOP>'
  94. icon1     = InstDir||'\ROMESFOLD1.ICO'
  95. icon2     = InstDir||'\ROMESFOLD2.ICO'
  96. icon      = 'ICONFILE='icon1||';ICONNFILE=1,'||icon2
  97. folderid  = '<ROMES2_FOLDER>'
  98. setup     = 'OBJECTID='||folderid||';'||icon
  99. rc        = SysCreateObject(classname, title, location ,setup,'U')
  100.  
  101. classname = 'WPProgram'
  102. title     = 'Romes Information'
  103. location  = '<ROMES2_FOLDER>'
  104. infname   = InstDir||'\ROMES.INF' 
  105. WorkDir   = InstDir
  106. setup     = 'OBJECTID=<ROMES_INF>;EXENAME=VIEW.EXE;PARAMETERS='||infname||';STARTUPDIR='WorkDir
  107. rc        = SysCreateObject(classname, title, folderid, setup,'U')
  108.  
  109. classname = 'WPProgram'
  110. location  = '<ROMES2_FOLDER>'
  111. title     = 'Robotics^Messenger/2'
  112. exename   = 'EXENAME='||InstDir||'\ROMES.EXE'
  113. WorkDir   = InstDir
  114. setup     = 'OBJECTID=<ROMES2_PROGRAM>;STARTUPDIR='||InstDir||';STARTUPDIR='||Workdir||';'||exename
  115. rc        = SysCreateObject(classname, title, folderid, setup, 'U')          
  116.  
  117. classname = 'WPProgram'
  118. location  = '<ROMES2_FOLDER>'
  119. title     = 'Faxview'
  120. exename   = 'EXENAME='||InstDir||'\Faxview.EXE'
  121. WorkDir   = InstDir
  122. setup     = 'OBJECTID=<FaxView_PROGRAM>;STARTUPDIR='||InstDir||';STARTUPDIR='||Workdir||';'||exename
  123. rc        = SysCreateObject(classname, title, folderid, setup, 'U')          
  124.  
  125. if stream( InstDir||'\convert.cmd', "c", "QUERY EXIST" ) <> "" then
  126.  do
  127.    do i = 1 until lines(InstDir||'\convert.cmd') = 0
  128.        file_old.i=linein(InstDir||'\convert.cmd')
  129.    end
  130.    call stream InstDir||'\convert.cmd', "c", "CLOSE"
  131.    file_old.0=i
  132.  
  133.    call SysFileSearch 'D:\ROMES', InstDir||'\convert.cmd', 'file_new.', 'N'
  134.    do i=1 to file_new.0
  135.      position=lastpos('D:\ROMES', file_new.i)
  136.      file_new.i=delstr(file_new.i,position,8)
  137.      file_new.i=insert(InstDir,file_new.i,position-1)
  138.      PARSE VALUE file_new.i WITH line " " file_new.i
  139.      file_new.i=STRIP(file_new.i)
  140.      file_old.line=file_new.i
  141.    end
  142.  
  143.    call SysFileDelete(InstDir||'\convert.cmd')
  144.    do i=1 to file_old.0
  145.      call lineout InstDir||'\convert.cmd', file_old.i
  146.    end
  147.  end
  148.  
  149. if stream( InstDir||'\frec.cfg', "c", "QUERY EXIST" ) <> "" then
  150.  do
  151.    do i = 1 until lines(InstDir||'\frec.cfg') = 0
  152.        file_old.i=linein(InstDir||'\frec.cfg')
  153.    end
  154.    call stream InstDir||'\frec.cfg', "c", "CLOSE"
  155.    file_old.0=i
  156.  
  157.    call SysFileSearch 'D:\ROMES', InstDir||'\frec.cfg', 'file_new.', 'N'
  158.    do i=1 to file_new.0
  159.      position=lastpos('D:\ROMES', file_new.i)
  160.      file_new.i=delstr(file_new.i,position,8)
  161.      file_new.i=insert(InstDir,file_new.i,position-1)
  162.      PARSE VALUE file_new.i WITH line " " file_new.i
  163.      file_new.i=STRIP(file_new.i)
  164.      file_old.line=file_new.i
  165.    end
  166.  
  167.    call SysFileDelete(InstDir||'\frec.cfg')
  168.    do i=1 to file_old.0
  169.      call lineout InstDir||'\frec.cfg', file_old.i
  170.    end
  171.  end
  172.