Merge pull request #4 from DGP-Studio/fix/crash

This commit is contained in:
DismissedLight
2024-01-12 09:19:54 +08:00
committed by GitHub
3 changed files with 75 additions and 72 deletions

View File

@@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>Snap.Hutao.Deployment.Runtime</id>
<version>1.9.0</version>
<version>1.10.0</version>
<authors>DGP Studio</authors>
<developmentDependency>true</developmentDependency>
<requireLicenseAcceptance>false</requireLicenseAcceptance>

View File

@@ -45,15 +45,26 @@ internal static partial class Invocation
}
}
try
{
await Certificate.EnsureGlobalSignCodeSigningRootR45Async().ConfigureAwait(false);
await WindowsAppSDKDependency.EnsureAsync(path).ConfigureAwait(false);
await RunDeploymentCoreAsync(path, name, isUpdateMode).ConfigureAwait(false);
}
catch (Exception ex)
{
Console.WriteLine($"""
Exception occured:
{ex}
""");
}
finally
{
await ExitAsync(isUpdateMode).ConfigureAwait(false);
}
}
private static async Task RunDeploymentCoreAsync(string path, string? name, bool isUpdateMode)
{
try
{
Console.WriteLine("Initializing PackageManager...");
PackageManager packageManager = new();
@@ -117,21 +128,13 @@ internal static partial class Invocation
""");
}
}
catch (Exception ex)
{
Console.WriteLine($"""
Exception occured:
{ex}
""");
}
}
private static async ValueTask ExitAsync(bool isUpdateMode)
{
if (!isUpdateMode)
{
Console.WriteLine("Press any key to exit...");
Console.ReadKey();
Console.WriteLine("Press enter to exit...");
while (Console.ReadKey(true).Key != ConsoleKey.Enter) ;
FreeConsole();
}
else