Free, open-source file converter. Convert 263 formats offline by drag & drop — images, PDF, Word, Excel, PowerPoint, HWP/HWPX, video, audio, e-books and archives. No upload, no Office needed.
C# audio-converteravaloniabatch-conversionconvertercsharpdocument-converterdocx-to-pdfdotnetdrag-and-dropfile-conversionfile-converterheic-converterhwphwpximage-converterlinuxmacospdf-convertervideo-converterwindows
Engine update notices, Update installs the latest release, rhwp 0.8.7, version 1.9.0
KnifeLemon939efec98094
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex d46aeb23..070f627f 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -6,6 +6,28 @@ version it publishes under "What's Changed" in the GitHub release notes, above tAdd a `## <version>` section before tagging a release. Write what someone using Filee notices: what's new, where tofind it, what it does and doesn't do.+## 1.9.0++### New++- **Engine updates.** When a Filee update brings a newer version of an engine you downloaded (FFmpeg, LibreOffice,+ Pandoc, Ghostscript, calibre), a card in the bottom-right corner says so once per version, and Settings → Engines+ shows "New version" with an **Update** button. Engines you never installed are left alone, and the card follows+ "Check for updates automatically".+- **When LibreOffice is installed** (Settings → Engines): presentations (PPTX, PPT, ODP) → PDF now go through+ LibreOffice, so slide backgrounds and shape positions come out as in PowerPoint; turn it off to use the built-in+ route. HWP·HWPX → PDF can go through LibreOffice too (off by default), for a document rhwp lays out wrong.++### Fixes++- **Update installed an older release.** A release found by an earlier check stayed the one Update downloaded, even+ after a newer one came out. Update now asks for the latest release first.+- **PPTX → PDF, HWPX, images: picture backgrounds were dropped** (issue #49). A slide whose background is a picture+ (Format Background → Picture) came out white, hiding white titles; the picture now covers the page.+- **HWP·HWPX → PDF: rhwp 0.8.7.** Among other layout fixes, the header table of two-column exam papers sits at the top+ of the page again instead of over the first questions (issue #51; another overlap in that file is reported to rhwp+ as edwardkim/rhwp#7826).+## 1.8.1### Newdiff --git a/Directory.Build.props b/Directory.Build.propsindex cf0e762e..57c2fe3c 100644--- a/Directory.Build.props+++ b/Directory.Build.props@@ -14,7 +14,7 @@parameters of a member is fine (CS1573). --><NoWarn>$(NoWarn);CS1591;CS1573</NoWarn>- <Version>1.8.1</Version>+ <Version>1.9.0</Version><Product>Filee</Product><Authors>Filee contributors</Authors><Copyright>Copyright (c) Filee contributors</Copyright>diff --git a/src/Filee.App/App.axaml.cs b/src/Filee.App/App.axaml.csindex 09f84d03..1040b6b6 100644--- a/src/Filee.App/App.axaml.cs+++ b/src/Filee.App/App.axaml.cs@@ -137,6 +137,26 @@ public partial class App : Application};updates.UpdateFailed += async (_, _) => await AppHost.Get<WindowService>().ShowUpdateFailedAsync();updates.StartPeriodicChecks(() => store.Settings.CheckForUpdates, TimeSpan.FromSeconds(20));+ DispatcherTimer.RunOnce(() => NotifyEngineUpdates(store), TimeSpan.FromSeconds(25));+ }++ /// <summary>+ /// Engines the user downloaded that are older than the versions this Filee pins (it was updated since): one+ /// notice per new version, only to people who installed that engine, and only while update checks are on.+ /// </summary>+ private static void NotifyEngineUpdates(UserDataStore store)+ {+ if (!store.Settings.CheckForUpdates)+ return;+ var downloads = AppHost.Get<EngineDownloadService>();+ downloads.RefreshStatus();+ var outdated = downloads.Outdated;+ if (!outdated.Any(p => store.Settings.NotifiedEngineVersions.GetValueOrDefault(p.Package.Id) != p.Version))+ return;+ foreach (var package in outdated)+ store.Settings.NotifiedEngineVersions[package.Package.Id] = package.Version ?? "";+ store.SaveSettings();+ AppHost.Get<WindowService>().ShowEngineUpdateNotice(outdated);}/// <summary>Applies everything derived from settings. Called at start-up and whenever settings are saved.</summary>diff --git a/src/Filee.App/Assets/i18n/en.json b/src/Filee.App/Assets/i18n/en.jsonindex e0ae3a40..fa298052 100644--- a/src/Filee.App/Assets/i18n/en.json+++ b/src/Filee.App/Assets/i18n/en.json@@ -382,6 +382,9 @@"engines.optional_title": "Optional engines","engines.optional_description": "Large engines are only downloaded when you want them. They are kept when Filee updates and removed when you uninstall it.","engines.all_title": "All engines",+ "engines.update": "Update",+ "engines.state.update_available": "New version {0}",+ "engines.update_notice_title": "Engines you installed have a new version","engines.lo_title": "When LibreOffice is installed","engines.lo_description": "Besides the formats only it reads, LibreOffice can take over conversions it does more faithfully. Without LibreOffice these switches change nothing.","engines.lo_slides": "Use LibreOffice for presentations → PDF",diff --git a/src/Filee.App/Assets/i18n/ko.json b/src/Filee.App/Assets/i18n/ko.jsonindex 364f8a79..803638fe 100644--- a/src/Filee.App/Assets/i18n/ko.json+++ b/src/Filee.App/Assets/i18n/ko.json@@ -382,6 +382,9 @@"engines.optional_title": "선택 설치 엔진","engines.optional_description": "용량이 큰 엔진은 원할 때만 내려받아요. Filee를 업데이트해도 남아 있고, Filee를 제거하면 함께 지워져요.","engines.all_title": "전체 엔진",+ "engines.update": "업데이트",+ "engines.state.update_available": "새 버전 {0}",+ "engines.update_notice_title": "설치한 엔진에 새 버전이 있어요","engines.lo_title": "LibreOffice가 설치돼 있을 때","engines.lo_description": "LibreOffice만 읽을 수 있는 형식 외에도, 더 정확하게 변환하는 작업을 맡길 수 있어요. LibreOffice가 없으면 아래 설정은 아무 영향이 없어요.","engines.lo_slides": "발표 자료 → PDF는 LibreOffice로 변환",diff --git a/src/Filee.App/Assets/i18n/zh-CN.json b/src/Filee.App/Assets/i18n/zh-CN.jsonindex abc1ada6..4f27e220 100644--- a/src/Filee.App/Assets/i18n/zh-CN.json+++ b/src/Filee.App/Assets/i18n/zh-CN.json@@ -382,6 +382,9 @@"engines.optional_title": "可选引擎","engines.optional_description": "体积较大的引擎仅在需要时下载。更新 Filee 时会保留,卸载时一并删除。","engines.all_title": "全部引擎",+ "engines.update": "更新",+ "engines.state.update_available": "新版本 {0}",+ "engines.update_notice_title": "已安装的引擎有新版本","engines.lo_title": "安装了 LibreOffice 时","engines.lo_description": "除了只有它能读取的格式,还可以把它转换得更准确的工作交给 LibreOffice。没有安装 LibreOffice 时,下面的设置没有作用。","engines.lo_slides": "演示文稿 → PDF 使用 LibreOffice",diff --git a/src/Filee.App/Services/EngineDownloadService.cs b/src/Filee.App/Services/EngineDownloadService.csindex 1e5ba3d6..edb2f949 100644--- a/src/Filee.App/Services/EngineDownloadService.cs+++ b/src/Filee.App/Services/EngineDownloadService.cs@@ -62,9 +62,23 @@ public sealed partial class EnginePackageState : ObservableObject[ObservableProperty][NotifyPropertyChangedFor(nameof(StatusText), nameof(IsInstalled), nameof(IsBusy), nameof(CanInstall), nameof(CanRemove),- nameof(UsesOwnCopy), nameof(CanUseOwnCopy), nameof(ShowsCopyFolder))]+ nameof(UsesOwnCopy), nameof(CanUseOwnCopy), nameof(ShowsCopyFolder), nameof(CanUpdate))]private EnginePackageStatus _status;+ /// <summary>+ /// Filee's download is installed but older than the version this Filee pins (engines.json changed with an app+ /// update): <see cref="CanUpdate"/> offers the new one.+ /// </summary>+ [ObservableProperty]+ [NotifyPropertyChangedFor(nameof(StatusText), nameof(CanUpdate))]+ private bool _isOutdated;++ /// <summary>The version Filee downloads now, e.g. "8.0" for FFmpeg (the package's main component).</summary>+ public string? Version => EngineDownloads.Components.TryGetValue(Package.Components[0], out var component) ? component.Version : null;++ /// <summary>Filee's download is installed in an older version than the one Filee downloads now.</summary>+ public bool CanUpdate => Status == EnginePackageStatus.Installed && IsOutdated && EngineDownloads.CanDownload(Package);+/// <summary>Folder of the copy in use while the status is <see cref="EnginePackageStatus.OwnCopy"/>.</summary>[ObservableProperty]private string? _ownCopyFolder;@@ -113,7 +127,7 @@ public sealed partial class EnginePackageState : ObservableObjectEnginePackageStatus.Queued => _loc["engines.state.queued"],EnginePackageStatus.Downloading => _loc.Format("engines.state.downloading", (int)Progress),EnginePackageStatus.Unpacking => _loc["engines.state.unpacking"],- EnginePackageStatus.Installed => _loc["engines.state.installed"],+ EnginePackageStatus.Installed => IsOutdated ? _loc.Format("engines.state.update_available", Version ?? "") : _loc["engines.state.installed"],EnginePackageStatus.OwnCopy => _loc[FromSystem ? "engines.state.system_copy" : "engines.state.own_copy"],EnginePackageStatus.Failed => _loc.Format("engines.state.failed", Error ?? ""),_ => _loc["engines.state.not_installed"],@@ -201,6 +215,7 @@ public sealed class EngineDownloadServicestate.OwnCopyFolder = own ?? system;state.FromSystem = system is not null;state.UpdateNote = null;+ state.IsOutdated = state.OwnCopyFolder is null && _installer.IsInstalled(state.Package) && !_installer.IsUpToDate(state.Package);if (state.OwnCopyFolder is { } folder)_ = CheckVersionAsync(state, folder);return state.OwnCopyFolder is not null ? EnginePackageStatus.OwnCopy@@ -219,10 +234,16 @@ public sealed class EngineDownloadServicestate.UpdateNote = _loc.Format("engines.update_recommended", installed.ToString(2), expected.ToString(2)));}- /// <summary>Downloads and installs a package; packages queue up and install one after another.</summary>+ /// <summary>Filee's downloads that have a newer version now (only engines the user installed).</summary>+ public IReadOnlyList<EnginePackageState> Outdated => Packages.Where(p => p.CanUpdate).ToList();++ /// <summary>+ /// Downloads and installs a package, or the new version of an outdated one; packages queue up and install one+ /// after another.+ /// </summary>public async Task InstallAsync(EnginePackageState state){- if (!state.CanInstall)+ if (!state.CanInstall && !state.CanUpdate)return;using var cancellation = new CancellationTokenSource();state.Cancellation = cancellation;diff --git a/src/Filee.App/Services/UpdateService.cs b/src/Filee.App/Services/UpdateService.csindex ae385337..049bf3f7 100644--- a/src/Filee.App/Services/UpdateService.cs+++ b/src/Filee.App/Services/UpdateService.cs@@ -123,6 +123,17 @@ public sealed partial class UpdateService : ObservableObject/// <summary>Checks the latest release now. Returns the newer version, or null when up to date or offline.</summary>public async Task<string?> CheckAsync(CancellationToken cancellationToken = default)+ {+ await RefreshAsync(announce: true, cancellationToken);+ return LatestVersion;+ }++ /// <summary>+ /// Asks GitHub for the latest release and keeps its files for <see cref="UpdateAsync"/>. With+ /// <paramref name="announce"/>, a newer version than before raises <see cref="UpdateFound"/>. False when the+ /// answer didn't come (offline, an error): what the last check found stays.+ /// </summary>+ internal async Task<bool> RefreshAsync(bool announce, CancellationToken cancellationToken = default){try{@@ -132,15 +143,15 @@ public sealed partial class UpdateService : ObservableObjectif (!response.IsSuccessStatusCode){_log.LogInformation("Update check: {Status}", response.StatusCode); // e.g. 404 before the first release- return LatestVersion;+ return false;}await using var stream = await response.Content.ReadAsStreamAsync(cancellationToken);using var json = await JsonDocument.ParseAsync(stream, cancellationToken: cancellationToken);var tag = json.RootElement.TryGetProperty("tag_name", out var value) ? value.GetString() : null;var newer = IsNewer(tag, CurrentVersion) ? Normalize(tag!) : null;(_installer, _checksums) = FindFiles(json.RootElement);- await Dispatcher.UIThread.InvokeAsync(() => Publish(newer));- return newer;+ await Dispatcher.UIThread.InvokeAsync(() => Publish(newer, announce));+ return true;}// Offline, DNS failure, timeout, a connection dropped while reading, or an unexpected answer: Filee works// offline, so a failed check is only logged and the next one is tried later.@@ -148,7 +159,7 @@ public sealed partial class UpdateService : ObservableObjector InvalidOperationException){_log.LogInformation("Update check failed: {Message}", ex.Message);- return LatestVersion;+ return false;}}@@ -180,14 +191,22 @@ public sealed partial class UpdateService : ObservableObjectOpenDownloadPage();return;}+ // The release found by the last check (up to hours ago) may have a newer one after it: ask again, so Update+ // installs the latest release rather than the one announced earlier. Offline, the earlier answer is used.+ Step = UpdateStep.Downloading;+ DownloadPercent = 0;+ if (await RefreshAsync(announce: false) && !IsUpdateAvailable)+ {+ _log.LogInformation("Update: already on the latest release");+ Step = UpdateStep.Idle;+ return;+ }if (_installer is null || _checksums is null){Fail("release", new InvalidDataException("The latest release has no installer or no checksum file"));return;}- Step = UpdateStep.Downloading;- DownloadPercent = 0;string installer;try{@@ -334,14 +353,17 @@ public sealed partial class UpdateService : ObservableObjectUpdateFailed?.Invoke(this, EventArgs.Empty);}- private void Publish(string? newer)+ private void Publish(string? newer, bool announce){var previous = LatestVersion;LatestVersion = newer;- if (newer is not null && newer != previous)+ if (announce && newer is not null && newer != previous)UpdateFound?.Invoke(this, newer);}+ /// <summary>The installer the next update downloads (tests).</summary>+ internal ReleaseFile? Installer => _installer;+/// <summary>A file attached to a release.</summary>internal sealed record ReleaseFile(string Name, string Url, long Size);diff --git a/src/Filee.App/Services/WindowService.cs b/src/Filee.App/Services/WindowService.csindex bc78e42b..78053c74 100644--- a/src/Filee.App/Services/WindowService.cs+++ b/src/Filee.App/Services/WindowService.cs@@ -19,6 +19,7 @@ public sealed class WindowService(ILocalizer loc, IServiceProvider services)private ToastWindow? _toast;private EngineSetupWindow? _engineSetup;private UpdateNoticeWindow? _updateNotice;+ private EngineUpdateNoticeWindow? _engineNotice;private FeedbackNoticeWindow? _feedbackNotice;public MainWindow? Main => _main;@@ -89,6 +90,35 @@ public sealed class WindowService(ILocalizer loc, IServiceProvider services)notice.Show();}+ /// <summary>+ /// Says that engines the user downloaded have a newer version. "Update" queues them (one after another) and opens+ /// Settings → Engines to show the progress.+ /// </summary>+ public void ShowEngineUpdateNotice(IReadOnlyList<EnginePackageState> outdated)+ {+ _engineNotice?.Close();+ var downloads = services.GetRequiredService<EngineDownloadService>();+ var caption = string.Join(" · ", outdated.Select(p => $"{p.Name.Split(" (")[0]} {p.Version}"));+ var notice = new EngineUpdateNoticeWindow(caption, () =>+ {+ foreach (var package in outdated)+ _ = downloads.InstallAsync(package);+ ShowMain("engines");+ })+ {+ BottomOffset = _updateNotice is { IsVisible: true } update+ ? (int)Math.Ceiling(update.Bounds.Height * (update.Screens.Primary?.Scaling ?? 1))+ : 0,+ };+ notice.Closed += (_, _) =>+ {+ if (_engineNotice == notice)+ _engineNotice = null;+ };+ _engineNotice = notice;+ notice.Show();+ }+/// <summary>Shows the one-time "Is Filee helping you?" card in the bottom-right corner.</summary>public void ShowFeedbackNotice(){diff --git a/src/Filee.App/Views/EngineUpdateNoticeWindow.axaml b/src/Filee.App/Views/EngineUpdateNoticeWindow.axamlnew file mode 100644index 00000000..01a1fa8b--- /dev/null+++ b/src/Filee.App/Views/EngineUpdateNoticeWindow.axaml@@ -0,0 +1,42 @@+<!-- "Engines you installed have a new version" card in the bottom-right corner, shown once per new engine version to+ people who downloaded that engine (App.NotifyEngineUpdates). -->+<Window xmlns="https://github.com/avaloniaui"+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"+ x:Class="Filee.App.Views.EngineUpdateNoticeWindow"+ Title="Filee"+ Width="360"+ SizeToContent="Height"+ WindowDecorations="None"+ Background="Transparent"+ TransparencyLevelHint="Transparent"+ Topmost="True"+ ShowInTaskbar="False"+ ShowActivated="False"+ CanResize="False">+ <Border Classes="card" Margin="12" Padding="16,14">+ <DockPanel>+ <Border DockPanel.Dock="Left" Width="36" Height="36" CornerRadius="999" Margin="0,2,12,0" VerticalAlignment="Top"+ Background="{DynamicResource AccentSoftBrush}">+ <PathIcon Width="18" Height="18" Data="{StaticResource Icon.Engine}" Foreground="{DynamicResource AccentStrongBrush}" />+ </Border>+ <StackPanel Spacing="8">+ <DockPanel>+ <Button DockPanel.Dock="Right" Classes="icon" Padding="4" VerticalAlignment="Top" Click="OnClose">+ <PathIcon Width="12" Height="12" Data="{StaticResource Icon.Close}" />+ </Button>+ <TextBlock FontWeight="SemiBold" TextWrapping="Wrap" VerticalAlignment="Center" Text="{DynamicResource engines.update_notice_title}" />+ </DockPanel>+ <TextBlock x:Name="CaptionText" Classes="caption" TextWrapping="Wrap" />+ <StackPanel Orientation="Horizontal" Spacing="8" Margin="0,2,0,0">+ <Button Classes="accent" Click="OnUpdate" Padding="12,5">+ <StackPanel Orientation="Horizontal" Spacing="6">+ <PathIcon Width="13" Height="13" Data="{StaticResource Icon.Download}" />+ <TextBlock Text="{DynamicResource engines.update}" />+ </StackPanel>+ </Button>+ <Button Content="{DynamicResource update.later}" Click="OnClose" Padding="12,5" />+ </StackPanel>+ </StackPanel>+ </DockPanel>+ </Border>+</Window>diff --git a/src/Filee.App/Views/EngineUpdateNoticeWindow.axaml.cs b/src/Filee.App/Views/EngineUpdateNoticeWindow.axaml.csnew file mode 100644index 00000000..1741250d--- /dev/null+++ b/src/Filee.App/Views/EngineUpdateNoticeWindow.axaml.cs@@ -0,0 +1,50 @@+using Avalonia;+using Avalonia.Controls;+using Avalonia.Interactivity;+using Filee.App.Services;++namespace Filee.App.Views;++/// <summary>+/// Bottom-right notice that engines the user downloaded have a newer version. "Update" queues their downloads and+/// opens Settings → Engines, where the progress shows.+/// </summary>+public partial class EngineUpdateNoticeWindow : Window+{+ private const int ScreenMargin = 12;+ private readonly Action? _update;++ public EngineUpdateNoticeWindow() => InitializeComponent();++ /// <param name="caption">The engines and their new versions, e.g. "FFmpeg 8.0 · LibreOffice 26.8".</param>+ /// <param name="update">Starts the updates.</param>+ public EngineUpdateNoticeWindow(string caption, Action update) : this()+ {+ _update = update;+ CaptionText.Text = caption;+ Motion.Track(this);+ SizeChanged += (_, _) => PlaceBottomRight();+ }++ /// <summary>Extra distance from the bottom of the screen, e.g. to stay above another card.</summary>+ public int BottomOffset { get; set; }++ private void OnUpdate(object? sender, RoutedEventArgs e)+ {+ _update?.Invoke();+ Close();+ }++ private void OnClose(object? sender, RoutedEventArgs e) => Close();++ private void PlaceBottomRight()+ {+ var screen = Screens.Primary;+ if (screen is null)+ return;+ var area = screen.WorkingArea;+ var width = (int)Math.Ceiling(Bounds.Width * screen.Scaling);+ var height = (int)Math.Ceiling(Bounds.Height * screen.Scaling);+ Position = new PixelPoint(area.Right - width - ScreenMargin, area.Bottom - height - ScreenMargin - BottomOffset);+ }+}diff --git a/src/Filee.App/Views/Pages/EnginesPage.axaml b/src/Filee.App/Views/Pages/EnginesPage.axamlindex 703d4481..a053a7ad 100644--- a/src/Filee.App/Views/Pages/EnginesPage.axaml+++ b/src/Filee.App/Views/Pages/EnginesPage.axaml@@ -37,6 +37,8 @@<StackPanel DockPanel.Dock="Right" Orientation="Horizontal" Spacing="6" VerticalAlignment="Center" Margin="12,0,0,0"><Button Classes="accent" Content="{DynamicResource engines.install}" IsVisible="{Binding CanInstall}"Command="{Binding $parent[ItemsControl].((vm:EnginesPageViewModel)DataContext).InstallCommand}" CommandParameter="{Binding}" />+ <Button Classes="accent" Content="{DynamicResource engines.update}" IsVisible="{Binding CanUpdate}"+ Command="{Binding $parent[ItemsControl].((vm:EnginesPageViewModel)DataContext).InstallCommand}" CommandParameter="{Binding}" /><Button Content="{DynamicResource engines.cancel}" IsVisible="{Binding IsBusy}"Command="{Binding $parent[ItemsControl].((vm:EnginesPageViewModel)DataContext).CancelCommand}" CommandParameter="{Binding}" /><Button Content="{DynamicResource engines.use_own}" IsVisible="{Binding CanUseOwnCopy}" Click="OnUseOwnCopy"diff --git a/src/Filee.Core/Settings/AppSettings.cs b/src/Filee.Core/Settings/AppSettings.csindex 2b3e699d..0d467d49 100644--- a/src/Filee.Core/Settings/AppSettings.cs+++ b/src/Filee.Core/Settings/AppSettings.cs@@ -70,6 +70,9 @@ public sealed class AppSettings/// <summary>Newest version the user was already told about, so the update notice shows once per release.</summary>public string? NotifiedUpdateVersion { get; set; }+ /// <summary>Engine package id → the new version the engine update notice was shown for (once per version).</summary>+ public Dictionary<string, string> NotifiedEngineVersions { get; set; } = [];+/// <summary>Temporarily disable all trigger gestures (tray "Pause").</summary>public bool Paused { get; set; }diff --git a/src/Filee.Engines/Infrastructure/engines.json b/src/Filee.Engines/Infrastructure/engines.jsonindex 1501176b..b2657805 100644--- a/src/Filee.Engines/Infrastructure/engines.json+++ b/src/Filee.Engines/Infrastructure/engines.json@@ -2,10 +2,10 @@"_comment": "Downloadable conversion engines: pinned URL + SHA-256. Used by the app (Settings > Engines, first-run setup) and by build/fetch-engines.ps1. Bumping a version = change url, sha256 and size together.","components": {"rhwp": {- "version": "0.8.6",- "url": "https://github.com/edwardkim/rhwp/releases/download/v0.8.6/rhwp-v0.8.6-windows-x86_64.zip",- "sha256": "867E0A84B778EBDA92B88433EDE301818EAEA21E7D58EB77FF9A732F41D170D9",- "size": 10270410,+ "version": "0.8.7",+ "url": "https://github.com/edwardkim/rhwp/releases/download/v0.8.7/rhwp-v0.8.7-windows-x86_64.zip",+ "sha256": "F7AC326E98F595AE8FECD8DA7A614EE9A37DB77BDF938782A8E07C9DA473EC6F",+ "size": 19796112,"kind": "zip"},"7zip": {@@ -76,10 +76,10 @@"linux-x64": {"components": {"rhwp": {- "version": "0.8.6",- "url": "https://github.com/edwardkim/rhwp/releases/download/v0.8.6/rhwp-v0.8.6-linux-x86_64.tar.gz",- "sha256": "458DE22A6B9B86088DFDCD59552D4E8FAB5362A64578C64761FA28DF9BE45E9A",- "size": 10092553,+ "version": "0.8.7",+ "url": "https://github.com/edwardkim/rhwp/releases/download/v0.8.7/rhwp-v0.8.7-linux-x86_64.tar.gz",+ "sha256": "F1E541A25CFE76B6BC1DAF18BF9C1F9A5AC5E03E2C01B188DAAF54107214F631",+ "size": 14678662,"kind": "tar.gz"},"7zip": {@@ -115,10 +115,10 @@"linux-arm64": {"components": {"rhwp": {- "version": "0.8.6",- "url": "https://github.com/edwardkim/rhwp/releases/download/v0.8.6/rhwp-v0.8.6-linux-aarch64.tar.gz",- "sha256": "1288AA5609A67574A6B1372397BEF9A8941FDA9AD16B1224342512F915AE016E",- "size": 9330223,+ "version": "0.8.7",+ "url": "https://github.com/edwardkim/rhwp/releases/download/v0.8.7/rhwp-v0.8.7-linux-aarch64.tar.gz",+ "sha256": "C4A70F5ED11B99586EE89D1AC9069145D58A0831D00E87858BB01626E2EBF313",+ "size": 13842675,"kind": "tar.gz"},"7zip": {@@ -154,10 +154,10 @@"osx-x64": {"components": {"rhwp": {- "version": "0.8.6",- "url": "https://github.com/edwardkim/rhwp/releases/download/v0.8.6/rhwp-v0.8.6-macos-x86_64.tar.gz",- "sha256": "A9581617E7CCAB75481B9D36069D28C46E30A543A1FB0AA9FF581567A25321B8",- "size": 9776200,+ "version": "0.8.7",+ "url": "https://github.com/edwardkim/rhwp/releases/download/v0.8.7/rhwp-v0.8.7-macos-x86_64.tar.gz",+ "sha256": "07B1A5EA570E410D1B52B4D848A94F00C64674E84004883C62EFAD7DAAB61DA4",+ "size": 14156825,"kind": "tar.gz"},"7zip": {@@ -193,10 +193,10 @@"osx-arm64": {"components": {"rhwp": {- "version": "0.8.6",- "url": "https://github.com/edwardkim/rhwp/releases/download/v0.8.6/rhwp-v0.8.6-macos-aarch64.tar.gz",- "sha256": "7D8928FAEB03F00C35C8028F0B562F08F3DA22BEF86F750E0D7E0CD19344EAA3",- "size": 8972945,+ "version": "0.8.7",+ "url": "https://github.com/edwardkim/rhwp/releases/download/v0.8.7/rhwp-v0.8.7-macos-aarch64.tar.gz",+ "sha256": "6ED46AA63F6D10C447842999F73ABC59CF9586C5645FEFC5E763BD6A6D43662D",+ "size": 12941874,"kind": "tar.gz"},"7zip": {diff --git a/tests/Filee.App.Tests/EngineUpdateTests.cs b/tests/Filee.App.Tests/EngineUpdateTests.csnew file mode 100644index 00000000..b36e2fe9--- /dev/null+++ b/tests/Filee.App.Tests/EngineUpdateTests.cs@@ -0,0 +1,66 @@+// Engines the user downloaded that are older than what this Filee pins: an Update button and a one-time notice.++using Avalonia.Headless;+using Avalonia.Headless.XUnit;+using Avalonia.VisualTree;+using Filee.App.Services;+using Filee.App.Views;+using Filee.Core.Localization;+using Filee.Engines.Infrastructure;++namespace Filee.App.Tests;++public class EngineUpdateTests+{+ private static EnginePackageState Ffmpeg() =>+ new(EngineDownloads.Packages.Single(p => p.Id == "ffmpeg"), AppHost.Get<ILocalizer>());++ [AvaloniaFact]+ public void An_outdated_download_offers_the_new_version()+ {+ TestServices.EnsureInitialized("ko");+ var state = Ffmpeg();+ Assert.SkipUnless(EngineDownloads.CanDownload(state.Package), "FFmpeg is not downloaded on this platform");++ state.Status = EnginePackageStatus.Installed;+ Assert.False(state.CanUpdate);+ Assert.Equal(AppHost.Get<ILocalizer>()["engines.state.installed"], state.StatusText);++ state.IsOutdated = true;+ Assert.True(state.CanUpdate);+ Assert.False(state.CanInstall);+ Assert.Contains(state.Version!, state.StatusText);+ }++ [AvaloniaFact]+ public void Copies_filee_did_not_download_are_never_offered_an_update()+ {+ TestServices.EnsureInitialized("en");+ var state = Ffmpeg();+ state.IsOutdated = true;++ state.Status = EnginePackageStatus.OwnCopy;+ Assert.False(state.CanUpdate);+ state.Status = EnginePackageStatus.NotInstalled;+ Assert.False(state.CanUpdate);+ }++ [AvaloniaFact]+ public void The_notice_names_the_engines_and_update_starts_them()+ {+ TestServices.EnsureInitialized("ko");+ var updated = 0;+ var notice = new EngineUpdateNoticeWindow("FFmpeg 8.0 · LibreOffice 26.8", () => updated++);+ notice.Show();+ Avalonia.Threading.Dispatcher.UIThread.RunJobs();++ var frame = notice.CaptureRenderedFrame();+ frame?.Save(Path.Combine(TestServices.ScreenshotDirectory, "engine-update-notice-ko.png"));+ var update = notice.GetVisualDescendants().OfType<Avalonia.Controls.Button>()+ .First(b => b.Classes.Contains("accent"));+ update.RaiseEvent(new Avalonia.Interactivity.RoutedEventArgs(Avalonia.Controls.Button.ClickEvent));++ Assert.Equal(1, updated);+ Assert.False(notice.IsVisible);+ }+}diff --git a/tests/Filee.App.Tests/UpdateServiceTests.cs b/tests/Filee.App.Tests/UpdateServiceTests.csindex bf77ffe8..137abb56 100644--- a/tests/Filee.App.Tests/UpdateServiceTests.cs+++ b/tests/Filee.App.Tests/UpdateServiceTests.cs@@ -3,6 +3,7 @@ using System.Net.Sockets;using System.Security.Cryptography;using System.Text;using System.Text.Json;+using Avalonia.Headless.XUnit;using Filee.App.Services;using Microsoft.Extensions.Logging.Abstractions;@@ -242,6 +243,40 @@ public class UpdateServiceTestsAssert.Equal(UpdateStep.Failed, updates.Step);}+ [AvaloniaFact] // the check publishes its answer on the UI thread+ public async Task Update_installs_the_release_that_is_latest_now_not_the_one_found_earlier()+ {+ // An earlier check found 9.9.9; 9.9.10 came out before Update was pressed.+ var updates = new UpdateService(NullLogger<UpdateService>.Instance, new LatestRelease("v9.9.10"));+ updates.UseRelease(new UpdateService.ReleaseFile("Filee-9.9.9-win-Setup.exe", Base + "Filee-9.9.9-win-Setup.exe", 1),+ new UpdateService.ReleaseFile("Filee-9.9.9-SHA256SUMS.txt", Base + "Filee-9.9.9-SHA256SUMS.txt", 1));+ var announced = 0;+ updates.UpdateFound += (_, _) => announced++;++ Assert.True(await updates.RefreshAsync(announce: false));++ Assert.Equal("Filee-9.9.10-win-Setup.exe", updates.Installer!.Name);+ Assert.Equal("9.9.10", updates.LatestVersion);+ Assert.Equal(0, announced); // no second notice while updating+ }++ /// <summary>GitHub's "latest release" answer for <paramref name="tag"/>, with its installer and checksums.</summary>+ private sealed class LatestRelease(string tag) : HttpMessageHandler+ {+ protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)+ {+ var version = tag.TrimStart('v');+ var json = $$"""+ {"tag_name":"{{tag}}","assets":[+ {"name":"Filee-{{version}}-win-Setup.exe","browser_download_url":"{{Base}}Filee-{{version}}-win-Setup.exe","size":1234},+ {"name":"Filee-{{version}}-SHA256SUMS.txt","browser_download_url":"{{Base}}Filee-{{version}}-SHA256SUMS.txt","size":100}]}+ """;+ return Task.FromResult(request.RequestUri!.AbsolutePath.EndsWith("/releases/latest", StringComparison.Ordinal)+ ? new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent(json, Encoding.UTF8, "application/json") }+ : new HttpResponseMessage(HttpStatusCode.NotFound));+ }+ }+[Fact]public void Download_page_is_the_latest_release(){