Пример #1
0
    public MainForm(ProgramArguments args) : this()
    {
      try
      {
        if (File.Exists(args.PackageFile))
        {
          ApplicationSettings.Instance.DoUpdateInStartUp = false;
          InstallFile(args.PackageFile, args.Silent, false);
        }
        else if (args.Update)
        {
          ApplicationSettings.Instance.DoUpdateInStartUp = false;
          RefreshListControls();
          DoUpdateAll(false);
        }
        else if (args.MpQueue)
        {
          ApplicationSettings.Instance.DoUpdateInStartUp = false;
          if (args.Splash)
          {
            splashScreen.SetImg(args.BackGround);
            splashScreen.Show();
            splashScreen.Update();
          }
          ExecuteMpQueue();
          if (splashScreen.Visible)
            splashScreen.Close();
        }
        else if (args.UninstallPackage)
        {
          if (string.IsNullOrEmpty(args.PackageID)) return;
          PackageClass pc = MpeCore.MpeInstaller.InstalledExtensions.Get(args.PackageID);
          if (pc == null) return;

          UnInstall dlg = new UnInstall();
          dlg.Execute(pc, args.Silent);
        }
      }
      catch (Exception ex)
      {
        MessageBox.Show(ex.ToString());
      }
      finally
      {
        this.Close();
      }
    }