示例#1
0
        static void Main(string[] args)
        {
            Logger.Debug("Updater proc ...");

            try
            {
                if (args == null && args.Length != 1)
                    throw new ArgumentException("Входная папка не задана");

                _mgr = new FileManager(args[0]);
                _package = _mgr.LoadPackageDesc().ToXmlReader().Deserialize<PackageConfig>();

                if (_mgr.InstalledVersion == _mgr.DownloadedVersion)
                {
                    Logger.Debug("Service already updated!");
                    return;
                }

                StartAndWaitAction("OnBeforeUpdateAction", _package.OnBeforeUpdateAction);

                TryUpdate();

                StartAndWaitAction("OnSuccessUpdateAction", _package.OnSuccessUpdateAction);
            }
            catch (Exception ex)
            {
                Logger.Error("Updater proc: " + ex);
                StartAndWaitAction("OnErrorUpdateAction", _package.OnErrorUpdateAction);
            }

            Logger.Debug("Updater proc: end");
        }
示例#2
0
        private void InitConfig()
        {
            ProcessConfig = Cfg.Xml.ToXmlReader().Deserialize<AutoUpdaterProcessConfig>();

            _fileManager = new FileManager(ProcessConfig.WorkFolder);
        }