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

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
skywalk
Addict
Addict
Posts: 3972
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

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

Post 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.
Last edited by skywalk on Wed Oct 09, 2019 5:52 pm, edited 1 time in total.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
freak
PureBasic Team
PureBasic Team
Posts: 5929
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

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

Post by freak »

quidquid Latine dictum sit altum videtur
User avatar
skywalk
Addict
Addict
Posts: 3972
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

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

Post 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
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Little John
Addict
Addict
Posts: 4519
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

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

Post 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).
User avatar
skywalk
Addict
Addict
Posts: 3972
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

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

Post 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\
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
PureGuy
Enthusiast
Enthusiast
Posts: 102
Joined: Mon Aug 30, 2010 11:51 am

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

Post 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:
Little John
Addict
Addict
Posts: 4519
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

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

Post 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.
Post Reply