mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.Deployment.git
synced 2025-11-19 21:08:45 +08:00
add msix corruted message
This commit is contained in:
2
.github/workflows/Publish.yml
vendored
2
.github/workflows/Publish.yml
vendored
@@ -7,7 +7,7 @@ on:
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: windows-latest
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>Snap.Hutao.Deployment.Runtime</id>
|
||||
<version>1.14.0</version>
|
||||
<version>1.15.0</version>
|
||||
<authors>DGP Studio</authors>
|
||||
<developmentDependency>true</developmentDependency>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
|
||||
Binary file not shown.
@@ -20,8 +20,27 @@ internal static partial class WindowsAppSDKDependency
|
||||
public static async Task EnsureAsync(string packagePath)
|
||||
{
|
||||
using FileStream packageStream = File.OpenRead(packagePath);
|
||||
using ZipArchive package = new(packageStream, ZipArchiveMode.Read);
|
||||
ZipArchive package = default!;
|
||||
try
|
||||
{
|
||||
package = new(packageStream, ZipArchiveMode.Read);
|
||||
}
|
||||
catch (InvalidDataException)
|
||||
{
|
||||
Console.WriteLine("Msix Package corrupted, please re-launch Deployment and try again");
|
||||
try
|
||||
{
|
||||
File.Delete(packagePath);
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
|
||||
throw;
|
||||
}
|
||||
|
||||
using (package)
|
||||
{
|
||||
(string packageName, string msixVersion) = await ExtractRuntimePackageNameAndMsixMinVersionFromAppManifestAsync(package).ConfigureAwait(false);
|
||||
if (string.IsNullOrEmpty(packageName) || string.IsNullOrEmpty(msixVersion))
|
||||
{
|
||||
@@ -44,6 +63,7 @@ internal static partial class WindowsAppSDKDependency
|
||||
|
||||
Console.WriteLine("Start downloading SDK installer...");
|
||||
await DownloadWindowsAppRuntimeInstallAndInstallAsync(sdkVersion).ConfigureAwait(false);
|
||||
};
|
||||
}
|
||||
|
||||
private static async Task<string> ExtractSDKVersionFromDepsJsonAsync(ZipArchive package)
|
||||
|
||||
Reference in New Issue
Block a user