How to find engine install path in script

How can I get the engine installation path in script? I have a python script that gets the engine version from the uproject file and then looks for HKLM\Software\EpicGames\Unreal Engine\VERSION in the registry, but this no longer works. It doesn’t appear to be anywhere in the registry anymore.

I need to get the engine path so that I can then execute commands such as PATH\Engine\Build\BatchFiles\RunUAT.bat BuildCookRun -nocompile -nop4 -project=PROJECT -cook -targetplatform=PS4 -iterativecooking

1 Like

You can use this batch script:

powershell -command "& { (Get-ItemProperty 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\EpicGames\Unreal Engine\4.25' -Name 'InstalledDirectory' ).'InstalledDirectory' }" > gen_temp.txt
set /p gen_bin=<gen_temp.txt
echo %gen_bin%

Make sure to replace the version number accordingly.

1 Like