Last active
April 27, 2021 21:49
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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