VIENNA, Austria (AP) _ Writer Thomas Bernhard, who lived in isolation and died in secrecy, declared in his will that he and his works will have nothing more to do with Austria.

The will, disclosed Friday, forbids the sale, performance or reading in Austria of any of his 55 known novels, plays and collections of verse or of any works discovered after his death.

Bernhard had suffered from a serious, undisclosed lung disease for almost 40 years and died Sunday, three days after his 58th birthday. His death was not announced until Thursday in accordance with his wish to be buried before the world learned he had died, relatives said.

Vienna bookshops reported a run Friday on Bernhard's most recent novel, ''On The Heights'' and his controversial play ''Heldenplatz.''

The Austria Press Agency said Bernhard, the illegitimate child of a Salzburg woman who died in 1950, was buried Thursday morning in Vienna in the presence of three people who were not identified.

''I expressly state that I do not want to have anything to do with the state of Austria,'' he said in the will. It forbids the publication, distribution, reading or performance of any of his works ''within the borders of the Austrian state, whatever form this state takes.''

Peter Fabjan, Bernhard's half-brother, said he considered the will legal and neither he nor other relatives would not contest it.

Fabjan added, however, that he interpreted the ban to cover only publication of new editions of Bernhard's works and new productions of his plays.

Austrian radio said legal experts must examine contracts between Bernhard and various theaters and publishers before deciding on the document's legality.

The premiere of ''Heldenplatz'' last fall at the Burgtheater in Vienna was surrounded by controversy because of its fierce attacks on anti-Semitism in Austria and on the the political, cultural and church establishments.

Bernhard lived on a farm about 180 miles west of Vienna and had a history of conflict with his homeland.

After a former friend sued him for defamation in 1984, Bernhard declared that his play ''Woodcutters'' could not be distributed in Austria. The case was settled out of court in February 1985, but he did not lift the ban until August of that year.