Read uproject and determine UE version

This commit is contained in:
Steve Streeting 2020-10-05 13:26:09 +01:00
parent 88220f4f61
commit c9b893b051
2 changed files with 28 additions and 0 deletions

7
inc/ueinstall.ps1 Normal file
View File

@ -0,0 +1,7 @@
function Get-UE-Install {
param (
[string]$ueVersion
)
return "TODO"
}

View File

@ -1,5 +1,6 @@
. $PSScriptRoot\packageconfig.ps1 . $PSScriptRoot\packageconfig.ps1
function Get-Uproject-Filename { function Get-Uproject-Filename {
param ( param (
[string]$srcfolder, [string]$srcfolder,
@ -28,3 +29,23 @@ function Get-Uproject-Filename {
return Resolve-Path $projfile return Resolve-Path $projfile
} }
# Read the uproject file and return as a PSCustomObject
# Haven't defined this as a custom class because we don't control it
function Read-Uproject {
param (
[string]$uprojectfile
)
# uproject is just JSON
return (Get-Content $uprojectfile) | ConvertFrom-Json
}
function Get-UE-Version {
param (
# the uproject object from Read-Uproject
[psobject]$uproject
)
return $uproject.EngineAssociation
}