Microsoft Security Essentials Issue

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
blueb
Addict
Addict
Posts: 1111
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Microsoft Security Essentials Issue

Post by blueb »

Noticed a real slowdown in both my laptop and home computer. (Win7 Pro)

Found out that where PureBasic creates PureBasic_Compilation0.exe is the problem.
(Looks like MSE spends some time scanning the file)

----------------------------------------------------------------------------------------------------
Since Microsoft Security Essentials is very popular perhaps this should be a sticky, or
when PureBasic compiles our code it could see that MSE is running and suggest to:

Go to:
- 'Excluded Files and Locations' on the Settings Folder of MSE
- Add: C:\Users\Bob\AppData\Local\Temp <<< where ever 'PureBasic_Compilation0.exe' is created

This worked well for me.

--Bob
- It was too lonely at the top.

System : PB 6.21(x64) and Win 11 Pro (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: Microsoft Security Essentials Issue

Post by Danilo »

I wouldn't recommend excluding the whole TEMP folder.

Better use the compiler option "Create temporary executable in the source directory"
for you sources. You can set this option as default in the IDE options.
With this option enabled, start of your compiled program is very fast again.

For excluding PureBasic itself from Microsoft Security Essentials scan (so compilation is faster),
see PB compilation problems with MSE.
Last edited by Danilo on Wed May 02, 2012 8:37 pm, edited 1 time in total.
User avatar
blueb
Addict
Addict
Posts: 1111
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Re: Microsoft Security Essentials Issue

Post by blueb »

Danilo wrote:I wouldn't recommend excluding the whole TEMP folder.
Yes... I've been giving this some thought.

Can the PureBasic compiler be made to create a temporary EXE in another folder than the default Windows temp folder?


Thanks,
--Bob
- It was too lonely at the top.

System : PB 6.21(x64) and Win 11 Pro (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: Microsoft Security Essentials Issue

Post by Danilo »

See above: compiler option "Create temporary executable in the source directory" ;)
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Microsoft Security Essentials Issue

Post by IdeasVacuum »

Unfortunately "Create temporary executable in the source directory" does not help, because MSE does intercept 'PureBasic_Compilation0.exe'.

Perhaps a solution is to use a home made folder specifically for 'PureBasic_Compilation0.exe'?

Edit: I should mention that MSE has started slowing down PB compiling significantly in the last few weeks or so - before that, probably had an effect but only 1 or 2 seconds. So, seems that MSE is working harder! Added PureBasic.exe to the Exclude Process list and that has speeded-up things considerably, back to the 1 or 2 seconds mark (for around 10,000 code lines). That's fine for me.
Last edited by IdeasVacuum on Wed May 02, 2012 9:13 pm, edited 1 time in total.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: Microsoft Security Essentials Issue

Post by Danilo »

IdeasVacuum wrote:Unfortunately "Create temporary executable in the source directory" does not help, because MSE does intercept 'PureBasic_Compilation0.exe'.
Works perfectly here. Of course only for saved sourced, because unsaved sources are still created in TEMP.

You can exclude 'TEMP\PureBasic_Compilation0.exe' if you want, but we already said that in the other topic.

It is a slightly higher risk because an attacker could name his virus "TEMP\PureBasic_Compilation0.exe". :D
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Microsoft Security Essentials Issue

Post by IdeasVacuum »

an attacker could name his virus "TEMP\PureBasic_Compilation0.exe
...would not surprise me :lol:
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
blueb
Addict
Addict
Posts: 1111
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Re: Microsoft Security Essentials Issue

Post by blueb »

It'd be nicer if we could have 'our' own folder as I noticed that I had:
TEMP\PureBasic_Compilation0.exe
TEMP\PureBasic_Compilation1.exe
TEMP\PureBasic_Compilation2.exe
TEMP\PureBasic_Compilation3.exe
TEMP\PureBasic_Compilation4.exe
TEMP\PureBasic_Compilation5.exe
in my temp folder.

Apparently PureBasic fires off a new EXE for every file in my IDE.

They do clear where I leave the IDE.

--Bob
- It was too lonely at the top.

System : PB 6.21(x64) and Win 11 Pro (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: Microsoft Security Essentials Issue

Post by Danilo »

Danilo wrote:Maybe using

Code: Select all

GetEnvironmentVariable("APPDATA")+"\PureBasic\TEMP\"
would be a better place instead general TEMP directory.
No, it's not. Just tested it, it is as slow as TEMP. It takes round about 4-5 seconds now
when started from within the IDE, same as TEMP!

I have my source code folder on d:\ and everything is fine and very fast
with compiler option "Create temporary executable in the source directory".

The same compiler option used for files in TEMP or GetEnvironmentVariable("APPDATA")+"\PureBasic\TEMP\"
is very slow. Using the system drive for compilation seems to be the issue!?

This code starts immediately:

Code: Select all

Debug GetEnvironmentVariable("APPDATA")+"\PureBasic\TEMP\"
This code starts very slowly (4 to 5 seconds here):

Code: Select all

If OpenWindow(0, 0, 0, 800, 600, "PicHide", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
The last code saved to d:\ and enabled compiler option "Create temporary executable in the source directory"
starts immediately (0 seconds). :)
Post Reply