home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Intermedia 1998 January
/
inter1_98.iso
/
www
/
rozi
/
INSTBAT.TXT
< prev
next >
Wrap
Text File
|
1997-12-15
|
2KB
|
82 lines
TYTUS SOFTWARE
tel : 034 247205
e-mail: tomekr@free.polbox.pl
www : http://free.polbox.pl/t/tomekr
bbs : 034 247205 20.00 - 22.00
===============================================================================
Przykladowe programy umozliwiajace automatyczna instalacje i deinstalacje
programow rezydentnych, drajwerow itp.
===============================================================================
{Program dopisujacy polecenie PLU na koncu pliku AUTOEXEC.BAT}
program install;
uses crt,dos;
var f:file of byte;
enter,poczatek,n1,n2,n3:byte;
begin
enter:=13; {przejscie do nastepnej linii (kod ENTER'a)}
poczatek:=10; {ustawienie kursora na poczatku linii}
n1:=ord('P');
n2:=ord('L');
n3:=ord('U');
assign(f,'autoexec.bat');
reset(f);
seek(f,filesize(f));
write(f,enter,poczatek,n1,n2,n3);
close(f);
end.
===============================================================================
{Program usuwajacy polecenie PLU z pliku AUTOEXEC.BAT}
program uninstall;
uses crt,dos;
var f:file of byte;
n1,n2,n3,pusty:byte;
koniec:boolean;
l,ll:integer;
begin
pusty:=0;
assign(f,'autoexec.bat');
reset(f);
repeat
seek(f,l);
read(f,n1);
if (n1=ord('P')) or (n1=ord('p')) then
begin
read(f,n2);
read(f,n3);
if ((n2=ord('L')) or (n2=ord('l'))) and ((n3=ord('U')) or (n3=ord('u'))) then
begin
ll:=l;
koniec:=true;
end;
end;
inc(l);
until eof(f);
if koniec=true then
begin
seek(f,ll);
write(f,pusty,pusty,pusty);
end;
close(f);
end.
===============================================================================