コード例 #1
0
 void NameFormLoad(object sender, EventArgs e)
 {
     if (!File.Exists(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\PlayerConfig.txt"))
     {
         SecurityFuncs.GeneratePlayerID();
         SecurityFuncs.WriteConfigValues();
         SecurityFuncs.ReadConfigValues();
     }
     else
     {
         SecurityFuncs.ReadConfigValues();
     }
     textBox1.Text = GlobalVars.Name;
 }
コード例 #2
0
        void MainFormLoad(object sender, EventArgs e)
        {
            string EXEName = System.AppDomain.CurrentDomain.FriendlyName;

            if (EXEName.Equals("Origins06_Installer.exe"))
            {
                try
                {
                    label1.Text = "Installing URI...";
                    string loadstring = Environment.CurrentDirectory + Path.DirectorySeparatorChar + "Origins06_Launcher.exe";
                    RegisterURLProtocol("Origins06", loadstring, "Origins06 Client");
                    progressBar1.Style = ProgressBarStyle.Blocks;
                    for (int i = 0; i < 100; i += 10)
                    {
                        progressBar1.Value += 10;
                    }
                    label1.Text = "Installation Complete!";
                    label2.Text = "You can now play games. You may now close this window.";
                }
                catch (Exception)
                {
                    label1.Text = "Installation Failed.";
                    label2.Text = "Did you launch the launcher as administrator?";
                }
            }
            else
            {
                if (!File.Exists(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\PlayerConfig.txt"))
                {
                    NameForm name = new NameForm();
                    name.ShowDialog();
                    System.Threading.Timer timer = new System.Threading.Timer(new TimerCallback(CheckIfFinished), null, 1, 0);
                }
                else
                {
                    SecurityFuncs.ReadConfigValues();
                    GlobalVars.ReadyToLaunch = true;
                    System.Threading.Timer timer = new System.Threading.Timer(new TimerCallback(CheckIfFinished), null, 1, 0);
                }
            }
        }