home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / owf.zip / install.cmd < prev    next >
OS/2 REXX Batch file  |  1997-03-13  |  4KB  |  173 lines

  1. /* install-script for Object WorkFrame*/
  2.  
  3. Call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  4. Call SysLoadFuncs
  5.  
  6.  
  7. say "Instalation of Object WorkFrame starts..."
  8.  
  9. path = directory();
  10. PARSE UPPER VAR path path;
  11. SAY "Enter the path where you : (press enter for path: " path ")"
  12. PULL pathFrom;
  13. IF pathFrom = "" THEN
  14.     pathFrom = path;
  15.  
  16. again:
  17.  
  18. SAY "Enter a path where Object WorkFrame should be installed (X=exit):"
  19. PULL pathTo;
  20.  
  21. IF pathTo = "" 
  22.     then do
  23.         say "please enter a path to copy the files to"
  24.         signal again;
  25.     end 
  26.  
  27. IF pathTo = "X"
  28.     then exit;
  29.  
  30. message:
  31.  
  32. say "Are you shure to install Object WorkFrame from <" pathFrom "> to <" pathTo "< ? (Y)es/(N)o/(E)xit";
  33. pull response;
  34. if response = "Y" then
  35.     do    
  36.         if pathTo = pathFrom then    /*dont copy files into themselfs*/
  37.             signal register;
  38.  
  39.         dummy = directory( pathTo );
  40.         if dummy = "" then
  41.             do
  42.                 /* create directory*/
  43.                 rc = SysMkDir( pathTo);    
  44.                 if(rc > 0)    /*error occured*/
  45.                     then do
  46.                         say "could not create directory " pathTo " errorcode was: " rc;
  47.                         exit;
  48.                     end;
  49.             end
  50.  
  51.         say coping files;
  52.         copyPath = insert(pathFrom, "\addfile.exe");
  53.         copy copyPath pathTo;
  54.  
  55.         copyPath = insert(pathFrom, "\wf.exe");
  56.         copy copyPath pathTo;
  57.  
  58.         copyPath = insert(pathFrom, "\browse.exe");
  59.         copy copyPath pathTo;
  60.  
  61.         copyPath = insert(pathFrom, "\makemake.exe");
  62.         copy copyPath pathTo;
  63.  
  64.         copyPath = insert(pathFrom, "\neglist.exe");
  65.         copy copyPath pathTo;
  66.  
  67.         copyPath = insert(pathFrom, "\watlink.exe");
  68.         copy copyPath pathTo;
  69.  
  70.         copyPath = insert(pathFrom, "\oolw3i03.dll");
  71.         copy copyPath pathTo;
  72.  
  73.         copyPath = insert(pathFrom, "\oolc3i03.dll");
  74.         copy copyPath pathTo;
  75.  
  76.         copyPath = insert(pathFrom, "\ibm_cpp.ini");
  77.         copy copyPath pathTo;
  78.  
  79.         copyPath = insert(pathFrom, "\emx_gcc.ini");
  80.         copy copyPath pathTo;
  81.  
  82.         copyPath = insert(pathFrom, "\wpp.ini");
  83.         copy copyPath pathTo;
  84.  
  85.         copyPath = insert(pathFrom, "\wcc.ini");
  86.         copy copyPath pathTo;
  87.  
  88.         copyPath = insert(pathFrom, "\neglist.lst");
  89.         copy copyPath pathTo;
  90.  
  91.         copyPath = insert(pathFrom, "\wf.lst");
  92.         copy copyPath pathTo;
  93.  
  94.         copyPath = insert(pathFrom, "\wf.cfg");
  95.         copy copyPath pathTo;
  96.  
  97.         copyPath = insert(pathFrom, "\emx.cfg");
  98.         copy copyPath pathTo;
  99.  
  100.         copyPath = insert(pathFrom, "\make.hlp");
  101.         copy copyPath pathTo;
  102.  
  103.         copyPath = insert(pathFrom, "\wf.hlp");
  104.         copy copyPath pathTo;
  105.  
  106.         copyPath = insert(pathFrom, "\editor.bmp");
  107.         copy copyPath pathTo;
  108.  
  109.         copyPath = insert(pathFrom, "\debug.bmp");
  110.         copy copyPath pathTo;
  111.  
  112.         copyPath = insert(pathFrom, "\run.bmp");
  113.         copy copyPath pathTo;
  114.  
  115.         copyPath = insert(pathFrom, "\make.bmp");
  116.         copy copyPath pathTo;
  117.  
  118.         copyPath = insert(pathFrom, "\install.cmd");
  119.         copy copyPath pathTo;
  120.  
  121.         copyPath = insert(pathFrom, "\neglist.def");
  122.         copy copyPath pathTo;
  123.  
  124.         copyPath = insert(pathFrom, "\watlink.doc");
  125.         copy copyPath pathTo;
  126.  
  127.         copyPath = insert(pathFrom, "\readme.txt");
  128.         copy copyPath pathTo;
  129.  
  130.         copyPath = insert(pathFrom, "\wf.df");
  131.         copy copyPath pathTo;
  132.  
  133.         copyPath = insert(pathFrom, "\template");
  134.         dirTo = insert(pathTo, "\template\");
  135.         xcopy "/E /S" copyPath dirTo;
  136.  
  137.     END
  138. else
  139.     do
  140.         if response = "E" then    /*Exit*/
  141.             exit;
  142.         else /*jump to the beginning*/
  143.             signal again;
  144.     end
  145.  
  146. register:    
  147. curDir = pathTo;
  148.  
  149. instPath = 'ASSOCFILTER=*.OWF;EXENAME=';
  150.  
  151. instPath = insert(instPath, curDir);
  152. instPath = insert(instPath, '\wf.exe;STARTUPDIR=');
  153. instPath = insert(instPath, curDir);
  154.  
  155.  
  156. SysIni( 'USER', 'Object WorkFrame', 'InstPath', curDir);
  157. SysIni( 'OWF.INI', 'Object WorkFrame', 'FONT1', "8.Helv");
  158. SysIni( 'OWF.INI', 'Object WorkFrame', 'FONT2', "8.Courier");
  159. SysIni( 'OWF.INI', 'Object WorkFrame', 'FONT3', "8.Helv");
  160.  
  161. say "registering ObjectWorkFrame..."
  162. if SysCreateObject('WPProgram', 'Object WorkFrame', '<WP_DESKTOP>', instPath) then
  163.   say "program registered";
  164. else
  165.   say "registering Object WorkFrame failed, perhaps allready installed"
  166.  
  167. if SysCreateObject('WPDataFile', 'ObjectWorkFrame.OWF', '<WP_TEMPS>', 'TEMPLATE=YES') then
  168.   say "template registered"
  169. else
  170.   say "registering template failed, perhaps allready installed\n"
  171.  
  172. say "installation complete"
  173.