Exemplo n.º 1
0
        public static int Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.DoEvents();

            if (Array.IndexOf(args, "ADMINISTRATION") == 0)
            {
                OpenFileDialog dlg = new OpenFileDialog();
                dlg.FileName        = "updates.xml";
                dlg.Filter          = "Update files (*.xml)|*.xml|All files (*.*)|*.*";
                dlg.CheckFileExists = false;
                dlg.CheckPathExists = true;
                if (dlg.ShowDialog() != DialogResult.OK)
                {
                    return(0);
                }

                UpdateAdministration dlg2 = new UpdateAdministration();
                dlg2.UpdateFile = dlg.FileName;
                Application.Run(dlg2);
                return(0);
            }

            FreshKeeper keeper = new FreshKeeper();

            keeper.Updateavailable += new FreshKeeper.UpdateavailableEvent(Updateavailable);
            keeper.UpdateError     += new FreshKeeper.UpdateErrorEvent(ErrorOccured);
            keeper.CheckForUpdates(true);

            return(0);
        }
Exemplo n.º 2
0
        public static int Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.DoEvents();

            if (Array.IndexOf(args, "ADMINISTRATION") == 0)
            {
                OpenFileDialog dlg = new OpenFileDialog();
                dlg.FileName = "updates.xml";
                dlg.Filter = "Update files (*.xml)|*.xml|All files (*.*)|*.*";
                dlg.CheckFileExists = false;
                dlg.CheckPathExists = true;
                if (dlg.ShowDialog() != DialogResult.OK)
                    return 0;

                UpdateAdministration dlg2 = new UpdateAdministration();
                dlg2.UpdateFile = dlg.FileName;
                Application.Run(dlg2);
                return 0;
            }

            FreshKeeper keeper = new FreshKeeper();
            keeper.Updateavailable += new FreshKeeper.UpdateavailableEvent(Updateavailable);
            keeper.UpdateError += new FreshKeeper.UpdateErrorEvent(ErrorOccured);
            keeper.CheckForUpdates(true);

            return 0;
        }