• HearthBuddy DONOTDELETE.bin


    namespace Hearthbuddy
    {
        // Token: 0x02000022 RID: 34
        public class App : System.Windows.Application

    // Hearthbuddy.App
    // Token: 0x0600012B RID: 299 RVA: 0x00086C08 File Offset: 0x00084E08
    protected override void OnStartup(StartupEventArgs e)
    {
        string text = "";
        try
        {
            this.method_1();
        }
        catch (Exception exception)
        {
            App.ilog_0.Error("An exception occurred", exception);
            try
            {
                this.method_2();
            }
            catch (Exception exception2)
            {
                App.ilog_0.Error("An exception occurred", exception2);
                Logger.OpenLogFile();
                Application.Current.Shutdown();
                return;
            }
        }
        try
        {
            App.ilog_0.Info("Now setting up JitProfiles...");
            string text2 = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "JitProfiles");
            if (!Directory.Exists(text2))
            {
                Directory.CreateDirectory(text2);
            }
            ProfileOptimization.SetProfileRoot(text2);
            ProfileOptimization.StartProfile("JitProfile.jpf");
            App.ilog_0.Info("JitProfiles successfully setup!");
        }
        catch (Exception exception3)
        {
            App.ilog_0.Error("An exception occurred", exception3);
        }
        base.Dispatcher.UnhandledException += this.method_4;
        AppDomain.CurrentDomain.UnhandledException += this.method_3;
        Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
        Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture;
        App.ilog_0.Info("Now beginning pre-start tasks.");
        try
        {
            App.ilog_0.Info("Now checking prerequisites...");
            this.method_0();
            App.ilog_0.Info("Prerequisite check complete!");
        }
        catch (Exception arg)
        {
            App.ilog_0.ErrorFormat("{0}", arg);
            Logger.OpenLogFile();
            base.Shutdown(1);
            return;
        }
        try
        {
            if (!File.Exists("DONOTDELETE.bin"))
            {
                App.ilog_0.Error("The file [DONOTDELETE.bin] does not exist. Please reinstall Hearthbuddy.");
                Logger.OpenLogFile();
                base.Shutdown(1);
                return;
            }
            if (!Class7.smethod_4(out text))
            {
                App.ilog_0.Error("GetImageFileName failed.");
                Logger.OpenLogFile();
                base.Shutdown(1);
                return;
            }
            if (new Uri(text).IsUnc)
            {
                App.ilog_0.Error("Hearthbuddy can no longer be ran from an UNC path. Please install Hearthbuddy to the current PC.");
                Logger.OpenLogFile();
                base.Shutdown(1);
                return;
            }
            File.ReadAllBytes(text);
            File.ReadAllBytes("DONOTDELETE.bin");
            App.smethod_0(text);
        }
        catch (Exception arg2)
        {
            App.ilog_0.ErrorFormat("{0}", arg2);
            Logger.OpenLogFile();
            base.Shutdown(1);
            return;
        }
        try
        {
            Class6 @class = new Class7().method_0("Hearthbuddy");
            switch (@class.Enum1_0)
            {
            case Enum1.Success:
                CodeCompiler.smethod_0(@class.String_0);
                break;
            case Enum1.Relaunch:
                if (CommandLine.Arguments.Exists("noautolaunch"))
                {
                    App.ilog_0.Info("Now exiting for manual relaunch.");
                    base.Shutdown(1);
                }
                else
                {
                    App.ilog_0.Info("Now relaunching.");
                    Process.Start(@class.String_1, string.Join(" ", Environment.GetCommandLineArgs().Skip(1).Select(new Func<string, string>(App.Class11.Instance9.method_1))));
                    base.Shutdown(1);
                }
                return;
            case Enum1.Error:
                App.ilog_0.ErrorFormat("An error was encountered: {0}", @class.String_2);
                Logger.OpenLogFile();
                base.Shutdown(1);
                return;
            }
        }
        catch (Exception arg3)
        {
            App.ilog_0.ErrorFormat("Could not rename ourself on startup: {0}", arg3);
            Logger.OpenLogFile();
            base.Shutdown(1);
            return;
        }
        try
        {
            if (!App.smethod_1(text))
            {
                App.ilog_0.ErrorFormat("An error occurred while trying to replace the process.", Array.Empty<object>());
                Logger.OpenLogFile();
                base.Shutdown(1);
                return;
            }
        }
        catch (Exception arg4)
        {
            App.ilog_0.ErrorFormat("Could not replace ourself on startup: {0}", arg4);
            Logger.OpenLogFile();
            base.Shutdown(1);
            return;
        }
        App.ilog_0.Info("Pre-start tasks successfully completed.");
        base.OnStartup(e);
    }
  • 相关阅读:
    前导零的操作
    反射已有的对象
    下面给出一个$.ajax()方法实现异步请求的例子
    JQuery 异步请求
    用户控件生成代码
    MasterPage(母板页)的不一般用法
    ajax异步请求的ashx页面
    最简单的服务端
    JavaScript 数字的千分位 和去除 小数部分
    数据库表的复制
  • 原文地址:https://www.cnblogs.com/chucklu/p/11300703.html
Copyright © 2020-2023  润新知