internal static void DeleteDirectory(string directory)
        {
            if (!Directory.Exists(directory))
            {
                return;
            }

            // Check for and uninstall services installed in directory
            ApplicationInteraction.StopAndDeleteServicesInDirectory(directory);

            // Try and kill processes we know about in the dir
            ApplicationInteraction.StopProcessesInDirectory(directory);

            Logging.Log("Deleting from {0}", directory);
            PerformDelete(new DirectoryInfo(directory));

            Logging.Log("Ensure Directory {0} has been deleted", directory);
            Retry.Do(() =>
            {
                if (Directory.Exists(directory))
                {
                    throw new Exception("Directory still exists");
                }
            }, TimeSpan.FromMilliseconds(1000));
        }
Example #2
0
        internal static void DeleteDirectory(string directory)
        {
            if (!Directory.Exists(directory))
            {
                return;
            }

            // Check for and uninstall services installed in directory
            ApplicationInteraction.StopAndDeleteServicesInDirectory(directory);

            // Try and kill processes we know about in the dir
            ApplicationInteraction.StopProcessesInDirectory(directory);

            Logging.Log("Deleting from {0}", directory);
            PerformDelete(new DirectoryInfo(directory));
        }