Skip to content

Commit

Permalink
fix ERROR_MRM_MAP_NOT_FOUND
Browse files Browse the repository at this point in the history
  • Loading branch information
Lightczx committed Dec 27, 2023
1 parent 21618e5 commit 9d71ac8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>Snap.Hutao.Deployment.Runtime</id>
<version>1.6.0</version>
<version>1.7.0</version>
<authors>DGP Studio</authors>
<developmentDependency>true</developmentDependency>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
Expand Down
Binary file modified src/Snap.Hutao.Deployment.Runtime/Snap.Hutao.Deployment.exe
Binary file not shown.
18 changes: 15 additions & 3 deletions src/Snap.Hutao.Deployment/Invocation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.CommandLine.Invocation;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using Windows.Management.Deployment;

Expand Down Expand Up @@ -76,10 +77,21 @@ private static async Task RunDeploymentCoreAsync(string path, string? name)

foreach (Windows.ApplicationModel.Package package in packageManager.FindPackages())
{
if (package is { DisplayName: "Snap Hutao", PublisherDisplayName: "DGP Studio" })
try
{
name = package.Id.FamilyName;
Console.WriteLine($"Package found: {name}");
if (package is { DisplayName: "Snap Hutao", PublisherDisplayName: "DGP Studio" })
{
name = package.Id.FamilyName;
Console.WriteLine($"Package found: {name}");
}
}
catch (COMException ex)
{
// ERROR_MRM_MAP_NOT_FOUND
if (ex.HResult is not unchecked((int)0x80073B1F))
{
throw;
}
}
}
}
Expand Down

0 comments on commit 9d71ac8

Please sign in to comment.