コード例 #1
0
        static void CheckUpdateUI(string download_url, string net_version)
        {
            //まずアップデートした日付を記録する
            OverradeLastUpdateTime();

            //確認ダイアログの表示
            ToolUpdateDialogForm f = (ToolUpdateDialogForm)InputFormRef.JumpFormLow <ToolUpdateDialogForm>();

            f.Init(net_version, download_url);
            f.ShowDialog();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: Fesatural/FEBuilderGBA
        static void Main(string[] args)
        {
            //オプション引数 --mode=foo とかを、dic["--mode"]="foo" みたいに変換します.
            ArgsDic = U.OptionMap(args, "--rom");
            //メインスレッド判定に利用するためにスレッドIDを保存
            MainThreadID = System.Threading.Thread.CurrentThread.ManagedThreadId;
#if !DEBUG
            SetExceptionHandler();
#endif
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //自プロセスのパスから、ベースディレクトリを特定します.
            Program.BaseDirectory = MakeBaseDirectory();

//            if (!CheckConfigDirectory() || !Check7ZipDLL())
//            {//解凍に失敗しているので終了させる.
//                return;
//            }
            Log.TouchLogDirectory();

            //設定の読み込み
            Config = new Config();
            Config.Load(System.IO.Path.Combine(BaseDirectory, "config", "config.xml"));
            Config.UpdateShortcutKeys();

            //システム側のテキストエンコード いかにしてUnicodeにするかどうか.
            ReBuildSystemTextEncoder();

            //多言語切り替え
            ReLoadTranslateResource();

            //アップデートに失敗して、アップデーターの残骸があれば利用する
            if (ToolUpdateDialogForm.CheckUpdateGarbage())
            {
                return;
            }

            //外部プロセスからの書き換え監視等の開始
            UpdateWatcher = new ROMUpdateWatcher();

            string forceversion = U.at(ArgsDic, "--force-version");//強制バージョン指定 --force-version=FE8J
            if (ArgsDic.ContainsKey("--lastrom"))
            {
                MainFormUtil.Open(null, Program.GetLastROMFilename(), false, forceversion);
            }
            if (ArgsDic.ContainsKey("--rom"))
            {
                MainFormUtil.Open(null, ArgsDic["--rom"], false, forceversion);
            }

            {
                //自動アップデートがやりたいので、初期化だけはやろうか...
                WelcomeForm f = (WelcomeForm)InputFormRef.JumpFormLow <WelcomeForm>();
                if (Program.ROM == null)
                {//ROMが読み込めない場合、welcomeダイアログを出す.
                    WelcomeForm.CheckInitWizard();

                    f.ShowDialog();
                    if (Program.ROM == null)
                    {//それでもROMが読み込めない場合、終了.
                        return;
                    }
                }
            }

            //コマンドラインの処理があれば。
            if (ProcCommandLine())
            {//コマンドラインを実行できたので、即終了
                return;
            }

            //メインフォームを開く.
            do
            {
                Program.DoReOpen = false;
                Form f = MainForm();
                MainFormUtil.SetMainFormIcon(f);
                Application.Run(f);
            }while (Program.DoReOpen); //メインフォームを作り直すためループにする.

            //キャッシュスレッドが動いていたら止める
            if (AsmMapFileAsmCache != null)
            {
                AsmMapFileAsmCache.Join();
            }
            //ログの書き込み
            Log.SyncLog();
        }