Calling GenerateProjectFiles.bat fails to build

I am getting the following errors when running GenerateProjectFiles.bat:
Setting up Unreal Engine 4 project files…

UnrealBuildTool Exception: System.IO.DirectoryNotFoundException: Could not find
a part of the path 'C:\Program Files\Emscripten\emscripten'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileSystemEnumerableIterator`1.CommonInit()
   at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String origina
lUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`
1 resultHandler, Boolean checkHost)
   at System.IO.DirectoryInfo.InternalGetDirectories(String searchPattern, Searc
hOption searchOption)
   at UnrealBuildTool.HTML5ToolChain.RegisterToolChain() in c:\Users\Michael\Doc
uments\GitHub\UnrealEngine\Engine\Source\Programs\UnrealBuildTool\HTML5\HTML5Too
lChain.cs:line 35
   at UnrealBuildTool.UnrealBuildTool.RegisterAllUBTClasses() in c:\Users\Michae
l\Documents\GitHub\UnrealEngine\Engine\Source\Programs\UnrealBuildTool\System\Un
realBuildTool.cs:line 387
   at UnrealBuildTool.UnrealBuildTool.Main(String[] Arguments) in c:\Users\Micha
el\Documents\GitHub\UnrealEngine\Engine\Source\Programs\UnrealBuildTool\System\U
nrealBuildTool.cs:line 824

GenerateProjectFiles ERROR: UnrealBuildTool was unable to generate project files
.

Press any key to continue . . .

That seems like it looks for Emscripten installation.But I don’t have it in ProgramFiles.Also the docs don’t require to install it.

UPDATE:

I solved it by installing Emscripten manually.Are you sure this is not something everyone should do?Your installation guide says nothing about this.

Glad you were able to solve it! This issue appears to have happened because you already had an EMSCRIPTEN environment variable on your computer even though the SDK was not installed, perhaps from an older Emscripten SDK install that was since uninstalled or deleted? If you have any other information, it might be helpful so that we can make the project file generator more resilient to these errors. Thank you!

–Mike

Yeah,I have got my own installation so maybe it was the reason it didn’t install the Emscripten.I think you should take care of such a case as there are quite a few people using it :wink:

We’ll investigate and try to improve this. Sorry about the trouble and have fun with the engine!