4coder»Forums
2 posts
Built-in terminal doesn't keep previously set variables
Edited by litterattus on Reason: Initial post
In my build.bat I have the following:
1
2
3
4
5
IF NOT DEFINED vcvars_set (
  call "D:\Program Files\Visual Studio Community\VC\Auxiliary\Build\vcvars64.bat"
  set vcvars_set=1
)
REM whatever else...


However, whenever I build (even without closing the compilation panel), each time vcvars64.bat gets called.

If I manually call build.bat from an external shell like cmd, no such thing happens: vcvars64.bat is called only the first time.
Simon Anciaux
1341 posts
Built-in terminal doesn't keep previously set variables
There is no build in terminal. When you call an external command/program, 4coder will use CreateProcess to execute the program, and when the program ends, it's environment (environment variable included) is freed.

A simple way to keep "vcvars" available is to call "vcvars64.bat" in a console (or batch script) and open 4coder from that console.

1
2
3
4
5
6
IF NOT DEFINED vcvars_set (
  call "D:\Program Files\Visual Studio Community\VC\Auxiliary\Build\vcvars64.bat"
  set vcvars_set=1
)

Path\To\4coder\4ed.exe
2 posts
Built-in terminal doesn't keep previously set variables
I see, thanks for the info