Skip to content

Commit

Permalink
Fix: Fixed FileLoadException when failing to update app (#14631)
Browse files Browse the repository at this point in the history
  • Loading branch information
yaira2 authored Feb 4, 2024
1 parent 57fa0a4 commit 21cb4f2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Files.App/Services/SideloadUpdateService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,12 @@ private async Task ApplyPackageUpdateAsync()

IsUpdating = true;

PackageManager pm = new PackageManager();
DeploymentResult? result = null;

try
{
PackageManager packageManager = new PackageManager();

var restartStatus = RegisterApplicationRestart(null, 0);
App.AppModel.ForceProcessTermination = true;

Expand All @@ -237,11 +238,11 @@ await Task.Run(async () =>
{
var bundlePath = new Uri(ApplicationData.Current.LocalFolder.Path + "\\" + TEMPORARY_UPDATE_PACKAGE_NAME);

var deployment = pm.RequestAddPackageAsync(
var deployment = packageManager.RequestAddPackageAsync(
bundlePath,
null,
DeploymentOptions.ForceApplicationShutdown,
pm.GetDefaultPackageVolume(),
packageManager.GetDefaultPackageVolume(),
null,
null);

Expand Down

0 comments on commit 21cb4f2

Please sign in to comment.