Skip to content

Commit 60cc6f2

Browse files
authored
Don't set ARP entries in NewCommand flow (#575)
1 parent 16e0c4c commit 60cc6f2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/WingetCreateCLI/Commands/NewCommand.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,10 @@ public override async Task<bool> Execute()
195195
try
196196
{
197197
PackageParser.ParsePackages(installerUpdateList, manifests);
198+
199+
// The CLI parses ARP entries uses them in update flow to update existing AppsAndFeaturesEntries in the manifest.
200+
// AppsAndFeaturesEntries should not be set for a new package as they may cause more harm than good.
201+
RemoveARPEntries(manifests.InstallerManifest);
198202
DisplayArchitectureWarnings(installerUpdateList);
199203
}
200204
catch (IOException iOException) when (iOException.HResult == -2147024671)
@@ -508,6 +512,15 @@ private static void MergeNestedInstallerFilesIfApplicable(InstallerManifest inst
508512
}
509513
}
510514

515+
private static void RemoveARPEntries(InstallerManifest installerManifest)
516+
{
517+
installerManifest.AppsAndFeaturesEntries = null;
518+
foreach (var installer in installerManifest.Installers)
519+
{
520+
installer.AppsAndFeaturesEntries = null;
521+
}
522+
}
523+
511524
/// <summary>
512525
/// Prompts for the package identifier and applies the value to all manifests.
513526
/// </summary>

0 commit comments

Comments
 (0)