mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-30 01:07:21 +13:00
-Uninstall argument for Steam
This commit is contained in:
parent
355af54cb3
commit
4f5b65a9ee
2 changed files with 29 additions and 0 deletions
|
@ -98,5 +98,12 @@ public static void SteamShowInApp(bool inapp)
|
|||
MessageBox.Show(Resources.ApplicationSettingsForm_cbSteamShowInApp_CheckedChanged_For_settings_to_take_effect_ShareX_needs_to_be_reopened_from_Steam_,
|
||||
"ShareX", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
|
||||
public static void Uninstall()
|
||||
{
|
||||
CreateStartupShortcut(false);
|
||||
CreateShellContextMenuButton(false);
|
||||
CreateSendToMenuButton(false);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -253,6 +253,10 @@ private static void Main(string[] args)
|
|||
CLI = new CLIManager(args);
|
||||
CLI.ParseCommands();
|
||||
|
||||
#if STEAM
|
||||
if (CheckUninstall()) return; // Steam will run ShareX with -Uninstall when uninstalling
|
||||
#endif
|
||||
|
||||
if (CheckAdminTasks()) return; // If ShareX opened just for be able to execute task as Admin
|
||||
|
||||
IsMultiInstance = CLI.IsCommandExist("multi", "m");
|
||||
|
@ -571,5 +575,23 @@ private static bool CheckAdminTasks()
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static bool CheckUninstall()
|
||||
{
|
||||
if (CLI.IsCommandExist("Uninstall"))
|
||||
{
|
||||
try
|
||||
{
|
||||
IntegrationHelpers.Uninstall();
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue