fix: initialize selected runtime for live playout
This commit is contained in:
@@ -45,6 +45,9 @@ $expectedResAssetCount = 34
|
||||
$manifestFileName = 'LegacyRuntimeBundle.manifest.json'
|
||||
$archiveFileName = 'LegacyRuntimeBundle.zip'
|
||||
$archiveHashFileName = 'LegacyRuntimeBundle.zip.sha256'
|
||||
$standardK3dRoot = 'C:\K3DAsyncEngine'
|
||||
$standardK3dNativePath = Join-Path $standardK3dRoot 'DLL\x64\Release\K3DAsyncEngine.dll'
|
||||
$standardK3dInteropPath = Join-Path $standardK3dRoot 'Bin\x64\C#\Interop.K3DAsyncEngineLib.dll'
|
||||
|
||||
function Get-NormalizedFullPath {
|
||||
param([Parameter(Mandatory = $true)][string] $Path)
|
||||
@@ -1132,7 +1135,10 @@ function Get-VerifiedK3DRegistration {
|
||||
[string] $registration.TypeLibTarget -cne 'win64' -or
|
||||
[string] $registration.TypeLibMachine -cne 'AMD64' -or
|
||||
$registration.PowerShellProcessIs64Bit -ne $true -or
|
||||
$registration.ComActivated -ne $false) {
|
||||
$registration.ComActivated -ne $false -or
|
||||
-not (Test-SamePath `
|
||||
-Left ([string] $registration.TypeLibPath) `
|
||||
-Right $standardK3dNativePath)) {
|
||||
throw 'The read-only K3D x64 registration inspection result is invalid.'
|
||||
}
|
||||
|
||||
@@ -1187,7 +1193,10 @@ function Get-VerifiedK3DRegistration {
|
||||
[string] $expectedClasses[$name].ProgId -or
|
||||
[string] $classReport.ServerMachine -cne 'AMD64' -or
|
||||
[string] $classReport.ThreadingModel -cne 'Apartment' -or
|
||||
$classReport.ReciprocalMapping -ne $true) {
|
||||
$classReport.ReciprocalMapping -ne $true -or
|
||||
-not (Test-SamePath `
|
||||
-Left ([string] $classReport.ServerPath) `
|
||||
-Right $standardK3dNativePath)) {
|
||||
throw 'The read-only K3D x64 class registration shape is invalid.'
|
||||
}
|
||||
}
|
||||
@@ -2026,32 +2035,24 @@ $registrationReports = @(& $registrationInspectorPath)
|
||||
$registration = Get-VerifiedK3DRegistration -Reports $registrationReports
|
||||
$registeredClasses = @($registration.Classes)
|
||||
$nativePath = Get-NormalizedFullPath -Path ([string] $registration.TypeLibPath)
|
||||
[void](Assert-RegularFile `
|
||||
-Path $standardK3dNativePath `
|
||||
-Description 'Standard K3D native DLL')
|
||||
if (-not (Test-SamePath -Left $nativePath -Right $standardK3dNativePath)) {
|
||||
throw 'The K3D Registry64 type library is not registered to the company-standard native DLL.'
|
||||
}
|
||||
[void](Assert-RegularFile -Path $nativePath -Description 'Registered K3D native DLL')
|
||||
Assert-FixedLocalPath -Path $nativePath -Description 'Registered K3D native DLL'
|
||||
foreach ($classReport in $registeredClasses) {
|
||||
if (-not (Test-SamePath `
|
||||
-Left ([string] $classReport.ServerPath) `
|
||||
-Right $nativePath)) {
|
||||
throw 'The K3D classes and type library do not resolve to one native DLL.'
|
||||
throw 'The K3D Registry64 classes do not resolve to the company-standard native DLL.'
|
||||
}
|
||||
}
|
||||
|
||||
$releaseDirectory = [IO.Directory]::GetParent($nativePath)
|
||||
$x64Directory = if ($null -ne $releaseDirectory) { $releaseDirectory.Parent } else { $null }
|
||||
$dllDirectory = if ($null -ne $x64Directory) { $x64Directory.Parent } else { $null }
|
||||
$vendorRoot = if ($null -ne $dllDirectory) { $dllDirectory.Parent } else { $null }
|
||||
if ($null -eq $vendorRoot -or
|
||||
-not ([IO.Path]::GetFileName($nativePath)).Equals(
|
||||
'K3DAsyncEngine.dll',
|
||||
[StringComparison]::OrdinalIgnoreCase) -or
|
||||
-not $releaseDirectory.Name.Equals('Release', [StringComparison]::OrdinalIgnoreCase) -or
|
||||
-not $x64Directory.Name.Equals('x64', [StringComparison]::OrdinalIgnoreCase) -or
|
||||
-not $dllDirectory.Name.Equals('DLL', [StringComparison]::OrdinalIgnoreCase)) {
|
||||
throw 'The registered K3D native DLL is outside the supported vendor layout.'
|
||||
}
|
||||
$interopPath = Get-NormalizedFullPath -Path (
|
||||
Join-Path $vendorRoot.FullName 'Bin\x64\C#\Interop.K3DAsyncEngineLib.dll')
|
||||
[void](Assert-RegularFile -Path $interopPath -Description 'Derived K3D interop assembly')
|
||||
$interopPath = Get-NormalizedFullPath -Path $standardK3dInteropPath
|
||||
[void](Assert-RegularFile -Path $interopPath -Description 'Standard K3D interop assembly')
|
||||
Assert-FixedLocalPath -Path $interopPath -Description 'Derived K3D interop assembly'
|
||||
|
||||
$localAppData = [Environment]::GetFolderPath(
|
||||
|
||||
@@ -10,6 +10,9 @@ $expectedTypeLibId = '{2B7F2D64-3A8D-401C-BE73-5C0747BA342C}'
|
||||
$expectedTypeLibVersion = '1.0'
|
||||
$expectedThreadingModel = 'Apartment'
|
||||
$amd64Machine = 0x8664
|
||||
$expectedVendorRoot = 'C:\K3DAsyncEngine'
|
||||
$expectedNativePath = Join-Path $expectedVendorRoot 'DLL\x64\Release\K3DAsyncEngine.dll'
|
||||
$expectedInteropPath = Join-Path $expectedVendorRoot 'Bin\x64\C#\Interop.K3DAsyncEngineLib.dll'
|
||||
$expectedClasses = @(
|
||||
[pscustomobject]@{
|
||||
Name = 'KAEngine'
|
||||
@@ -226,7 +229,10 @@ function Assert-ComClassRegistration {
|
||||
[Microsoft.Win32.RegistryKey] $MachineRoot,
|
||||
|
||||
[Parameter(Mandatory = $true)]
|
||||
[object] $Registration
|
||||
[object] $Registration,
|
||||
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string] $ExpectedServerPath
|
||||
)
|
||||
|
||||
$classesPrefix = 'SOFTWARE\Classes'
|
||||
@@ -269,6 +275,10 @@ function Assert-ComClassRegistration {
|
||||
$serverPath = Resolve-RegisteredFilePath `
|
||||
-RegistryValue (Get-RegistryValue -BaseKey $MachineRoot -SubKey $inprocKey) `
|
||||
-Description "$($Registration.Name) InprocServer32 path"
|
||||
Assert-TextEqual `
|
||||
-Actual $serverPath `
|
||||
-Expected $ExpectedServerPath `
|
||||
-Description "$($Registration.Name) registered native DLL path"
|
||||
$threadingModel = Get-RegistryValue `
|
||||
-BaseKey $MachineRoot `
|
||||
-SubKey $inprocKey `
|
||||
@@ -308,13 +318,22 @@ try {
|
||||
$typeLibPath = Resolve-RegisteredFilePath `
|
||||
-RegistryValue (Get-RegistryValue -BaseKey $machineRoot -SubKey $typeLibKey) `
|
||||
-Description 'K3D x64 type library path'
|
||||
Assert-TextEqual `
|
||||
-Actual $typeLibPath `
|
||||
-Expected $expectedNativePath `
|
||||
-Description 'K3D x64 type library registered native DLL path'
|
||||
Assert-Amd64File -Path $typeLibPath -Description 'K3D type library DLL'
|
||||
$interopPath = Resolve-RegisteredFilePath `
|
||||
-RegistryValue $expectedInteropPath `
|
||||
-Description 'K3D x64 interop assembly path'
|
||||
Assert-Amd64File -Path $interopPath -Description 'K3D interop assembly'
|
||||
|
||||
$classReports = @()
|
||||
foreach ($registration in $expectedClasses) {
|
||||
$classReports += Assert-ComClassRegistration `
|
||||
-MachineRoot $machineRoot `
|
||||
-Registration $registration
|
||||
-Registration $registration `
|
||||
-ExpectedServerPath $expectedNativePath
|
||||
}
|
||||
|
||||
[pscustomobject][ordered]@{
|
||||
|
||||
Reference in New Issue
Block a user