Page 1 of 1

[IDE-v571]Allow user defined temp executable path.

Posted: Tue Sep 15, 2015 4:37 pm
by skywalk
Really annoying to be assailed by slowdowns with antivirus scanning of PureBasic_CompilationX.exe.
I can whitelist the exe but not for all user paths and not for all possible source directories.
So much easier if the IDE allows a generic path for all temp exe's.

Re: [IDE-v54]Allow user defined temp executable path.

Posted: Tue Sep 15, 2015 4:49 pm
by freak

Re: [IDE-v54]Allow user defined temp executable path.

Posted: Tue Sep 15, 2015 5:28 pm
by skywalk
Yes, tried that and failed(I also use /portable). That is why I made this feature request. :wink:
My search saw several requests of similar nature but worded differently.
If not for antivirus, I would be fine with:
[x] Create temporary executable in the source directory

Re: [IDE-v54]Allow user defined temp executable path.

Posted: Wed Sep 16, 2015 9:21 am
by Little John
skywalk wrote:Yes, tried that and failed(I also use /portable).
Hello skywalk,

please try launching the PB IDE from the following batch file

Code: Select all

@ECHO OFF
SET tmp=C:\Users\John\Tmp Test\
ECHO %tmp%
"C:\Program Files\PureBasic\PureBasic.exe" /PORTABLE
PAUSE
Notes:
  • The 2nd line must point to an existing directory, of course. Even if the name contains spaces, it doesn't have to be enclosed in double quotes.
  • The 4th line contains the full path to the PB IDE (enclosed in double quotes, if it contains spaces) plus any optional arguments.
  • The 3rd and the 5th line are only for testing.
  • The new value of the tmp environment variable is only valid for any programs that are called from inside this batch file.
  • I've tested this batch file successfully with PB 5.31 and PB 5.40 beta 3 on Windows XP and Windows 10.
If the batch file does not work for you, please tell me which Windows version you are using, what the exact content of your batch file is, what the console output is, and what the output of

Code: Select all

Debug GetEnvironmentVariable("tmp")
is (executed with the PB IDE which was launched from the batch file).

Re: [IDE-v54]Allow user defined temp executable path.

Posted: Wed Sep 16, 2015 5:33 pm
by skywalk
Yes, both temp paths are created and returned by the pb executable, but the executable is still run from the source directory regardless of my user preferences. But, PB_EditorOutput.pb is redirected to the temp path. :shock:
Tried with x86 v531 and v54b3 on Windows 7 Enterprise.
try.pb wrote:

Code: Select all

SetClipboardText(ProgramFilename() + #CRLF$ + GetEnvironmentVariable("tmp") + #CRLF$ + GetEnvironmentVariable("temp"))
cmd file: wrote:

Code: Select all

SET tmp=C:\apb\tmp\
SET temp=C:\apb\tmp\
C:\PureBasic\PureBasic.exe /portable
IDE started with cmd:
Preference setting = [ ] Create temporary executable in the source directory
tmp, temp paths = C:\apb\tmp\
exe = C:\apb\try\PureBasic_Compilation0.exe
PB_EditorOutput.pb goes -> C:\apb\tmp\

IDE started from original install link:
Preference setting = [±] Create temporary executable in the source directory
tmp, temp paths = C:\Users\me\AppData\Local\Temp
exe = C:\apb\try\PureBasic_Compilation0.exe
PB_EditorOutput.pb goes -> C:\Users\me\AppData\Local\Temp\

Re: [IDE-v54]Allow user defined temp executable path.

Posted: Wed Sep 16, 2015 7:24 pm
by PureGuy
Changing temp environment variables every IDE start can't be any solution.

There could be a new variable let's call it "PB_Debug_TempFile" that holds the path of temp executable.

Implementing this would not not break anything and takes less the 3 minutes.
Certainly less time that Fred and freak take to read these Feature Requests and ignores them
over and over again :twisted:

Re: [IDE-v54]Allow user defined temp executable path.

Posted: Sun Sep 20, 2015 11:55 pm
by Little John
Yes, both temp paths are created and returned by the pb executable, but the executable is still run from the source directory regardless of my user preferences.
OK, so the environment variables are set by Windows as expected, but the PB compiler doesn't use them as expected on your system.
That's strange. I think only Fred or Freak can tell the reason why this happens.