In our case, the framework is created/generated separate from our build process. So, if you want to have it created from your build, then yes, something in the build process of your application under test will need to generate the environment value to use.
As with many such things, there are many ways of achieving the same result. How you set the environment is something that you'll have to do within your organizational process. The key where it intersects with TestComplete is writing code in your automation that will read the environment value from whereever you have set it and utilize it within your tests. We have code in TestComplete that reads the value from an SQL table and populates the project suite variable. Your code may be different, depending upon how you choose to generate the value.