home *** CD-ROM | disk | FTP | other *** search
/ Intermedia 1998 January / inter1_98.iso / www / rozi / INSTBAT.TXT < prev    next >
Text File  |  1997-12-15  |  2KB  |  82 lines

  1.         TYTUS SOFTWARE
  2. tel   : 034 247205
  3. e-mail: tomekr@free.polbox.pl
  4. www   : http://free.polbox.pl/t/tomekr
  5. bbs   : 034 247205      20.00 - 22.00
  6.  
  7. ===============================================================================
  8.  
  9. Przykladowe programy umozliwiajace automatyczna instalacje i deinstalacje
  10. programow rezydentnych, drajwerow itp.
  11.  
  12. ===============================================================================
  13.  
  14. {Program dopisujacy polecenie PLU na koncu pliku AUTOEXEC.BAT} 
  15.  
  16. program install;
  17. uses crt,dos;
  18. var f:file of byte;
  19. enter,poczatek,n1,n2,n3:byte;
  20.  
  21. begin
  22. enter:=13;          {przejscie do nastepnej linii (kod ENTER'a)}
  23. poczatek:=10;       {ustawienie kursora na poczatku linii}
  24. n1:=ord('P');
  25. n2:=ord('L');
  26. n3:=ord('U');
  27.  
  28. assign(f,'autoexec.bat');
  29. reset(f);
  30. seek(f,filesize(f));
  31. write(f,enter,poczatek,n1,n2,n3);
  32.  
  33. close(f);
  34.  
  35. end.
  36.  
  37. ===============================================================================
  38.  
  39. {Program usuwajacy polecenie PLU z pliku AUTOEXEC.BAT}
  40.  
  41. program uninstall;
  42. uses crt,dos;
  43. var f:file of byte;
  44. n1,n2,n3,pusty:byte;
  45. koniec:boolean;
  46. l,ll:integer;
  47.  
  48. begin
  49. pusty:=0;
  50.  
  51. assign(f,'autoexec.bat');
  52. reset(f);
  53.  
  54. repeat
  55. seek(f,l);
  56. read(f,n1);
  57. if (n1=ord('P')) or (n1=ord('p')) then
  58. begin
  59. read(f,n2);
  60. read(f,n3);
  61. if ((n2=ord('L')) or (n2=ord('l'))) and ((n3=ord('U')) or (n3=ord('u'))) then
  62. begin
  63. ll:=l;
  64. koniec:=true;
  65. end;
  66. end;
  67.  
  68. inc(l);
  69.  
  70. until eof(f);
  71.  
  72. if koniec=true then
  73. begin
  74. seek(f,ll);
  75. write(f,pusty,pusty,pusty);
  76. end;
  77.  
  78. close(f);
  79.  
  80. end.
  81.  
  82. ===============================================================================