GenerateProjectFiles ERROR: We couldn't find a valid installation of Visual Studio

Hello.
I’ve installed unreal engine 4.7.0 and visual studio 2017 and when I run GenerateProjectFiles, I get this error realated to visual studio-

[ Setting up Unreal Engine 4 project files…

GenerateProjectFiles ERROR: We couldn’t find a valid installation of Visual Studio. This program requires either Visual Studio 2013 or Visual Studio 2012. Please check that you have Visual Studio installed, then verify that the HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0\InstallDir (or HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\12.0\InstallDir on 32-bit machines) registry value is set. Visual Studio configures this value when it is installed, and this program expects it to be set to the '\Common7\IDE' sub-folder under a valid Visual Studio installation directory.

Press any key to continue . . . ]

I don’t know what files I need to install through visual studio installer. I’m using windows 10 pro.
please help me to fix this error.

thanks,

well I solved that issue by myself.

*these are the steps I followed for unreal engine installation-

-download Unreal Engine 4.7.0

-run Setup.bat file and let it download dependencies (around 3 GB)

-then run GenerateProjectFiles.bat file. (if you get the same error about visual studio then just ignore it.)

-now download visual studio community 2017 from Microsoft’s website.

-run visual studio setup vs_community.exe

-then open visual studio installer, go to modify and check these files-

*desktop development with C++

*mobile development with C++

*game development with C++

and hit modify. (around 12GB)

-now you see you have an Epic Games Launcher icon on your desktop. open it. it will download another 1 GB.

-you also have to create an account on epic games.

-now go to unreal engine tab inside epic game launcher. there you will get an update option. it will download the latest version of unreal engine. (around 5 GB)

-now you can Launch unreal engine.