Manager_WPF.PluginInstallerHelper.UninstallPlugin C# (CSharp) Method

UninstallPlugin() public method

Unistalls a plugin
public UninstallPlugin ( PluginDescription desc ) : bool
desc PluginDescription The information about the plugin to be deleted
return bool
        public bool UninstallPlugin(PluginDescription desc)
        {
            bool returnValue = false;

            string ip = "localhost";

            if (ip == "localhost") ip = Common.LocalIPAddress();

            NetworkComms.SendObject("Plugin", ip, 10051, desc.Type + "|False");

            Thread.Sleep(2000);

            string exePath = Path.GetDirectoryName(Application.ExecutablePath);
            string pluginFolder = exePath + "/Plugins/" + desc.Path;
            if (Directory.Exists(pluginFolder))
            {
                if (deleteFolder(pluginFolder))
                    returnValue = true;
                else
                    returnValue = false;

                if (Directory.Exists(pluginFolder)) returnValue = false;
            }
            else
                returnValue = true;
            return returnValue;
        }