Skip to content

Commit

Permalink
fixed igcmd set/remove-default-viewer cmd does not follow show ui param
Browse files Browse the repository at this point in the history
  • Loading branch information
d2phap committed Feb 1, 2024
1 parent 5c9b42c commit 24f4237
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
16 changes: 7 additions & 9 deletions Source/igcmd/Functions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,7 @@ public static IgExitCode SetDesktopWallpaper(string imgPath, string styleStr)
/// </summary>
/// <param name="enable"></param>
/// <param name="exts">Extensions to proceed. Example: <c>.png;.jpg;</c></param>
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"
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions Source/igcmd/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down

0 comments on commit 24f4237

Please sign in to comment.