Recent

Author Topic: Can't overwrite executables  (Read 4838 times)

joren99

  • Newbie
  • Posts: 4
Can't overwrite executables
« on: May 03, 2015, 06:51:06 pm »
Hi everyone,

Since a few weeks, I am encountering a very annoying error in the Lazarus IDE. When I run a project for the first time (or after a startup), everything works fine. However, when I adapt something in my code, Lazarus says that he can't create the executable. In fact, the executable is still open in 'system', at least that's what it says when I try to delete the file. The strange thing is that no lazarus processes (lazarus.exe, gdb.exe,...) are running in the task control after closing Lazarus. Yet, I still can't delete the file and when I re-open Lazarus, it will still give the same error. Only a reboot fixes the problem (or renaming the project as it has to create a new exe file in that case). In related posts, I've found similar issues but those could be attributed to the 'application experience' service being turned off. However, this service is running perfectly. The really strange thing is that I'm using Lazarus now for more than a year and a half and the problems only started a few weeks ago (I can't really say an exact date).
My laptop is a Windows 7, Alienware 14 (Dell). If you need any other specifications, just ask. I don't think it is a virus or malware, last week I re-installed Windows in order to fix the problem (I am that desperate...), but it didn't help. This probably also excludes all software related issues..

Is there anyone who can think of a reason why, even after re-installing Windows, this error occurs?
Thanks!


howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Can't overwrite executables
« Reply #2 on: May 03, 2015, 07:10:43 pm »
As well as arising through over-zealous antivirus interference, sometimes these problems on Windows are caused by a service being stopped (such as the Program Compatibility Assistant service - this must normally be running if new .exes are being generated).

nsl

  • New Member
  • *
  • Posts: 16
Re: Can't overwrite executables
« Reply #3 on: May 03, 2015, 08:19:30 pm »
 I have a similar problem but only when rebuilding the ide. The new Lazarus ide is created in 'Lazarus.new.exe' but the existing 'Lazarus.exe' cannot be renamed. Trying to rename in explorer gives the response that the file is locked by 'system'. I have tried the freeware tool 'unlocker' and sysinternals process explorer. Like you this has only started recently and I'm beginning to suspect a recent Microsoft 'patch Tuesday' update to windows 7. By any chance do you use Bullguard antivirus? That could be another suspect that gets regular updates.
Lazarus 2.1 on Windows 10 / macOS Mojave

joren99

  • Newbie
  • Posts: 4
Re: Can't overwrite executables
« Reply #4 on: May 03, 2015, 09:22:34 pm »
nsl, that is exactly the problem that I have! Indeed, renaming or removing the file is impossible because the 'file is opened in system'; yet all unlocker tools that I have downloaded conclude that no program uses the file. I am indeed using Bullguard, could that be the problem? Because disabling Bullguard (and I mean a clean startup, without loading any of the Bullguard components on startup) does not solve the problem...
Thanks for your help!

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11453
  • FPC developer.
Re: Can't overwrite executables
« Reply #5 on: May 04, 2015, 12:09:44 pm »
19 times out of 20 it turns out to be security OR monitoring software.

Some security software allows to exclude directories, which can be an easy way to workaround the problem.

There is also Microsoft's antivirus (Defender). Is that disabled?

Always reboot after changing settings.

Very, very sometimes however, it is operating on files right after they have been closed. If you close a file, wait a few ms before doing anything else.
« Last Edit: May 07, 2015, 05:57:42 pm by marcov »

nsl

  • New Member
  • *
  • Posts: 16
Re: Can't overwrite executables
« Reply #6 on: May 04, 2015, 02:21:18 pm »
joren99, Seemed too much of a coincidence that we both use Bullguard. Eventually looked at Bullguard forums and found this

http://www.bullguard.com/forum/15/Problem--locked-files-with-ins_124197.html

Looks like a known problem with Bullguard- not yet solved

At the moment I'm using 'Configure Build Lazarus' to build to a different folder, renaming to 'lazarus1.exe' and moving back to main folder. With the shortcut updated to the new name this seems to work - with Lazarus 1.4.0.
Lazarus 2.1 on Windows 10 / macOS Mojave

joren99

  • Newbie
  • Posts: 4
Re: Can't overwrite executables
« Reply #7 on: May 04, 2015, 03:26:46 pm »
Nsl,

It is now confirmed: the culprit is Bullguard! The post you mentioned provided a method to disable Bullguard completely (settings -> advanced -> uncheck 'Protect components against closure' & rebooting & switching the antivirus + Behavioural scan off). Doing so solved the problem on my laptop! I will report it at the Bullguard website and hope that a fix is soon available!

Thank you so much for your posts! I never would have figured this out on my own :D

joren99

  • Newbie
  • Posts: 4
Re: Can't overwrite executables
« Reply #8 on: May 07, 2015, 05:56:08 pm »
This was their reply, we were right! :
Dear Joren,
 
 
Thank you for the e-mail. We have indeed identified an issue with executable files that are over 8 MB in size being locked by our Behavioral engine.
 
We have a fix in QA at this time and should be available in the next following days once we confirm that it indeed solves the problem and is approved for public release.

Our Support Service is available 24/7 by e-mail at support@bullguard.com and Live Chat at http://www.bullguard.com/support/live-support.aspx.

Do not hesitate to contact us if you require any additional assistance or information.

 

TinyPortal © 2005-2018