Exemplo n.º 1
0
        private void applyButton_Click(object sender, RoutedEventArgs e)
        {
            if (Common.ModSelectedfiles.Count == 0)
            {
                MessageBox.Show("请选择MOD");
                return;
            }

            Cmd cmd = new Cmd();

            foreach (var path in Common.ModSelectedfiles)
            {
                FastZip fz = new FastZip();
                fz.ExtractZip(path.Key, AppDomain.CurrentDomain.BaseDirectory + "~temp", "");
            }
            File.Delete(AppDomain.CurrentDomain.BaseDirectory + "~temp\\config.json");
            DirectoryInfo di   = new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory + "~temp");
            var           dics = di.GetDirectories();

            foreach (var item in dics)
            {
                cmd.RunProgram(Common.RQToolPath, "master\\" + item.Name + ".dat -r");
            }
            BackupFiles();

            CopyDirectory(AppDomain.CurrentDomain.BaseDirectory + "~temp", Common.MasterDicPath);
            Directory.Delete(AppDomain.CurrentDomain.BaseDirectory + "~temp", true);
            foreach (var item in dics)
            {
                cmd.RunProgram(Common.RQToolPath, "master\\" + item.Name + ".inf -r");
                Directory.Delete(Common.MasterDicPath + item.Name, true);
                File.Delete(Common.MasterDicPath + item.Name + ".inf");
            }
            MessageBox.Show("MOD成功");
        }
Exemplo n.º 2
0
        private void clearbutton_Click(object sender, RoutedEventArgs e)
        {
            Cmd           cmd  = new Cmd();
            DirectoryInfo di   = new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory + "backups");
            var           dics = di.GetDirectories();

            foreach (var item in dics)
            {
                cmd.RunProgram(Common.RQToolPath, "master\\" + item.Name + ".dat -r");
            }


            CopyDirectory(AppDomain.CurrentDomain.BaseDirectory + "backups", Common.MasterDicPath);
            foreach (var item in dics)
            {
                cmd.RunProgram(Common.RQToolPath, "master\\" + item.Name + ".inf -r");
                Directory.Delete(Common.MasterDicPath + item.Name, true);
                File.Delete(Common.MasterDicPath + item.Name + ".inf");
            }
            MessageBox.Show("还原成功");
        }
Exemplo n.º 3
0
        private void applyButton_Click(object sender, RoutedEventArgs e)
        {
            if (Common.ModSelectedfiles.Count==0)
            {
                MessageBox.Show("请选择MOD");
                return;
            }

            Cmd cmd = new Cmd();

            foreach (var path in Common.ModSelectedfiles)
            {
                FastZip fz = new FastZip();
                fz.ExtractZip(path.Key, AppDomain.CurrentDomain.BaseDirectory + "~temp","");
            }
            File.Delete(AppDomain.CurrentDomain.BaseDirectory + "~temp\\config.json");
            DirectoryInfo di = new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory + "~temp");
            var dics=di.GetDirectories();

            foreach(var item in dics)
            {
                cmd.RunProgram(Common.RQToolPath, "master\\"+item.Name + ".dat -r");
            }
            BackupFiles();

            CopyDirectory(AppDomain.CurrentDomain.BaseDirectory + "~temp",Common.MasterDicPath);
            Directory.Delete(AppDomain.CurrentDomain.BaseDirectory + "~temp",true);
            foreach (var item in dics)
            {
                cmd.RunProgram(Common.RQToolPath, "master\\" + item.Name + ".inf -r");
                Directory.Delete(Common.MasterDicPath + item.Name, true);
                File.Delete(Common.MasterDicPath + item.Name + ".inf");
            }
            MessageBox.Show("MOD成功");
        }
Exemplo n.º 4
0
        private void clearbutton_Click(object sender, RoutedEventArgs e)
        {
            Cmd cmd = new Cmd();
            DirectoryInfo di = new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory + "backups");
            var dics = di.GetDirectories();

            foreach (var item in dics)
            {
                cmd.RunProgram(Common.RQToolPath, "master\\" + item.Name + ".dat -r");
            }

            CopyDirectory(AppDomain.CurrentDomain.BaseDirectory + "backups", Common.MasterDicPath);
            foreach (var item in dics)
            {
                cmd.RunProgram(Common.RQToolPath, "master\\" + item.Name + ".inf -r");
                Directory.Delete(Common.MasterDicPath + item.Name, true);
                File.Delete(Common.MasterDicPath + item.Name + ".inf");
            }
            MessageBox.Show("还原成功");
        }