Skip to content

Commit

Permalink
Don't set ARP entries in NewCommand flow (#575)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdanish-kh authored Jan 2, 2025
1 parent 16e0c4c commit 60cc6f2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/WingetCreateCLI/Commands/NewCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ public override async Task<bool> Execute()
try
{
PackageParser.ParsePackages(installerUpdateList, manifests);

// The CLI parses ARP entries uses them in update flow to update existing AppsAndFeaturesEntries in the manifest.
// AppsAndFeaturesEntries should not be set for a new package as they may cause more harm than good.
RemoveARPEntries(manifests.InstallerManifest);
DisplayArchitectureWarnings(installerUpdateList);
}
catch (IOException iOException) when (iOException.HResult == -2147024671)
Expand Down Expand Up @@ -508,6 +512,15 @@ private static void MergeNestedInstallerFilesIfApplicable(InstallerManifest inst
}
}

private static void RemoveARPEntries(InstallerManifest installerManifest)
{
installerManifest.AppsAndFeaturesEntries = null;
foreach (var installer in installerManifest.Installers)
{
installer.AppsAndFeaturesEntries = null;
}
}

/// <summary>
/// Prompts for the package identifier and applies the value to all manifests.
/// </summary>
Expand Down

0 comments on commit 60cc6f2

Please sign in to comment.