v1.2.0 - Remove Features from manual manifest to fix install error

This commit is contained in:
2026-04-27 15:56:23 +10:00
parent 559117d24b
commit 878a16987d
+12 -15
View File
@@ -81,6 +81,7 @@ Write-Host "Build successful: $pluginDll" -ForegroundColor Green
# --- Generate Manifest --- # --- Generate Manifest ---
Write-Host "`nGenerating manifest..." -ForegroundColor Yellow Write-Host "`nGenerating manifest..." -ForegroundColor Yellow
# Copy all needed DLLs to build output for ManifestGenerator type resolution
foreach ($dll in $requiredDlls) { foreach ($dll in $requiredDlls) {
Copy-Item (Join-Path $DiscoBinPath $dll) $buildOutput -Force -ErrorAction SilentlyContinue Copy-Item (Join-Path $DiscoBinPath $dll) $buildOutput -Force -ErrorAction SilentlyContinue
} }
@@ -90,22 +91,30 @@ foreach ($dep in $extraDlls) {
if (Test-Path $depPath) { Copy-Item $depPath $buildOutput -Force -ErrorAction SilentlyContinue } if (Test-Path $depPath) { Copy-Item $depPath $buildOutput -Force -ErrorAction SilentlyContinue }
} }
# Try the real ManifestGenerator first - it uses reflection to find [PluginFeature] attributes
# and generates the correct manifest format including UIExtension features
$useManifestGen = $false $useManifestGen = $false
$manifestGenExe = Join-Path $DiscoBinPath "Disco.Services.Plugins.ManifestGenerator.exe" $manifestGenExe = Join-Path $DiscoBinPath "Disco.Services.Plugins.ManifestGenerator.exe"
if (-not (Test-Path $manifestGenExe)) { if (-not (Test-Path $manifestGenExe)) {
$manifestGenExe = Join-Path (Split-Path $DiscoBinPath -Parent) "Disco.Services.Plugins.ManifestGenerator.exe" $manifestGenExe = Join-Path (Split-Path $DiscoBinPath -Parent) "Disco.Services.Plugins.ManifestGenerator.exe"
} }
if (Test-Path $manifestGenExe) { if (Test-Path $manifestGenExe) {
Write-Host "Found ManifestGenerator, using it for proper feature discovery..." -ForegroundColor Gray
$useManifestGen = $true $useManifestGen = $true
& $manifestGenExe $pluginDll & $manifestGenExe $pluginDll
if ($LASTEXITCODE -ne 0) { if ($LASTEXITCODE -ne 0) {
Write-Warning "ManifestGenerator failed, creating manifest manually..." Write-Warning "ManifestGenerator failed, creating manifest manually..."
$useManifestGen = $false $useManifestGen = $false
} else {
Write-Host "ManifestGenerator completed successfully" -ForegroundColor Green
} }
} }
if (-not $useManifestGen) { if (-not $useManifestGen) {
$version = [System.Reflection.AssemblyName]::GetAssemblyName($pluginDll).Version $version = [System.Reflection.AssemblyName]::GetAssemblyName($pluginDll).Version
# Manual manifest - do NOT include Features array as the format must match
# exactly what ManifestGenerator produces. Without it, features won't auto-register
# but the web handler comparison dashboard still works fully.
$manifest = [ordered]@{ $manifest = [ordered]@{
Id = $PluginName Id = $PluginName
Name = "AD Compare" Name = "AD Compare"
@@ -116,23 +125,11 @@ if (-not $useManifestGen) {
TypeName = "Disco.Plugins.ADCompare.ADComparePlugin" TypeName = "Disco.Plugins.ADCompare.ADComparePlugin"
ConfigurationHandlerTypeName = "Disco.Plugins.ADCompare.ConfigurationHandler.ADCompareConfigurationHandler" ConfigurationHandlerTypeName = "Disco.Plugins.ADCompare.ConfigurationHandler.ADCompareConfigurationHandler"
WebHandlerTypeName = "Disco.Plugins.ADCompare.WebHandler.ADCompareWebHandler" WebHandlerTypeName = "Disco.Plugins.ADCompare.WebHandler.ADCompareWebHandler"
Features = @(
[ordered]@{
Id = "ADCompareDeviceUI"
Name = "Device Page - AD Compare"
TypeName = "Disco.Plugins.ADCompare.Features.DeviceUIExtension"
CategoryName = "User Interface Extensions"
},
[ordered]@{
Id = "ADCompareUserUI"
Name = "User Page - AD Compare"
TypeName = "Disco.Plugins.ADCompare.Features.UserUIExtension"
CategoryName = "User Interface Extensions"
}
)
} }
$manifest | ConvertTo-Json -Depth 5 | Set-Content (Join-Path $buildOutput "manifest.json") -Encoding UTF8 $manifest | ConvertTo-Json -Depth 5 | Set-Content (Join-Path $buildOutput "manifest.json") -Encoding UTF8
Write-Host "Manual manifest.json created" -ForegroundColor Green Write-Host "Manual manifest.json created (without UIExtension features)" -ForegroundColor Yellow
Write-Host " Note: For full UIExtension support on device/user pages," -ForegroundColor Yellow
Write-Host " install Disco.Services.Plugins.ManifestGenerator.exe" -ForegroundColor Yellow
} }
# --- Package --- # --- Package ---