找回密码
 立即注册
查看: 247|回复: 0

UE4 虚幻4无右键菜单.uproject文件无关联解决

[复制链接]
发表于 2022-7-29 11:30 | 显示全部楼层 |阅读模式
在特定情况下,鼠标点击.uproject文件右键菜单消失。


会造成比如:
1。无法手动生成VisualStudioProjectFiles。
2。无法切换UE4各个版本,从而导致版本错开崩溃、每次开启项目自动生成格外副本工程 等问题。
搜遍了全网+自己实验,总结解决方法如下:
一、被win10默认防护、其他杀毒软件删除

关闭/卸载杀毒软件、关闭win10防护
以win10防护为例,打开 windows安全中心,
分别关闭 病毒和威胁防护、防火墙和网络保护、 应用和浏览控制




二、删除注册表,运行CMD

1.删除注册表
1)按下 Ctrl+R 输入 regegit 调出注册表
2)删除 HKEY_CLASSES_ROOT 下的 .uproject文件夹
2.创建cmd并运行重启
新建一个文本文档,然后改名为 UnrealProjectMenuRegistration.cmd,复制如下代码
:: 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>  @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 "INSTALLDIR"') DO ( ::        SET "UnrealEngineDir=%%B" ::)  :: 设置为当前虚幻引擎安装目录 SET UnrealEngineDir=D:\Epic Games\  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
修改 SET UnrealEngineDir=D:\Epic Games\
修改为Unreal Engine的路径(是UnrealEngine 的路径不是EpicLauncher的)
SET UnrealEngineDir=D:\Epic Games\

保存,右键以管理员身份运行,重启电脑即可。
三、重启后运行UnrealVersionSelector.exe

如,方法一、方法二都失效是使用下述方法:


1.找到Epic Game Lancher的安装目录,在lancher->Engine->Binaries->Win64->UnrealVersionSelector.exe
2.把UnrealVersionSelector.exe 分别拷贝到UE4 不同版本引擎的 Engine->Binaries->Win64目录,例如UE_4.25->Engine->Binaries->Win64
3.双击,以管理员身份运行UnrealVersionSelector.exe,重启电脑即可。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Unity开发者联盟 ( 粤ICP备20003399号 )

GMT+8, 2024-11-15 12:46 , Processed in 0.090338 second(s), 26 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表