Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/WingetCreateCLI/Commands/DscCommands/BaseDscCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public static List<string> GetAvailableCommands()
/// Creates a Json schema for a DSC resource object.
/// </summary>
/// <typeparam name="T">The type of the resource object.</typeparam>
/// <param name="commandName">The name of the DSC command used as the schema title.</param>
/// <returns>A Json object representing the schema.</returns>
protected JObject CreateSchema<T>(string commandName)
where T : BaseResourceObject, new()
Expand Down
3 changes: 2 additions & 1 deletion src/WingetCreateCLI/Commands/NewCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,9 @@ public override async Task<bool> Execute()
}
}
}
else // Not a Zip package archive.
else
{
// Not a Zip package archive.
// Set the manifest root type. There is only one file here so it can only be Font or Manifests.
var rootTypeForInstaller = PackageParser.GetManifestRootTypeForInstallerPaths([packageFile]);

Expand Down
36 changes: 18 additions & 18 deletions src/WingetCreateCore/Common/PackageParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,25 +64,8 @@ public static class PackageParser
},
};

private enum MachineType
{
X86 = 0x014c,
X64 = 0x8664,
Arm = 0x01c0,
Armv7 = 0x01c4,
Arm64 = 0xaa64,
}

private enum CompatibilitySet
{
None,
Exe,
Msi,
Msix,
}

/// <summary>
/// Manifest Root Type Enum
/// Manifest Root Type Enum.
/// </summary>
public enum ManifestRootType
{
Expand All @@ -102,6 +85,23 @@ public enum ManifestRootType
Fonts,
}

private enum MachineType
{
X86 = 0x014c,
X64 = 0x8664,
Arm = 0x01c0,
Armv7 = 0x01c4,
Arm64 = 0xaa64,
}

private enum CompatibilitySet
{
None,
Exe,
Msi,
Msix,
}

/// <summary>
/// Gets or sets the path in the %TEMP% directory where installers are downloaded to.
/// </summary>
Expand Down
12 changes: 0 additions & 12 deletions src/WingetCreateCore/Models/PublisherApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,4 @@ namespace Microsoft.WingetCreateCore.Models
/// A representation of an OWC publisher app.
/// </summary>
public record PublisherApp(string Publisher, string App, string Id);

/// <summary>
/// A representation of an OWC publisher app with a defined version.
/// </summary>
public record PublisherAppVersion(string Publisher, string App, string Id, string Version, [property: JsonIgnore] string Path)
: PublisherApp(Publisher, App, Id);

/// <summary>
/// A representation of an OWC publisher app with a defined content and version.
/// </summary>
public record PublisherAppVersionContent(string Publisher, string App, string Id, string Version, string Path, string Content)
: PublisherAppVersion(Publisher, App, Id, Version, Path);
}
13 changes: 13 additions & 0 deletions src/WingetCreateCore/Models/PublisherAppVersion.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.

namespace Microsoft.WingetCreateCore.Models
{
using Newtonsoft.Json;

/// <summary>
/// A representation of an OWC publisher app with a defined version.
/// </summary>
public record PublisherAppVersion(string Publisher, string App, string Id, string Version, [property: JsonIgnore] string Path)
: PublisherApp(Publisher, App, Id);
}
11 changes: 11 additions & 0 deletions src/WingetCreateCore/Models/PublisherAppVersionContent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.

namespace Microsoft.WingetCreateCore.Models
{
/// <summary>
/// A representation of an OWC publisher app with a defined content and version.
/// </summary>
public record PublisherAppVersionContent(string Publisher, string App, string Id, string Version, string Path, string Content)
: PublisherAppVersion(Publisher, App, Id, Version, Path);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Publisher>Microsoft Corporation</Publisher>
<Copyright>Microsoft Copyright</Copyright>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Description>Test exe installer for WingetCreateCLI</Description>
<Company>Microsoft Corporation</Company>
<Authors>Microsoft Corporation</Authors>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ private async Task ConfigureForPipelineTestsAsync(string gitHubAppPrivateKey)
/// <summary>
/// Configures the tests to run locally.
/// </summary>
private async Task ConfigureForLocalTestsAsync()
private Task ConfigureForLocalTestsAsync()
{
TestContext.Progress.WriteLine("Running locally, using GitHub token for tests");
if (TokenHelper.TryRead(out string token))
Expand All @@ -94,6 +94,8 @@ private async Task ConfigureForLocalTestsAsync()
">> Please run 'wingetcreate token -s'\n" +
">> Or set the 'WINGET_CREATE_GITHUB_TOKEN' environment variable to a valid GitHub token.");
}

return Task.CompletedTask;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public void TearDown()
/// <summary>
/// Test case for verifying that the "token" can be read from the environment variable after clearing the token cache.
/// </summary>
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
[Test]
public async Task TokenClearAndReadFromEnvironmentVariable()
{
Expand All @@ -63,6 +64,7 @@ public async Task TokenClearAndReadFromEnvironmentVariable()
/// <summary>
/// Test case for verifying that the "token --clear" command is working as expected.
/// </summary>
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
[Test]
public async Task TokenClearCommand()
{
Expand All @@ -74,6 +76,7 @@ public async Task TokenClearCommand()
/// <summary>
/// Test case for verifying that the "token --store" command is working as expected.
/// </summary>
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
[Test]
public async Task TokenStoreCommand()
{
Expand Down