Flawed Visual Studio Environment detection in GenerateProjectFiles.bat

In the engine source /Engine/Build/BatchFiles/GenerateProjectFiles.bat attempts to detect if it is running within a Visual Studio Environment Shell like so:

if not “%INCLUDE%” == “” if not “%LIB%” == “” goto ReadyToCompile

However, INCLUDE and LIB are not Visual Studio specific environment variables, and if you, like me, have some paths in those variables then GenerateProjectFiles.bat errors out like so:

‘msbuild’ is not recognized as an internal or external command.

That’s because it skipped calling vcvarsx86_amd64.bat.

After I commented out the INCLUDE/LIB check project generation started working as expected.

I should note that when I opened the generated solution in Visual Studio and started the build one of the build tasks logged an error about %LIB% not being a valid path. My LIB environment variable is currently set to:

C:\Program Files\PellesC\Lib;C:\Program Files\PellesC\Lib\Win;%LIB%

Regardless it seems to have generated a working build of the engine.

Thanks for reporting this issue!

I’ve notified our core team about the issue and they’re looking into it. For now, commenting out the line is a safe workaround.