Skip to content

Instantly share code, notes, and snippets.

@sensvos
Last active April 27, 2021 21:49
Show Gist options
  • Save sensvos/2829eba5609698566c6958e3a8b7fc37 to your computer and use it in GitHub Desktop.
Save sensvos/2829eba5609698566c6958e3a8b7fc37 to your computer and use it in GitHub Desktop.
Add registry entry with guid of the installed engine build and its path
function Register-UnrealEngine
{
Get-Content ./Engine/Binaries/Win64/UE4Editor.version | %{$_ -imatch '"BuildId"[\s]*?:[\s]*?"(.*?)"'} | out-null
if (!$? -and !(Test-Path Engine) ) { Write-Error "Engine directory not found" ; return }
$Guid = "{$($Matches[1].ToString().ToUpper())}"
$EnginePath = Resolve-Path . | %{ $_ -replace '\\','/' }
New-ItemProperty -Path "HKCU:\Software\Epic Games\Unreal Engine\Builds" -Name $Guid -PropertyType String -Value "$EnginePath" -Force | out-null
if (!$?) { Write-Error "Error occured while adding registry item." ; return }
echo "`n`tUE4 build successfully registered. `n`n`t`tGuid:`t$Guid`n`t`t`Path:`t$EnginePath`n"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment