Change Compiler Temp Folder / Can I?

Just starting out? Need help? Post your questions and find answers here.
Randy Walker
Addict
Addict
Posts: 1186
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA
Contact:

Change Compiler Temp Folder / Can I?

Post 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.
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
User avatar
idle
Always Here
Always Here
Posts: 6130
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Change Compiler Temp Folder / Can I?

Post 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"
BarryG
Addict
Addict
Posts: 4292
Joined: Thu Apr 18, 2019 8:17 am

Re: Change Compiler Temp Folder / Can I?

Post 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.
Randy Walker
Addict
Addict
Posts: 1186
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA
Contact:

Re: Change Compiler Temp Folder / Can I?

Post 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!!!
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
BarryG
Addict
Addict
Posts: 4292
Joined: Thu Apr 18, 2019 8:17 am

Re: Change Compiler Temp Folder / Can I?

Post 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.
Axolotl
Addict
Addict
Posts: 905
Joined: Wed Dec 31, 2008 3:36 pm

Re: Change Compiler Temp Folder / Can I?

Post 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.
Just because it worked doesn't mean it works.
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
Randy Walker
Addict
Addict
Posts: 1186
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA
Contact:

Re: Change Compiler Temp Folder / Can I?

Post 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:
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
Randy Walker
Addict
Addict
Posts: 1186
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA
Contact:

Re: Change Compiler Temp Folder / Can I?

Post 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.
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
User avatar
idle
Always Here
Always Here
Posts: 6130
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Change Compiler Temp Folder / Can I?

Post 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.
Randy Walker
Addict
Addict
Posts: 1186
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA
Contact:

Re: Change Compiler Temp Folder / Can I?

Post 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.
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
User avatar
idle
Always Here
Always Here
Posts: 6130
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Change Compiler Temp Folder / Can I?

Post 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.
Randy Walker
Addict
Addict
Posts: 1186
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA
Contact:

Re: Change Compiler Temp Folder / Can I?

Post 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!!!
Last edited by Randy Walker on Tue Dec 09, 2025 10:31 pm, edited 1 time in total.
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
Axolotl
Addict
Addict
Posts: 905
Joined: Wed Dec 31, 2008 3:36 pm

Re: Change Compiler Temp Folder / Can I?

Post 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 
Just because it worked doesn't mean it works.
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
Post Reply