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
18 changes: 9 additions & 9 deletions src/Files.Uwp/ServicesImplementation/SideloadUpdateService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ public async Task DownloadUpdates()

IsUpdating = true;

App.Logger.Info($"Updating: {DownloadUri.AbsoluteUri}");
App.Logger.Info($"SIDELOAD: Updating: {DownloadUri.AbsoluteUri}");
PackageManager pm = new PackageManager();
// Use DeploymentOptions.ForceApplicationShutdown to force shutdown.
await pm.UpdatePackageAsync(DownloadUri, null, DeploymentOptions.None);
App.Logger.Info($"Finished updating: {DownloadUri.AbsoluteUri}");
App.Logger.Info($"SIDELOAD: Finished updating: {DownloadUri.AbsoluteUri}");

IsUpdating = false;
IsUpdateAvailable = false;
Expand All @@ -65,7 +65,7 @@ public Task DownloadMandatoryUpdates()
public async Task CheckForUpdates()
{
var sideloadVersion = _sideloadVersion[Package.Current.Id.Name];
App.Logger.Info($"Checking for updates: {sideloadVersion}");
App.Logger.Info($"SIDELOAD: Checking for updates...{sideloadVersion}");

await CheckForRemoteUpdate(sideloadVersion);
}
Expand All @@ -87,21 +87,21 @@ private async Task CheckForRemoteUpdate(string uri)
currentPackageVersion.Build, currentPackageVersion.Revision);
var remoteVersion = new Version(appInstaller.Version);

App.Logger.Info($"Package Name: {currentPackageName}");
App.Logger.Info($"Remote Package Name: {appInstaller.MainBundle.Name}");
App.Logger.Info($"Current Version: {currentVersion}");
App.Logger.Info($"Remote Version: {remoteVersion}");
App.Logger.Info($"SIDELOAD: Current Package Name: {currentPackageName}");
App.Logger.Info($"SIDELOAD: Remote Package Name: {appInstaller.MainBundle.Name}");
App.Logger.Info($"SIDELOAD: Current Version: {currentVersion}");
App.Logger.Info($"SIDELOAD: Remote Version: {remoteVersion}");

// Check details and version number.
if (appInstaller.MainBundle.Name.Equals(currentPackageName) && remoteVersion.CompareTo(currentVersion) > 0)
{
App.Logger.Info("Update available.");
App.Logger.Info("SIDELOAD: Update found.");
DownloadUri = new Uri(appInstaller.MainBundle.Uri);
IsUpdateAvailable = true;
}
else
{
App.Logger.Warn("Update not available.");
App.Logger.Warn("SIDELOAD: Update not available.");
IsUpdateAvailable = false;
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/Files.Uwp/ServicesImplementation/UpdateService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public async Task DownloadMandatoryUpdates()
{
if (await ShowDialogAsync())
{
App.Logger.Info("STORE: Downloading updates...");
OnUpdateInProgress();
await DownloadAndInstall();
OnUpdateCompleted();
Expand All @@ -92,10 +93,13 @@ public async Task DownloadMandatoryUpdates()

public async Task CheckForUpdates()
{
App.Logger.Info("STORE: Checking for updates...");

await GetUpdatePackages();

if (_updatePackages is not null && _updatePackages.Count > 0)
{
App.Logger.Info("STORE: Update found.");
IsUpdateAvailable = true;
}
}
Expand Down