BF2Statistics.StatsPython.BackupAndInstall C# (CSharp) Method

BackupAndInstall() public static method

Backsup the current python files, and installs the ranked enabled ones
public static BackupAndInstall ( ) : void
return void
        public static void BackupAndInstall()
        {
            if (Installed)
                return;

            // Make sure we arent Ambiguous. If the backup folder exists, just leave it!!!
            // If we have both backup folders, start fresh install
            if (Directory.Exists(BackupPath) && Directory.Exists(StatsBackupPath))
            {
                Directory.Delete(StatsBackupPath, true);
                Directory.Delete(BF2Server.PythonPath, true);
            }
            else
            {
                // move the current "normal" files over to the backup path
                Directory.Move(BF2Server.PythonPath, BackupPath);
            }

            // Make sure we dont have an empty backup folder
            if(!Directory.Exists(StatsBackupPath))
                DirectoryExt.Copy(Paths.RankedPythonPath, BF2Server.PythonPath, true);
            else
                Directory.Move(StatsBackupPath, BF2Server.PythonPath);

            // Sleep
            System.Threading.Thread.Sleep(500);
        }