Forum > Beginners

Windows Defender Delays Start of Execution

(1/2) > >>

Elap:
When I compile and run a program using the FP IDE, there is a delay of a few seconds.

When I turn off Defender, there is no delay.

I have entered a folder exclusion of C:\FPC but it makes no difference.

Help!

H₂SO₄:

--- Quote from: Elap on July 06, 2026, 02:41:32 pm ---I have entered a folder exclusion of C:\FPC but it makes no difference.

--- End quote ---

What's in there? Your compiler-generated executable or the compiler itself?
You need to exclude the directory (or any parent) that contains the newly-generated  .exe  files since those change with every recompilation and thus alert the antivirus.

n7800:
I haven't read it, but I remember this topic being discussed on the mailing list. Maybe there's something useful there.


--- Quote from: Khrys on July 06, 2026, 03:30:09 pm ---You need to exclude the directory (or any parent) that contains the newly-generated  .exe  files since those change with every recompilation and thus alert the antivirus.

--- End quote ---

Yes, as far as I know, the generated EXE file for your program should be added to the exceptions (while the scan results for unchanged files should be cached). Try adding it (or the entire project folder) to the exceptions and check.

If you're talking about unsaved projects, they're saved to the temporary folder specified in the option: IDE Options > Environment > Files > Directory for building test projects. If the user's temporary folder is specified there, adding it to the antivirus exclusions is dangerous, as too many programs use it. Simply create a separate folder or subfolder.

PS: Of course, when we talk about disabling/excluding antivirus, these are just suggestions. You assume full responsibility for your actions.

Elap:
All my source code and executables are in subdirectories of C:\FPC which contains the compiler

Bart:
In the end what fixed it for me was to add folders where I develop (and the fpc and Lazarus folders) as an exception to defender, but not just as a folder, but also to add those as process (like: C:\devel\*

This did not have an immediate effect, but ater some days (GOKW) it helped.
All I build with Lazarus/fpc in those folders executes immediately.

If I move some executable outside of one of those places I get the delay (up to 5 seconds) in executing.

I can PM/mail you a screenshot of how it looks.

Bart

Navigation

[0] Message Index

[#] Next page

Go to full version