1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- using Microsoft.Win32;
- using System;
- using System.Diagnostics;
- using System.IO;
- using System.Threading;
- using System.Windows.Forms;
- namespace Start
- {
- static class Program
- {
- /// <summary>
- /// 应用程序的主入口点。
- /// </summary>
- [STAThread]
- static void Main()
- {
- renamefiles();
- }
- private static void renamefiles()
- {
- try
- {
- //const string subkey = @"SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\";
- ////判断是否安装.net framework4.5.2
- //using (var ndpKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32).OpenSubKey(subkey))
- //{
- // if (ndpKey != null && (int)ndpKey.GetValue("Release") >= 379893)
- // {
- // }
- // else
- // {
- // MessageBox.Show("即将开始安装.Net运行环境,请在安装完成后重新启动游戏程序.");
- // Process.Start(".\\NDP452-KB2901907-x86-x64-AllOS-ENU.exe");
- // Environment.Exit(1);
- // }
- //}
- if (File.Exists(".\\updates_rename.log"))
- {
- Thread.Sleep(500);
- string[] files = File.ReadAllLines(".\\updates_rename.log");
- foreach (string file in files)
- {
- if (File.Exists(file + ".bak"))
- {
- if (File.Exists(file)) File.Delete(file);
- File.Move(file + ".bak", file);
- }
- }
- File.Delete("updates_rename.log");
- };
- Thread.Sleep(200);
- try
- {
- Process.Start(".\\Mir3AU.exe");
- }
- catch
- {
- File.Copy(".\\Mir3AU.exe", ".\\Mir3AU2.exe", true);
- Thread.Sleep(200);
- Process.Start(".\\Mir3AU2.exe");
- }
- // System.Environment.Exit(0);
- }
- catch { }
- }
- }
- }
|