Page 1 of 1

Microsoft Security Essentials Issue

Posted: Wed May 02, 2012 6:23 pm
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

Re: Microsoft Security Essentials Issue

Posted: Wed May 02, 2012 6:58 pm
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.

Re: Microsoft Security Essentials Issue

Posted: Wed May 02, 2012 8:36 pm
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

Re: Microsoft Security Essentials Issue

Posted: Wed May 02, 2012 8:37 pm
by Danilo
See above: compiler option "Create temporary executable in the source directory" ;)

Re: Microsoft Security Essentials Issue

Posted: Wed May 02, 2012 8:57 pm
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.

Re: Microsoft Security Essentials Issue

Posted: Wed May 02, 2012 9:07 pm
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

Re: Microsoft Security Essentials Issue

Posted: Wed May 02, 2012 9:15 pm
by IdeasVacuum
an attacker could name his virus "TEMP\PureBasic_Compilation0.exe
...would not surprise me :lol:

Re: Microsoft Security Essentials Issue

Posted: Wed May 02, 2012 9:20 pm
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

Re: Microsoft Security Essentials Issue

Posted: Wed May 02, 2012 9:35 pm
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). :)