Page 1 of 1

Change Compiler Temp Folder / Can I?

Posted: Mon Nov 24, 2025 3:56 am
by Randy Walker
Is there a setting somewhere that I can't find? I want to have the compiler use a different path than the %Temp% folder, So I can tell my AV don't bug me, or my Project development.

Re: Change Compiler Temp Folder / Can I?

Posted: Mon Nov 24, 2025 5:14 am
by idle
You should be able to launch PB via a bat file and set tmp, temp to where ever you want

purebasic.bat

Code: Select all

SET "TEMP=C:\PureBasic\Temp"
SET "TMP=C:\PureBasic\Temp"
"C:\PureBasic\PureBasic.exe"

Re: Change Compiler Temp Folder / Can I?

Posted: Mon Nov 24, 2025 6:01 am
by BarryG
There's a prefs setting to create the executable in the same folder as the source file, if that's what you mean? I do that and told Windows Defender not to scan that folder. And also whitelist "PureBasic.exe" and its "Compilers" folder with your anti-virus app.

Despite doing this, you still need to put your final exe into VirusTotal.com to see what your users are going to be warned about. Then whitelist your exe with the anti-virus companies that VirusTotal shows.

Re: Change Compiler Temp Folder / Can I?

Posted: Mon Nov 24, 2025 6:21 am
by Randy Walker
BarryG wrote: Mon Nov 24, 2025 6:01 am There's a prefs setting to create the executable in the same folder as the source file, if that's what you mean? I do that and told Windows Defender not to scan that folder. And also whitelist "PureBasic.exe" and its "Compilers" folder with your anti-virus app.

Despite doing this, you still need to put your final exe into VirusTotal.com to see what your users are going to be warned about. Then whitelist your exe with the anti-virus companies that VirusTotal shows.
If that's the best I can get, it will have to do. I was hoping to give it a dedicated folder. I gave up trying to deal with defender and installed Comodo Internet Security so defender would just STFU. I can manage Comodo. No dealing with defender at all. I can't imagine how you did that.
Thanks BarryG!!!

Re: Change Compiler Temp Folder / Can I?

Posted: Mon Nov 24, 2025 8:51 am
by BarryG
I go through this whitelist dance submission every time I release an update to my app. :( Luckily it's not too hard as I only get two false-positives each time (usually Microsoft and McAfee), and both white-list it within a few days. I submit a week away these days, like if I submitted on Jan 1 then I'd wait till Jan 8 to publically release, so it gives both anti-virus companies a lot of time to push the white-list to their end-users.

Re: Change Compiler Temp Folder / Can I?

Posted: Mon Nov 24, 2025 11:31 am
by Axolotl
Yes, I asked for adjustable "compile to folder" path some time ago. And I am not the only one.

For your Info (I'm sure most of you know that):
The setting “Create temporary executable in source directory” still uses the temporary directory for <New*> (unsaved) files, since there is no source directory.

Re: Change Compiler Temp Folder / Can I?

Posted: Mon Nov 24, 2025 8:12 pm
by Randy Walker
Axolotl wrote: Mon Nov 24, 2025 11:31 am Yes, I asked for adjustable "compile to folder" path some time ago. And I am not the only one.

For your Info (I'm sure most of you know that):
The setting “Create temporary executable in source directory” still uses the temporary directory for <New*> (unsaved) files, since there is no source directory.
Bummer :cry:

Re: Change Compiler Temp Folder / Can I?

Posted: Mon Nov 24, 2025 8:21 pm
by Randy Walker
The really unfortunate part here is any new changes in the PB design will not be retroactive and i am stuck in ver 5.x forever since I cannot get my code to adapt to 6.x now.

Re: Change Compiler Temp Folder / Can I?

Posted: Mon Nov 24, 2025 10:57 pm
by idle
The bat file method works what's the problem?
output is redirected to the folder you chose and the compiler creates it's temp compile folder and output files under that folder.

Re: Change Compiler Temp Folder / Can I?

Posted: Tue Nov 25, 2025 2:11 am
by Randy Walker
idle wrote: Mon Nov 24, 2025 10:57 pm The bat file method works what's the problem?
output is redirected to the folder you chose and the compiler creates it's temp compile folder and output files under that folder.
Maybe you could provide a working bat file method. I tried and could not get it working.

Re: Change Compiler Temp Folder / Can I?

Posted: Tue Nov 25, 2025 3:09 am
by idle
the link above viewtopic.php?p=648267#p648267

make Temp folder where you want it, where you have write permission as in not program files
edit the paths and save it as purebasic.bat then you can run the bat file via cmd.exe or
edit your PB shortcut to point to the bat file.

Re: Change Compiler Temp Folder / Can I?

Posted: Tue Nov 25, 2025 6:16 am
by Randy Walker
One little problem with that -- I had already set the compiler default to use the source directory, and that in turn corrupted every source file I ran with a line that says:
; CompileSourceDirectory
So my new bat file did not work, until I decorrupted the source file by removing that line.
BTW... I had to add a line to that bat file so the cmd window would close automatically.

Code: Select all

@echo off

:: Your dedicated PureBasic temp folder
SET "TEMP=D:\PBTemp"
SET "TMP=D:\PBTemp"

:: Launch PureBasic (default installation path)
"C:\Program Files\PureBasic540\PureBasic540x64.exe"
exit
THANKS for the hint!!!

Re: Change Compiler Temp Folder / Can I?

Posted: Mon Dec 01, 2025 11:38 am
by Axolotl
Yes, thanks for the hints.
Using it with my small RAM-Disk for PB compilation only.
My PBStart.cmd is a little more complex...
Since I use different PB versions via shortcuts, the launching in the script looks like this...

Code: Select all

REM ... Checking existance and SET to temp temp folders.....  
REM Shortcut/Script-Call uses several/different parameter: eg. <PB-Exe> /NOEXT 
START %*
TIMEOUT /T 5 
GOTO :EOF
REM Diplay some erros - Section