using AutoUpdater.Util; using log4net; using PdmSwPlugin.Common.Setting; using System; using System.IO; using System.Reflection; using System.Windows; namespace AutoUpdater { /// /// App.xaml 的交互逻辑 /// public partial class App : Application { private static ILog Logger = LogManager.GetLogger("AutoUpdater"); /// /// Application Entry Point. /// [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); } } } }