My code is written in Delphi 7, but I don’t think it plays a particular role.
I try to overwrite the content of a file with WriteFile.
It works perfectly except when writing a “.dll” file and antivirus is active.
- Opening the handle to the file is still OK.
- writing is blocked : WriteFile function does not RETURN !!!
The antivirus seems to prevent from overwriting in that dll.
But, the worst is that I have to reboot the PC because my app is blocked, task manager is blocked, Windows Explorer is blocked, etc.
How can I prevent this ?
Any ideas ?
If you add digital signiture to the your executable, there is a less chance triggering the anti-virus. A lots delphi programs are mis-targeted by anti-virus software, D7 is worst.
Not sure what you are trying to write to a dll. Anti-virus don’t like extra data outside PE.
If you just need to update a dll, try rename the old dll, and write a new file, delete the old afterwards.