"Generate Visual Studio Project Files" didn't show up

Hi, All

I’ve read some posts in the forum about the issue “Generate visual studio project files” option didn’t show up in the right click menu, however, it seems like some of the solutions are not up to date.

For instance, UnrealVersionSelector.exe can not be found in the engine folder, but is located in launcher folder. I also tried to manually change the registry. But maybe i’m not doing the right way because nothing happened. So maybe in 4.11 the UnrealVersionSelector changed a bit or?..

P.s: When i open [Projectname].sln in VS, it seems not working properly as it says “UE4 (Incompatible)”, maybe there’s something related?

Thank you so much for any help!

Well, eventually i found out the problem myself, so for those who have the same pain like me, I hope the following method can help.

1, Download the [link text][1], and modify the name of the file from .txt to .cmd, the code will be attached at the bottom of this post.

2, Run “regedit”, manually add a new key called “InstalledDirectory” below “HKEY_LOCAL_MACHINE\SOFTWARE\EpicGames\Unreal Engine”, and change the value of which as your installation directory. it should be like “X:…\Epic Games”

3, Run this cmd file as administrator.

The problem should be solved normally, however, for me, it was not solved. So If you can not see the icon of your .uproject file as unreal logo, probably it is caused by broken link of default application:

4, Click windows button (my windows version is windows 10, i believe there might be some difference in other windows version).

5, Click “Settings” at the bottom.

6, Go to “System” - “Default Application” and set default application by type.

7, reset the .uproject files’ default application as unreal engine, even though it is set to it. (Because for me the default version is 4.10 but i’ve already unistalled it. So the default application link was broken.)

8, Enjoy.

[1]:99078-Written by David Moore and i changed a little bit. Because the original file is no longer working properly.

here’s the code of the batch file:

:: UnrealProjectMenuRegistration.cmd
::
:: This batch file will try to find where the Unreal Engine is installed, then update your registry
:: to register the Unreal Project File type (and its right click menu for things such as generating
:: Visual Studio project files, and launching)
::
:: Run as an Administrator, as it's required for writing to HKLM.
::
:: Author: David Moore <david@sadrobot.co.nz>
::
:: Edited: Jack Jayden
::
:: This is updated for the latest version of Unreal Engine 4.Thanks to the author, i only changeed a 
:: little in this batch.The original version of this batch can not work properly because in HKLM, Epic
:: changed the location and the name of the installation directory.
:: 
:: In order to work properly,you need to manually add a new key called "InstalledDirectory" below 
:: "HKEY_LOCAL_MACHINE\SOFTWARE\EpicGames\Unreal Engine",and change the value of which as your installation
:: directory. it should be like "X:\...\Epic Games\"
::
:: Then run the batch as administrator and enjoy.

@ECHO OFF

echo.
echo Locating where Unreal Engine is installed by checking the Windows registry...

FOR /F "tokens=2*" %%A IN ('reg query "HKLM\SOFTWARE\EpicGames\Unreal Engine" /v "InstalledDirectory"') DO (
	SET "UnrealEngineDir=%%B"
)
IF "%UnrealEngineDir%"=="" GOTO CannotFindUnrealEngine

echo.
echo Using Unreal Engine directory: %UnrealEngineDir%

set LauncherPath=%UnrealEngineDir%Launcher\Engine\Binaries\Win64\UnrealVersionSelector.exe

echo.
echo Adding registry keys for the Unreal Project right click menu...

:: HKLM\SOFTWARE\Classes\.uproject
reg ADD "HKLM\Software\Classes\.uproject" /ve /d Unreal.ProjectFile /f
IF ERRORLEVEL 1 (
    echo Couldn't write to registry. Did you forget to run this batch file as an administrator?
    goto TheEnd
)

:: HKLM\SOFTWARE\Classes\Unreal.ProjectFile
reg ADD "HKLM\Software\Classes\Unreal.ProjectFile" /ve /d "Unreal Engine Project File" /f

:: HKLM\SOFTWARE\Classes\Unreal.ProjectFile\DefaultIcon
reg ADD "HKLM\Software\Classes\Unreal.ProjectFile\DefaultIcon" /ve /d "\"%LauncherPath%\"" /f

:: HKLM\SOFTWARE\Classes\Unreal.ProjectFile\shell\open
reg ADD "HKLM\Software\Classes\Unreal.ProjectFile\shell\open" /ve /d "Open" /f
reg ADD "HKLM\Software\Classes\Unreal.ProjectFile\shell\open\command" /ve /d "\"%LauncherPath%\" /editor \"%%1\"" /f

:: HKLM\SOFTWARE\Classes\Unreal.ProjectFile\shell\run
reg ADD "HKLM\Software\Classes\Unreal.ProjectFile\shell\run" /ve /d "Launch game" /f
reg ADD "HKLM\Software\Classes\Unreal.ProjectFile\shell\run" /v Icon /t REG_SZ /d "\"%LauncherPath%\"" /f
reg ADD "HKLM\Software\Classes\Unreal.ProjectFile\shell\run\command" /ve /d "\"%LauncherPath%\" /game \"%%1\"" /f

:: HKLM\SOFTWARE\Classes\Unreal.ProjectFile\shell\rungenproj
reg ADD "HKLM\Software\Classes\Unreal.ProjectFile\shell\rungenproj" /ve /d "Generate Visual Studio project files" /f
reg ADD "HKLM\Software\Classes\Unreal.ProjectFile\shell\rungenproj" /v Icon /t REG_SZ /d "\"%LauncherPath%\"" /f
reg ADD "HKLM\Software\Classes\Unreal.ProjectFile\shell\rungenproj\command" /ve /d "\"%LauncherPath%\" /projectfiles \"%%1\"" /f

:: HKLM\SOFTWARE\Classes\Unreal.ProjectFile\shell\switchversion
reg ADD "HKLM\Software\Classes\Unreal.ProjectFile\shell\switchversion" /ve /d "Switch Unreal Engine version..." /f
reg ADD "HKLM\Software\Classes\Unreal.ProjectFile\shell\switchversion" /v Icon /t REG_SZ /d "\"%LauncherPath%\"" /f
reg ADD "HKLM\Software\Classes\Unreal.ProjectFile\shell\switchversion\command" /ve /d "\"%LauncherPath%\" /switchversion \"%%1\"" /f

:Done
echo.
echo Done.
echo.
goto TheEnd

:CannotFindUnrealEngine
echo.
echo DOH! Can't find the Unreal Engine.
echo.
goto TheEnd

:TheEnd
pause

This solves the same problem with a few clicks