From 24f42373ef326599ce40567f396022f55fc14eab Mon Sep 17 00:00:00 2001 From: Phap Dieu Duong Date: Thu, 1 Feb 2024 21:22:14 +0800 Subject: [PATCH] fixed igcmd set/remove-default-viewer cmd does not follow show ui param #1835 --- Source/igcmd/Functions.cs | 16 +++++++--------- Source/igcmd/Program.cs | 4 ++-- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/Source/igcmd/Functions.cs b/Source/igcmd/Functions.cs index b7fe04351..47e5eb002 100644 --- a/Source/igcmd/Functions.cs +++ b/Source/igcmd/Functions.cs @@ -68,12 +68,7 @@ public static IgExitCode SetDesktopWallpaper(string imgPath, string styleStr) /// /// /// Extensions to proceed. Example: .png;.jpg; - public static IgExitCode SetAppExtensions( - bool enable, - string exts = "", - bool perMachine = false, - bool showUi = false, - bool hideAdminRequiredErrorUi = false) + public static IgExitCode SetAppExtensions(bool enable, string exts = "", bool perMachine = false) { var langPath = enable ? "FrmMain.MnuSetDefaultPhotoViewer" @@ -91,9 +86,12 @@ public static IgExitCode SetAppExtensions( : ExplorerApi.UnregisterAppAndExtensions(exts, perMachine); if (error != null) throw error; - _ = Config.ShowInfo(null, - title: Config.Language[langPath], - heading: Config.Language[$"{langPath}._Success"]); + if (Program.ShowUi) + { + _ = Config.ShowInfo(null, + title: Config.Language[langPath], + heading: Config.Language[$"{langPath}._Success"]); + } }, (error) => { _ = Config.ShowError(null, diff --git a/Source/igcmd/Program.cs b/Source/igcmd/Program.cs index efe6d92e5..49a09667a 100644 --- a/Source/igcmd/Program.cs +++ b/Source/igcmd/Program.cs @@ -131,7 +131,7 @@ private static int Main(string[] args) exts = CmdArgs[1]; } - return (int)Functions.SetAppExtensions(true, exts, PerMachine, ShowUi, HideAdminRequiredErrorUi); + return (int)Functions.SetAppExtensions(true, exts, PerMachine); } #endregion @@ -145,7 +145,7 @@ private static int Main(string[] args) exts = CmdArgs[1]; } - return (int)Functions.SetAppExtensions(false, exts, PerMachine, ShowUi, HideAdminRequiredErrorUi); + return (int)Functions.SetAppExtensions(false, exts, PerMachine); } #endregion