Skip to content

Commit fb33cb2

Browse files
dkbennettJohnMcPMS
andauthored
Remove experimental from Font Install, Uninstall, and source (#5791)
This removes experimental from font install, uninstall, and source. The font command remains experimental and is not required to install or remove fonts, which use the normal install and uninstall flow for a WinGet package. <!-- To check a checkbox place an "x" between the brackets. e.g: [x] --> - [x] I have signed the [Contributor License Agreement](https://cla.opensource.microsoft.com/microsoft/winget-pkgs). - [x] I have updated the [Release Notes](../doc/ReleaseNotes.md). - [ ] This pull request is related to an issue. ----- ###### Microsoft Reviewers: [Open in CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/microsoft/winget-cli/pull/5791) --------- Co-authored-by: John McPherson <johnmcp@microsoft.com>
1 parent 4f94f3e commit fb33cb2

File tree

11 files changed

+55
-18
lines changed

11 files changed

+55
-18
lines changed

doc/ReleaseNotes.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,29 @@
22
* MCP server available; run `winget mcp` for assistance on configuring your client.
33
* App Installer now uses WinUI 3. The package dependency on WinUI 2 has been replaced by a dependency on the Windows App Runtime 1.8.
44
* Manifest schema and validation updated to v1.12. This version update adds `Font` as an `InstallerType` and `NestedInstallerType`.
5+
* Font Install, Uninstall, and a winget-fonts source have been added and are non-experimental.
56

67
## Bug Fixes
78
* Manifest validation no longer fails using `UTF-8 BOM` encoding when the schema header is on the first line
89
* Upgrading a portable package with dev mode disabled will no longer remove the package from the PATH variable.
910
* Fixed source open failure when there were multiple sources but less than two non-explicit sources.
1011

12+
## Font Support
13+
Font Install and Uninstall via manifest and package source for user and machine scopes has been added.
14+
A sample Font manifest can be found at:
15+
https://github.com/microsoft/winget-pkgs/tree/master/fonts/m/Microsoft/FluentFonts/1.0.0.0
16+
17+
At this time install and removal of fonts is only supported for fonts installed via WinGet Package.
18+
19+
Fonts must either be the Installer or a .zip archive of NestedInstaller fonts.
20+
21+
A new explicit source for fonts has been added "winget-font".
22+
```winget search font -s winget-font```
23+
24+
This source is not yet accepting public submissions at this time.
25+
1126
## Experimental Features
12-
* Experimental support for Fonts
27+
* Experimental support still exists for the 'font' command.
1328

1429
---
1530
### Experimental support for Fonts
@@ -22,8 +37,4 @@ The following snippet enables experimental support for fonts via `winget setting
2237
}
2338
}
2439
```
25-
Manifest Schema version updated to 1.12.0 to add support for fonts.
26-
27-
Experimental initial Font Install and Uninstall via manifest for user and machine scopes has been added.
28-
2940
The font 'list' command has been updated with a new '--details' feature for an alternate view of the installed fonts.

samples/WinGetUWPCaller/WinGetUWPCaller/MainPage.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,13 +309,16 @@ namespace winrt::WinGetUWPCaller::implementation
309309

310310
if (selectedItems.Size() == 0)
311311
{
312-
// If no items are selected, we use all available catalogs.
312+
// If no items are selected, we use all implicit catalogs.
313313
CreateCompositePackageCatalogOptions createCompositePackageCatalogOptions;
314314
createCompositePackageCatalogOptions.CompositeSearchBehavior(CompositeSearchBehavior::RemotePackagesFromRemoteCatalogs);
315315

316316
for (const auto& item : m_packageManager.GetPackageCatalogs())
317317
{
318-
createCompositePackageCatalogOptions.Catalogs().Append(item);
318+
if (!item.Info().Explicit())
319+
{
320+
createCompositePackageCatalogOptions.Catalogs().Append(item);
321+
}
319322
}
320323

321324
catalogReference = m_packageManager.CreateCompositePackageCatalog(createCompositePackageCatalogOptions);

src/AppInstallerCLICore/Workflows/InstallFlow.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,6 @@ namespace AppInstaller::CLI::Workflow
285285
void FontInstall(Execution::Context& context)
286286
{
287287
context <<
288-
EnsureFeatureEnabled(ExperimentalFeature::Feature::Font) <<
289288
GetInstallerArgs <<
290289
FontInstallImpl <<
291290
ReportInstallerResult("Font"sv, APPINSTALLER_CLI_ERROR_FONT_INSTALL_FAILED, true);

src/AppInstallerCLICore/Workflows/UninstallFlow.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,6 @@ namespace AppInstaller::CLI::Workflow
354354
break;
355355
case InstallerTypeEnum::Font:
356356
context <<
357-
EnsureFeatureEnabled(Settings::ExperimentalFeature::Feature::Font) <<
358357
Workflow::FontUninstallImpl <<
359358
ReportUninstallerResult("Font"sv, APPINSTALLER_CLI_ERROR_FONT_UNINSTALL_FAILED, true);
360359
break;

src/AppInstallerCLIE2ETests/GroupPolicy.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,7 @@ public void EnableMicrosoftStoreSource()
166166
[Test]
167167
public void EnableFontSource()
168168
{
169-
WinGetSettingsHelper.ConfigureFeature("fonts", true);
170169
GroupPolicyHelper.EnableFontSource.Disable();
171-
172170
var result = TestCommon.RunAICLICommand("source list", "winget-font");
173171
Assert.AreEqual(Constants.ErrorCode.ERROR_SOURCE_NAME_DOES_NOT_EXIST, result.ExitCode);
174172

src/AppInstallerCLITests/Sources.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ using namespace AppInstaller::Utility;
2323
using namespace std::string_literals;
2424
using namespace std::string_view_literals;
2525

26-
constexpr size_t c_DefaultSourceCount = 2;
26+
constexpr size_t c_DefaultSourceCount = 3;
2727

2828
constexpr std::string_view s_SourcesYaml_Sources = "Sources"sv;
2929
constexpr std::string_view s_SourcesYaml_Source_Name = "Name"sv;
@@ -50,6 +50,11 @@ constexpr std::string_view s_DefaultSourcesTombstoned = R"(
5050
Arg: ""
5151
Data: ""
5252
IsTombstone: true
53+
- Name: winget-font
54+
Type: ""
55+
Arg: ""
56+
Data: ""
57+
IsTombstone: true
5358
)"sv;
5459

5560
constexpr std::string_view s_SingleSource = R"(
@@ -122,6 +127,11 @@ constexpr std::string_view s_ThreeSources = R"(
122127
Arg: ""
123128
Data: ""
124129
IsTombstone: true
130+
- Name: winget-font
131+
Type: ""
132+
Arg: ""
133+
Data: ""
134+
IsTombstone: true
125135
)"sv;
126136

127137
constexpr std::string_view s_ThreeSourcesMetadata = R"(

src/AppInstallerRepositoryCore/SourcePolicy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ namespace AppInstaller::Repository
191191
case AppInstaller::Repository::WellKnownSource::MicrosoftStore:
192192
return IsDefaultSourceEnabled(source, ExperimentalFeature::Feature::None, onlyExplicit, TogglePolicy::Policy::MSStoreSource);
193193
case AppInstaller::Repository::WellKnownSource::WinGetFont:
194-
return IsDefaultSourceEnabled(source, ExperimentalFeature::Feature::Font, onlyExplicit, TogglePolicy::Policy::FontSource);
194+
return IsDefaultSourceEnabled(source, ExperimentalFeature::Feature::None, onlyExplicit, TogglePolicy::Policy::FontSource);
195195
case AppInstaller::Repository::WellKnownSource::DesktopFrameworks:
196196
// No corresponding policy available for this source.
197197
return true;

src/PowerShell/Microsoft.WinGet.Client.Engine/Commands/Common/FinderCommand.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,23 @@ private PackageCatalogReference GetPackageCatalogReference(CompositeSearchBehavi
160160
IReadOnlyList<PackageCatalogReference> references = this.GetPackageCatalogReferences(this.Source);
161161
for (var i = 0; i < references.Count; i++)
162162
{
163-
options.Catalogs.Add(references[i]);
163+
var reference = references[i];
164+
bool isExplicit = false;
165+
try
166+
{
167+
// Execute in try block to catch interface not implemented on older servers.
168+
isExplicit = reference.Info.Explicit;
169+
}
170+
catch
171+
{
172+
// Assume that any failure other than the interface not implemented to get Explicit
173+
// will result in other failures shortly after this (like the server being gone).
174+
}
175+
176+
if (!isExplicit)
177+
{
178+
options.Catalogs.Add(reference);
179+
}
164180
}
165181

166182
options.CompositeSearchBehavior = behavior;

src/PowerShell/Microsoft.WinGet.Client.Engine/Commands/SourceCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// -----------------------------------------------------------------------------
1+
// -----------------------------------------------------------------------------
22
// <copyright file="SourceCommand.cs" company="Microsoft Corporation">
33
// Copyright (c) Microsoft Corporation. Licensed under the MIT License.
44
// </copyright>

src/PowerShell/tests/Microsoft.WinGet.DSC.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ Describe 'WinGetPackage' {
171171
$testPackageId = 'AppInstallerTest.TestExeInstaller'
172172
$testPackageVersion = '1.0.0.0'
173173

174-
InvokeWinGetDSC -Name WinGetSource -Method Set -Property @{ Name = $testSourceName; Argument = $testSourceArg; Type = $testSourceType; TrustLevel = 'Trusted' }
174+
InvokeWinGetDSC -Name WinGetSource -Method Set -Property @{ Name = $testSourceName; Argument = $testSourceArg; Type = $testSourceType; TrustLevel = 'Trusted'; Explicit = $false }
175175
}
176176

177177
It 'Get WinGetPackage' {

0 commit comments

Comments
 (0)