Skip to content

Fix -PreferedInstaller being ignored for zip packages with NestedInstallerType#266

Draft
svrooij with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-preferedinstaller-ignored
Draft

Fix -PreferedInstaller being ignored for zip packages with NestedInstallerType#266
svrooij with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-preferedinstaller-ignored

Conversation

Copilot AI commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

For packages like dotPDN.PaintDotNet that use InstallerType: zip with a NestedInstallerType: wix, specifying -PreferedInstaller Wix had no effect — the matcher only checked the outer InstallerType field ("zip"), never matching "wix".

Changes

  • WingetInstallerExtensions: Extended singleOrDefault to also match a zip installer when its NestedInstallerType equals the requested type. Logic extracted into a new InstallerTypeMatches helper:
private static bool InstallerTypeMatches(WingetInstaller installer, InstallerType requestedType)
{
    if (requestedType == InstallerType.Unknown) return true;
    if (installer.ParseInstallerType() == requestedType) return true;
    // For zip installers, also match by NestedInstallerType
    return installer.ParseInstallerType() == InstallerType.Zip
        && !string.IsNullOrEmpty(installer.NestedInstallerType)
        && EnumParsers.ParseInstallerType(installer.NestedInstallerType) == requestedType;
}
  • Tests: Added PackageInfo unit tests verifying that InstallerType.Wix preference selects a zip+wix installer, plus a WingetManager integration test for the PaintDotNet manifest (zip outer / wix nested).

Copilot AI added 2 commits July 13, 2026 14:05
When a package uses InstallerType: zip with NestedInstallerType (e.g., wix),
the installer matching logic in singleOrDefault now also considers the
NestedInstallerType when the user specifies a PreferedInstaller. This means
that specifying `-PreferedInstaller Wix` for a package like dotPDN.PaintDotNet
(which uses a zip container wrapping a wix installer) will now correctly select
the zip installer with the matching nested type.

Fixes #265
Copilot AI changed the title [WIP] Fix ignored PreferedInstaller for NestedInstaller packages Fix -PreferedInstaller being ignored for zip packages with NestedInstallerType Jul 13, 2026
Copilot AI requested a review from svrooij July 13, 2026 14:10
@github-actions

Copy link
Copy Markdown

Test Results

14 tests  ±0   13 ✅ ±0   2s ⏱️ ±0s
10 suites ±0    1 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit 0b902bf. ± Comparison against base commit 84b622b.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Parameter PreferedInstaller is ignored for NestedInstaller packages

2 participants