Recent

Author Topic: TIniFile and AVG 2010 antivirus  (Read 5171 times)

Imants

  • Full Member
  • ***
  • Posts: 198
TIniFile and AVG 2010 antivirus
« on: October 16, 2010, 05:30:12 pm »
I have installed AVG 2010 anti virus and now he is scanning my ini file every time I made changes in it. If I am making multiple changes in it, it rises error that file is not accessible.
Example:

  FIni.WriteInteger(aForm.ClassName, 'WindowState', Ord(aForm.WindowState));
  FIni.WriteInteger(aForm.ClassName, 'Left', aForm.Left);
  FIni.WriteInteger(aForm.ClassName, 'Top', aForm.Top);

If I am making little brakes between writes then its all right. Because anti virus have finished cheeking that my ini file is not virus.

  FIni.WriteInteger(aForm.ClassName, 'WindowState', Ord(aForm.WindowState));
  Sleep(100);
  FIni.WriteInteger(aForm.ClassName, 'Left', aForm.Left);
  Sleep(100);
  FIni.WriteInteger(aForm.ClassName, 'Top', aForm.Top);
  Sleep(100);

Is there any better solution for this problem

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: TIniFile and AVG 2010 antivirus
« Reply #1 on: October 16, 2010, 05:34:33 pm »
Put your ini file on the antivirus list.

OpenLieroXor

  • New Member
  • *
  • Posts: 38
Re: TIniFile and AVG 2010 antivirus
« Reply #2 on: October 16, 2010, 05:44:46 pm »
Use TMemIniFile class. It buffers all changes in ram until you call UpdateFile method, then they are saved to the file together. BTW, if AVG blocks access to files and thus makes application crash, this antivirus sucks! :o

BlueIcaro

  • Hero Member
  • *****
  • Posts: 834
    • Blog personal
Re: TIniFile and AVG 2010 antivirus
« Reply #3 on: October 16, 2010, 08:24:32 pm »
Use TMemIniFile class. It buffers all changes in ram until you call UpdateFile method, then they are saved to the file together. BTW, if AVG blocks access to files and thus makes application crash, this antivirus sucks! :o

I think so, it's a problem of AVG, I think you can report it to AVG developers.

/BlueIcaro

Imants

  • Full Member
  • ***
  • Posts: 198
Re: TIniFile and AVG 2010 antivirus
« Reply #4 on: October 16, 2010, 08:52:19 pm »
It is not that it makes application crash. It is only monitoring any changes to files and check them. The problem is that every write action changes ini file and AVG checks it and locks access to it. And if there are two or more flowing changes in same file crashes because file is locked after first change.

I just write it here because if I simply put this file in exclude list then this problem could occur in other computers with same or similar anti virus.

P.S.
TMemIniFile solved the problem :)
« Last Edit: October 16, 2010, 09:06:05 pm by Imants »

 

TinyPortal © 2005-2018