mirror of
https://github.com/sinbad/UEScripts.git
synced 2025-02-23 05:05:24 +00:00
Get-UE-Version can now determine version from source builds
This commit is contained in:
parent
f8f519d48f
commit
f3fab64c0c
@ -52,10 +52,20 @@ function Get-UE-Version {
|
||||
)
|
||||
|
||||
if ($uproject.EngineAssociation) {
|
||||
return $uproject.EngineAssociation
|
||||
$assoc = $uproject.EngineAssociation
|
||||
} else {
|
||||
# Plugin
|
||||
return $uproject.EngineVersion
|
||||
$assoc = $uproject.EngineVersion
|
||||
}
|
||||
|
||||
# If this is a GUID "{A1234786-..}" then it's a source build, we need to resolve it via registry
|
||||
if ($assoc.StartsWith("{")) {
|
||||
# Look up the source dir from registry setting
|
||||
$srcdir = Get-ItemPropertyValue 'Registry::HKEY_CURRENT_USER\Software\Epic Games\Unreal Engine\Builds' -Name $assoc
|
||||
# In source build, read Build.version JSON
|
||||
$buildverfile = Join-Path $srcdir "Engine/Build/Build.version"
|
||||
$buildjson = (Get-Content $buildverfile) | ConvertFrom-Json
|
||||
return "$($buildjson.MajorVersion).$($buildjson.MinorVersion)"
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user