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
Uninstall: say that files still in use go at the next restart (#519)
KnifeLemon1e33e964bde0
diff --git a/src/Filee.App/Assets/i18n/ar.json b/src/Filee.App/Assets/i18n/ar.jsonindex 028a9c70..4d89df20 100644--- a/src/Filee.App/Assets/i18n/ar.json+++ b/src/Filee.App/Assets/i18n/ar.json@@ -1108,6 +1108,7 @@"installer.uninstall.progress": "جارٍ إزالة Filee","installer.uninstall.done_title": "أُزيل Filee","installer.uninstall.done": "لم يعد Filee موجودًا على هذا الكمبيوتر.",+ "installer.uninstall.restart": "تُحذف بعض الملفات التي كانت لا تزال قيد الاستخدام عند إعادة تشغيل الكمبيوتر. لا حاجة إلى حذف أي شيء يدويًا.","installer.uninstall.settings_kept": "تبقى إعداداتك لحين تثبيت Filee مجددًا.","installer.uninstall.not_installed": "Filee غير مثبّت في {0}.","installer.options.hide": "إخفاء",diff --git a/src/Filee.App/Assets/i18n/de.json b/src/Filee.App/Assets/i18n/de.jsonindex d19add20..23e57ebc 100644--- a/src/Filee.App/Assets/i18n/de.json+++ b/src/Filee.App/Assets/i18n/de.json@@ -1108,6 +1108,7 @@"installer.uninstall.progress": "Filee wird entfernt","installer.uninstall.done_title": "Filee wurde entfernt","installer.uninstall.done": "Filee ist nicht mehr auf diesem Computer installiert.",+ "installer.uninstall.restart": "Einige Dateien, die noch verwendet wurden, werden beim nächsten Neustart des Computers gelöscht. Du musst nichts von Hand löschen.","installer.uninstall.settings_kept": "Deine Einstellungen bleiben für eine erneute Installation von Filee erhalten.","installer.uninstall.not_installed": "Filee ist nicht in {0} installiert.","installer.options.hide": "Ausblenden",diff --git a/src/Filee.App/Assets/i18n/en.json b/src/Filee.App/Assets/i18n/en.jsonindex eec07b44..c24a2de0 100644--- a/src/Filee.App/Assets/i18n/en.json+++ b/src/Filee.App/Assets/i18n/en.json@@ -1128,6 +1128,7 @@"installer.uninstall.progress": "Removing Filee","installer.uninstall.done_title": "Filee was removed","installer.uninstall.done": "Filee is no longer on this computer.",+ "installer.uninstall.restart": "A few files that were still in use are deleted when you restart the computer. There is nothing to delete by hand.","installer.uninstall.settings_kept": "Your settings stay, for when you install Filee again.","installer.uninstall.not_installed": "Filee is not installed in {0}.","installer.options.hide": "Hide",diff --git a/src/Filee.App/Assets/i18n/es.json b/src/Filee.App/Assets/i18n/es.jsonindex 8c7c0829..c672c7e9 100644--- a/src/Filee.App/Assets/i18n/es.json+++ b/src/Filee.App/Assets/i18n/es.json@@ -1108,6 +1108,7 @@"installer.uninstall.progress": "Quitando Filee","installer.uninstall.done_title": "Filee se ha quitado","installer.uninstall.done": "Filee ya no está en este equipo.",+ "installer.uninstall.restart": "Algunos archivos que aún estaban en uso se eliminan al reiniciar el equipo. No tienes que borrar nada a mano.","installer.uninstall.settings_kept": "Tus ajustes se conservan para cuando vuelvas a instalar Filee.","installer.uninstall.not_installed": "Filee no está instalado en {0}.","installer.options.hide": "Ocultar",diff --git a/src/Filee.App/Assets/i18n/fr.json b/src/Filee.App/Assets/i18n/fr.jsonindex 1aa508fa..7542f9e9 100644--- a/src/Filee.App/Assets/i18n/fr.json+++ b/src/Filee.App/Assets/i18n/fr.json@@ -1128,6 +1128,7 @@"installer.uninstall.progress": "Suppression de Filee","installer.uninstall.done_title": "Filee a été supprimé","installer.uninstall.done": "Filee n'est plus présent sur cet ordinateur.",+ "installer.uninstall.restart": "Quelques fichiers encore utilisés sont supprimés au redémarrage de l'ordinateur. Il n'y a rien à supprimer à la main.","installer.uninstall.settings_kept": "Vos paramètres sont conservés, pour le jour où vous réinstallerez Filee.","installer.uninstall.not_installed": "Filee n'est pas installé dans {0}.","installer.options.hide": "Masquer",diff --git a/src/Filee.App/Assets/i18n/hi.json b/src/Filee.App/Assets/i18n/hi.jsonindex afa6648c..fc1be047 100644--- a/src/Filee.App/Assets/i18n/hi.json+++ b/src/Filee.App/Assets/i18n/hi.json@@ -1108,6 +1108,7 @@"installer.uninstall.progress": "Filee हटाया जा रहा है","installer.uninstall.done_title": "Filee हटा दिया गया","installer.uninstall.done": "Filee अब इस कंप्यूटर पर नहीं है।",+ "installer.uninstall.restart": "जो कुछ फ़ाइलें अभी उपयोग में थीं, वे कंप्यूटर रीस्टार्ट करने पर हट जाएँगी। आपको कुछ भी हाथ से हटाने की ज़रूरत नहीं है।","installer.uninstall.settings_kept": "आपकी सेटिंग्स रखी गई हैं, ताकि Filee दोबारा इंस्टॉल करने पर काम आएँ।","installer.uninstall.not_installed": "{0} में Filee इंस्टॉल नहीं है।","installer.options.hide": "छिपाएँ",diff --git a/src/Filee.App/Assets/i18n/id.json b/src/Filee.App/Assets/i18n/id.jsonindex 8b224b6a..49e2bfd6 100644--- a/src/Filee.App/Assets/i18n/id.json+++ b/src/Filee.App/Assets/i18n/id.json@@ -1108,6 +1108,7 @@"installer.uninstall.progress": "Menghapus Filee","installer.uninstall.done_title": "Filee telah dihapus","installer.uninstall.done": "Filee sudah tidak ada lagi di komputer ini.",+ "installer.uninstall.restart": "Beberapa file yang masih digunakan akan dihapus saat Anda memulai ulang komputer. Tidak ada yang perlu dihapus secara manual.","installer.uninstall.settings_kept": "Pengaturan Anda tetap disimpan jika Anda memasang Filee lagi nanti.","installer.uninstall.not_installed": "Filee tidak terpasang di {0}.","installer.options.hide": "Sembunyikan",diff --git a/src/Filee.App/Assets/i18n/it.json b/src/Filee.App/Assets/i18n/it.jsonindex ab0af57e..982e035c 100644--- a/src/Filee.App/Assets/i18n/it.json+++ b/src/Filee.App/Assets/i18n/it.json@@ -1108,6 +1108,7 @@"installer.uninstall.progress": "Rimozione di Filee","installer.uninstall.done_title": "Filee è stato rimosso","installer.uninstall.done": "Filee non è più su questo computer.",+"installer.uninstall.restart": "Alcuni file ancora in uso vengono eliminati al riavvio del computer. Non c'è niente da eliminare a mano.","installer.uninstall.settings_kept": "Le tue impostazioni restano, per quando installerai di nuovo Filee.","installer.uninstall.not_installed": "Filee non è installato in {0}.","installer.options.hide": "Nascondi",diff --git a/src/Filee.App/Assets/i18n/ja.json b/src/Filee.App/Assets/i18n/ja.jsonindex 5f18b62d..3ff6150e 100644--- a/src/Filee.App/Assets/i18n/ja.json+++ b/src/Filee.App/Assets/i18n/ja.json@@ -1108,6 +1108,7 @@"installer.uninstall.progress": "Fileeを削除しています","installer.uninstall.done_title": "Fileeを削除しました","installer.uninstall.done": "Fileeはこのコンピューターから削除されました。",+ "installer.uninstall.restart": "使用中だった一部のファイルは、コンピューターを再起動すると削除されます。手動で削除するものはありません。","installer.uninstall.settings_kept": "設定は残してあります。Fileeを再インストールすると、そのまま使えます。","installer.uninstall.not_installed": "{0}にFileeはインストールされていません。","installer.options.hide": "閉じる",diff --git a/src/Filee.App/Assets/i18n/ko.json b/src/Filee.App/Assets/i18n/ko.jsonindex f6630867..5155834a 100644--- a/src/Filee.App/Assets/i18n/ko.json+++ b/src/Filee.App/Assets/i18n/ko.json@@ -1128,6 +1128,7 @@"installer.uninstall.progress": "Filee 제거 중","installer.uninstall.done_title": "Filee를 제거했어요","installer.uninstall.done": "Filee가 이 컴퓨터에서 제거됐어요.",+ "installer.uninstall.restart": "사용 중이던 파일 몇 개는 컴퓨터를 다시 시작하면 지워져요. 직접 지울 것은 없어요.","installer.uninstall.settings_kept": "설정은 남겨 뒀어요. Filee를 다시 설치하면 그대로 쓸 수 있어요.","installer.uninstall.not_installed": "{0}에 Filee가 설치되어 있지 않아요.","installer.options.hide": "접기",diff --git a/src/Filee.App/Assets/i18n/ne.json b/src/Filee.App/Assets/i18n/ne.jsonindex b39570fe..64721b64 100644--- a/src/Filee.App/Assets/i18n/ne.json+++ b/src/Filee.App/Assets/i18n/ne.json@@ -1108,6 +1108,7 @@"installer.uninstall.progress": "Filee हटाइँदैछ","installer.uninstall.done_title": "Filee हटाइयो","installer.uninstall.done": "Filee अब यस कम्प्युटरमा छैन।",+ "installer.uninstall.restart": "प्रयोगमा रहेका केही फाइलहरू कम्प्युटर पुनः सुरु गर्दा मेटिनेछन्। तपाईंले हातैले केही मेटाउनु पर्दैन।","installer.uninstall.settings_kept": "तपाईंका सेटिङहरू राखिएका छन्, ताकि तपाईंले फेरि Filee स्थापना गर्दा काम आओस्।","installer.uninstall.not_installed": "{0} मा Filee स्थापना गरिएको छैन।","installer.options.hide": "लुकाउनुहोस्",diff --git a/src/Filee.App/Assets/i18n/pl.json b/src/Filee.App/Assets/i18n/pl.jsonindex efdc72b8..c5b73494 100644--- a/src/Filee.App/Assets/i18n/pl.json+++ b/src/Filee.App/Assets/i18n/pl.json@@ -1128,6 +1128,7 @@"installer.uninstall.progress": "Usuwanie Filee","installer.uninstall.done_title": "Usunięto Filee","installer.uninstall.done": "Filee nie ma już na tym komputerze.",+ "installer.uninstall.restart": "Kilka plików, które były jeszcze w użyciu, zostanie usuniętych po ponownym uruchomieniu komputera. Nie trzeba niczego usuwać ręcznie.","installer.uninstall.settings_kept": "Ustawienia zostały zachowane na wypadek ponownej instalacji Filee.","installer.uninstall.not_installed": "Filee nie jest zainstalowany w {0}.","installer.options.hide": "Ukryj",diff --git a/src/Filee.App/Assets/i18n/pt-BR.json b/src/Filee.App/Assets/i18n/pt-BR.jsonindex 5f7220f2..4cb13284 100644--- a/src/Filee.App/Assets/i18n/pt-BR.json+++ b/src/Filee.App/Assets/i18n/pt-BR.json@@ -1128,6 +1128,7 @@"installer.uninstall.progress": "Removendo o Filee","installer.uninstall.done_title": "O Filee foi removido","installer.uninstall.done": "O Filee não está mais neste computador.",+ "installer.uninstall.restart": "Alguns arquivos que ainda estavam em uso são excluídos quando você reiniciar o computador. Não há nada para apagar manualmente.","installer.uninstall.settings_kept": "Suas configurações permanecem, para quando você instalar o Filee de novo.","installer.uninstall.not_installed": "O Filee não está instalado em {0}.","installer.options.hide": "Ocultar",diff --git a/src/Filee.App/Assets/i18n/pt-PT.json b/src/Filee.App/Assets/i18n/pt-PT.jsonindex 241d43b5..c5f5deba 100644--- a/src/Filee.App/Assets/i18n/pt-PT.json+++ b/src/Filee.App/Assets/i18n/pt-PT.json@@ -1128,6 +1128,7 @@"installer.uninstall.progress": "A remover o Filee","installer.uninstall.done_title": "O Filee foi removido","installer.uninstall.done": "O Filee já não está neste computador.",+ "installer.uninstall.restart": "Alguns ficheiros que ainda estavam em uso são eliminados quando reiniciares o computador. Não há nada para apagar manualmente.","installer.uninstall.settings_kept": "As tuas definições são mantidas para quando voltares a instalar o Filee.","installer.uninstall.not_installed": "O Filee não está instalado em {0}.","installer.options.hide": "Ocultar",diff --git a/src/Filee.App/Assets/i18n/ru.json b/src/Filee.App/Assets/i18n/ru.jsonindex 596877e5..911d72da 100644--- a/src/Filee.App/Assets/i18n/ru.json+++ b/src/Filee.App/Assets/i18n/ru.json@@ -1128,6 +1128,7 @@"installer.uninstall.progress": "Удаление Filee","installer.uninstall.done_title": "Filee удалён","installer.uninstall.done": "Filee больше нет на этом компьютере.",+ "installer.uninstall.restart": "Несколько файлов, которые ещё использовались, удалятся после перезагрузки компьютера. Вручную ничего удалять не нужно.","installer.uninstall.settings_kept": "Настройки сохранены на случай повторной установки Filee.","installer.uninstall.not_installed": "Filee не установлен в {0}.","installer.options.hide": "Скрыть",diff --git a/src/Filee.App/Assets/i18n/th.json b/src/Filee.App/Assets/i18n/th.jsonindex 856bf23a..42c9c874 100644--- a/src/Filee.App/Assets/i18n/th.json+++ b/src/Filee.App/Assets/i18n/th.json@@ -1108,6 +1108,7 @@"installer.uninstall.progress": "กำลังลบ Filee","installer.uninstall.done_title": "ลบ Filee เรียบร้อยแล้ว","installer.uninstall.done": "Filee ไม่มีอยู่ในคอมพิวเตอร์เครื่องนี้แล้ว",+ "installer.uninstall.restart": "ไฟล์บางไฟล์ที่ยังถูกใช้งานอยู่จะถูกลบเมื่อคุณรีสตาร์ตคอมพิวเตอร์ ไม่ต้องลบอะไรเอง","installer.uninstall.settings_kept": "การตั้งค่าของคุณยังคงถูกเก็บไว้ สำหรับการติดตั้ง Filee ใหม่อีกครั้ง","installer.uninstall.not_installed": "ไม่ได้ติดตั้ง Filee ไว้ใน {0}","installer.options.hide": "ซ่อน",diff --git a/src/Filee.App/Assets/i18n/tr.json b/src/Filee.App/Assets/i18n/tr.jsonindex f3e22f33..f7fa83e0 100644--- a/src/Filee.App/Assets/i18n/tr.json+++ b/src/Filee.App/Assets/i18n/tr.json@@ -1108,6 +1108,7 @@"installer.uninstall.progress": "Filee kaldırılıyor","installer.uninstall.done_title": "Filee kaldırıldı","installer.uninstall.done": "Filee artık bu bilgisayarda bulunmuyor.",+ "installer.uninstall.restart": "Hâlâ kullanımda olan birkaç dosya bilgisayarı yeniden başlattığınızda silinir. Elle silmeniz gereken bir şey yok.","installer.uninstall.settings_kept": "Filee'yi yeniden kurmanız için ayarlarınız saklanıyor.","installer.uninstall.not_installed": "Filee {0} konumunda kurulu değil.","installer.options.hide": "Gizle",diff --git a/src/Filee.App/Assets/i18n/zh-CN.json b/src/Filee.App/Assets/i18n/zh-CN.jsonindex 95be8e54..0986c0da 100644--- a/src/Filee.App/Assets/i18n/zh-CN.json+++ b/src/Filee.App/Assets/i18n/zh-CN.json@@ -1128,6 +1128,7 @@"installer.uninstall.progress": "正在移除 Filee","installer.uninstall.done_title": "Filee 已移除","installer.uninstall.done": "Filee 已从这台电脑上移除。",+ "installer.uninstall.restart": "部分正在使用的文件会在重启电脑后自动删除,无需手动删除。","installer.uninstall.settings_kept": "你的设置已保留,重新安装 Filee 时即可使用。","installer.uninstall.not_installed": "{0} 中没有安装 Filee。","installer.options.hide": "收起",diff --git a/src/Filee.App/Assets/i18n/zh-TW.json b/src/Filee.App/Assets/i18n/zh-TW.jsonindex 24c4110a..7dc954fc 100644--- a/src/Filee.App/Assets/i18n/zh-TW.json+++ b/src/Filee.App/Assets/i18n/zh-TW.json@@ -1128,6 +1128,7 @@"installer.uninstall.progress": "正在移除 Filee","installer.uninstall.done_title": "Filee 已移除","installer.uninstall.done": "Filee 已從這台電腦上移除。",+ "installer.uninstall.restart": "部分正在使用的檔案會在重新啟動電腦後自動刪除,無需手動刪除。","installer.uninstall.settings_kept": "你的設定已保留,重新安裝 Filee 時即可使用。","installer.uninstall.not_installed": "{0} 中沒有安裝 Filee。","installer.options.hide": "收起",diff --git a/src/Filee.Setup/Installation/SetupContext.cs b/src/Filee.Setup/Installation/SetupContext.csindex 33c790e5..b03cf10e 100644--- a/src/Filee.Setup/Installation/SetupContext.cs+++ b/src/Filee.Setup/Installation/SetupContext.cs@@ -63,6 +63,10 @@ public sealed class SetupException(string textKey, string message, params string/// <param name="Error">Why it failed; null when it worked.</param>/// <param name="RolledBack">The install folder is as it was before (the previous Filee still works).</param>+/// <summary>How an uninstall went: <paramref name="Error"/> is null when it worked.</summary>+/// <param name="DeletedAtRestart">Files and folders still in use, which Windows deletes at the next restart.</param>+public sealed record UninstallResult(Exception? Error = null, int DeletedAtRestart = 0);+public sealed record InstallResult(LaunchRequest? Launch, IReadOnlyList<SetupWarning> Warnings, Exception? Error = null, bool RolledBack = false){public bool Succeeded => Error is null;diff --git a/src/Filee.Setup/Program.cs b/src/Filee.Setup/Program.csindex 8f7a5da0..218d2c5a 100644--- a/src/Filee.Setup/Program.cs+++ b/src/Filee.Setup/Program.cs@@ -241,7 +241,7 @@ internal static class Programint exitCode;if (options.Ui == SetupUi.VerySilent){- exitCode = runner.Uninstall(deleteSettings: false, new SyncProgress<SetupProgress>(_ => { })) is { } error+ exitCode = runner.Uninstall(deleteSettings: false, new SyncProgress<SetupProgress>(_ => { })).Error is { } error? Fail(error): ExitOk;}@@ -490,17 +490,17 @@ internal sealed class SetupRunner(SetupContext context, SetupPayload? payload, P/// <summary>Lets the uninstaller in the install folder end before its file is deleted.</summary>public Action? ReleaseFirstPhase { get; init; }- public Exception? Uninstall(bool deleteSettings, IProgress<SetupProgress> progress)+ public UninstallResult Uninstall(bool deleteSettings, IProgress<SetupProgress> progress){try{- new Uninstaller(context).Run(folder!, record!, deleteSettings, trash!, progress, ReleaseFirstPhase);- return null;+ var later = new Uninstaller(context).Run(folder!, record!, deleteSettings, trash!, progress, ReleaseFirstPhase);+ return new UninstallResult(DeletedAtRestart: later.Count);}catch (Exception ex) when (ex is not OutOfMemoryException){context.Log.Error($"Uninstall failed: {ex}");- return ex;+ return new UninstallResult(ex);}}}diff --git a/src/Filee.Setup/ViewModels/SetupViewModel.cs b/src/Filee.Setup/ViewModels/SetupViewModel.csindex f756319a..cea3f252 100644--- a/src/Filee.Setup/ViewModels/SetupViewModel.cs+++ b/src/Filee.Setup/ViewModels/SetupViewModel.cs@@ -28,8 +28,8 @@ public interface ISetupRunner{InstallResult Install(InstallChoices choices, IProgress<SetupProgress> progress);- /// <summary>Uninstalls; null when it worked, else the error.</summary>- Exception? Uninstall(bool deleteSettings, IProgress<SetupProgress> progress);+ /// <summary>Uninstalls; the result has the error when it failed.</summary>+ UninstallResult Uninstall(bool deleteSettings, IProgress<SetupProgress> progress);}/// <summary>A language in the picker.</summary>@@ -394,12 +394,15 @@ public sealed partial class SetupViewModel : ObservableObjectPage = SetupPage.Progress;Percent = 0;var progress = new SyncProgress<SetupProgress>(p => Dispatcher.UIThread.Post(() => ShowProgress(p)));- var error = await Task.Run(() => _runner.Uninstall(deleteSettings, progress));- if (error is null)+ var result = await Task.Run(() => _runner.Uninstall(deleteSettings, progress));+ if (result.Error is not { } error){ExitCode = 0;Percent = 100;+ // Files still in use (the Explorer menu, Filee in the tray) go at the next restart: nothing is left to delete+ // by hand (#519).UninstalledText = _texts["installer.uninstall.done"]+ + (result.DeletedAtRestart > 0 ? Environment.NewLine + Environment.NewLine + _texts["installer.uninstall.restart"] : "")+ (deleteSettings ? "" : Environment.NewLine + Environment.NewLine + _texts["installer.uninstall.settings_kept"]);Page = SetupPage.Uninstalled;}diff --git a/tests/Filee.Setup.Tests/SetupWindowTests.cs b/tests/Filee.Setup.Tests/SetupWindowTests.csindex 6bb6024a..42ff0a26 100644--- a/tests/Filee.Setup.Tests/SetupWindowTests.cs+++ b/tests/Filee.Setup.Tests/SetupWindowTests.cs@@ -39,6 +39,7 @@ public class SetupWindowTestspublic bool? DeletedSettings { get; private set; }public InstallResult Result { get; set; } = new(new LaunchRequest(@"C:\Program Files\Filee\Filee.exe", "--background"), []);public TaskCompletionSource? Hold { get; set; }+ public int DeletedAtRestart { get; set; }public InstallResult Install(InstallChoices choices, IProgress<SetupProgress> progress){@@ -48,10 +49,10 @@ public class SetupWindowTestsreturn Result;}- public Exception? Uninstall(bool deleteSettings, IProgress<SetupProgress> progress)+ public UninstallResult Uninstall(bool deleteSettings, IProgress<SetupProgress> progress){DeletedSettings = deleteSettings;- return null;+ return new UninstallResult(DeletedAtRestart: DeletedAtRestart);}}@@ -213,6 +214,20 @@ public class SetupWindowTests}}+ [AvaloniaFact]+ public async Task Uninstall_says_files_in_use_go_at_the_next_restart()+ {+ // Issue #519: files still in use are deleted at the next restart, and the message said nothing about them.+ var (model, texts, runner) = Model("en", uninstall: true);+ runner.DeletedAtRestart = 2;+ await model.UninstallAsync();+ Assert.Contains(texts["installer.uninstall.restart"], model.UninstalledText);++ var (plain, _, _) = Model("en", uninstall: true);+ await plain.UninstallAsync();+ Assert.DoesNotContain(texts["installer.uninstall.restart"], plain.UninstalledText);+ }+[AvaloniaFact]public void The_whats_new_slides_take_turns_while_installing(){