chr
7 天以前 43a0207d207390abdeeb3ab9155eebf03edd7b1a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using AutoUpdater.Util;
using log4net;
using PdmSwPlugin.Common.Setting;
using System;
using System.IO;
using System.Reflection;
using System.Windows;
 
namespace AutoUpdater
{
    /// <summary>
    /// App.xaml 的交互逻辑
    /// </summary>
    public partial class App : Application
    {
        private static ILog Logger = LogManager.GetLogger("AutoUpdater");
        /// <summary>
        /// Application Entry Point.
        /// </summary>
        [System.STAThreadAttribute()]
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
        public static void Main()
        {
            string currentFolder = new DirectoryInfo(Assembly.GetExecutingAssembly().Location).Parent.Parent.FullName;
            string appConfigFullPath = Path.Combine(currentFolder, "Settings","PluginSetting.xml");
            PluginSetting.RefreshFromXml(appConfigFullPath);
 
            // 切换配置文件后,再初始化HttpUtil
            HttpUtil.Init();
 
            try
            {
                AutoUpdater.App app = new AutoUpdater.App();
                app.InitializeComponent();
                app.Run();
            }
            catch (Exception ex)
            {
                Logger.Error("AutoUpdater execute failed.", ex);
                MessageBox.Show(ex.Message, "错误", MessageBoxButton.OK, MessageBoxImage.Error);
                Environment.Exit(1);
            }
        }
    }
}