fix: initialize selected runtime for live playout

This commit is contained in:
2026-07-28 20:44:20 +09:00
parent 18d40e892f
commit 818acad646
24 changed files with 906 additions and 391 deletions

View File

@@ -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(