Exemplo n.º 1
0
Arquivo: Program.cs Projeto: Penta/GFE
        static private void DemarrageNormal()
        {
            VerifierInstance();

            Registre.Initialisation();

            if (Registre.miseAJour)
            {
                Maj.FinalisationMaj();
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Selection());
        }
Exemplo n.º 2
0
 private void MenuMettreAJour_Clic(object sender, EventArgs e)
 {
     Maj.VerifierMaj();
     ChargerFond(false);
 }
Exemplo n.º 3
0
Arquivo: Program.cs Projeto: Penta/GFE
        static void Main(string[] args)
        {
            ObtenirLangue();

            string var = "", chemin = "";
            bool   erreur = false;

            CompatibilitéOS();

            if (args.Length > 0) // Si des arguments ont été fournis
            {
                var = args[0];

                if (var == "/?" || var == "/H")
                {
                    AfficherAide();
                }
                else if (var == "/U")
                {
                    if (args.Length == 2)
                    {
                        chemin = args[1];
                    }
                    else
                    {
                        chemin = "";
                    }

                    Maj.InstallerMaj(chemin);
                }
                else if (var == "/S")
                {
                    WebClient web = new WebClient();

                    try
                    {
                        web.DownloadFile("https://github.com/Penta/GFE/archive/" + Principale.VERSION + ".zip", Environment.CurrentDirectory + @"\source.zip");
                        MessageBox.Show(Texte.TéléchargementSources, Texte.SuccèsTitre, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    catch { MessageBox.Show(Texte.ErreurTéléchargementSources, Texte.ErreurTitre, MessageBoxButtons.OK, MessageBoxIcon.Error); }

                    web.Dispose();
                }
                else if (var == "/O")
                {
                    if (args.Length == 2)
                    {
                        chemin = @args[1];

                        foreach (string verif in chemin.Split('|'))
                        {
                            if (!Directory.Exists(verif.Trim()))
                            {
                                erreur = true;
                            }
                        }

                        if (!erreur)
                        {
                            VerifierInstance();
                            Registre.Initialisation();

                            Application.EnableVisualStyles();
                            Application.SetCompatibleTextRenderingDefault(false);
                            Application.Run(new Principale(chemin));
                        }
                        else
                        {
                            MessageBox.Show(Texte.MauvaisCheminParamètre, Texte.ErreurTitre, MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }
                    else
                    {
                        MessageBox.Show(Texte.AucunCheminParamètre, Texte.ErreurTitre, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else if (var == "/R")
                {
                    ResetLogiciel();
                }
                else
                {
                    MessageBox.Show(Texte.ArgumentInvalide, Texte.ErreurTitre, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            else
            {
                DemarrageNormal();
            }
        }