예제 #1
0
        /// <summary>
        /// The start the process.
        /// </summary>
        /// <param name="ExecutableName">
        /// The executable name.
        /// </param>
        /// <param name="arguements">
        /// The arguements.
        /// </param>
        private void StartTheProcess(string ExecutableName, string arguements)
        {
            if (File.Exists(@".\devraw\video\startup.bik") == false)
            {
                if (Directory.Exists(@".\devraw\video") == false)
                {
                    Directory.CreateDirectory(@".\devraw\video");
                }

                // Here we extract it
                string strPath = @".\devraw\video\startup.bik";
                if (File.Exists(strPath))
                {
                    File.Delete(strPath);
                }

                Assembly   assembly = Assembly.GetExecutingAssembly();
                Stream     input    = assembly.GetManifestResourceStream("TeknoMW3.tekntup.bik");
                FileStream output   = File.Open(strPath, FileMode.CreateNew);
                this.CopyStream(input, output);
                input.Dispose();
                output.Dispose();
            }

            // var parser = new IniParser("teknogods.ini");
            // string name = parser.GetSetting("Settings", "Name");
            // string steamid = parser.GetSetting("Settings", "ID");
            // string fov = parser.GetSetting("Settings", "FOV");

            // string ini = "[Settings]" + Environment.NewLine;

            // if (string.IsNullOrWhiteSpace(name))
            // {
            // MessageBox.Show("teknogods.ini is malformed!", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            // return;
            // }

            // ini += "Name=" + name + Environment.NewLine;

            // if (string.IsNullOrWhiteSpace(steamid) == false && steamid.Length == 8)
            // {
            // ini += "ID=" + steamid + Environment.NewLine;
            // }

            // try
            // {
            // int fovi = Convert.ToInt32(fov);

            // if (fovi > 80 || fovi < 65)
            // {
            // fovi = 65;
            // }

            // fov = fovi.ToString();
            // }
            // catch (Exception)
            // {
            // fov = "65";
            // }

            // ini += "FOV=" + fov + Environment.NewLine;

            // File.WriteAllText("teknogods.ini", ini);
            var runProc = new RunProc {
                ExecutableName = ExecutableName, Commandargs = arguements
            };

            runProc.ShowDialog();
        }
예제 #2
0
        /// <summary>
        /// The start the process.
        /// </summary>
        /// <param name="ExecutableName">
        /// The executable name. 
        /// </param>
        /// <param name="arguements">
        /// The arguements. 
        /// </param>
        private void StartTheProcess(string ExecutableName, string arguements)
        {
            if (File.Exists(@".\devraw\video\startup.bik") == false)
            {
                if (Directory.Exists(@".\devraw\video") == false)
                {
                    Directory.CreateDirectory(@".\devraw\video");
                }

                // Here we extract it
                string strPath = @".\devraw\video\startup.bik";
                if (File.Exists(strPath))
                {
                    File.Delete(strPath);
                }

                Assembly assembly = Assembly.GetExecutingAssembly();
                Stream input = assembly.GetManifestResourceStream("TeknoMW3.tekntup.bik");
                FileStream output = File.Open(strPath, FileMode.CreateNew);
                this.CopyStream(input, output);
                input.Dispose();
                output.Dispose();
            }

            // var parser = new IniParser("teknogods.ini");
            // string name = parser.GetSetting("Settings", "Name");
            // string steamid = parser.GetSetting("Settings", "ID");
            // string fov = parser.GetSetting("Settings", "FOV");

            // string ini = "[Settings]" + Environment.NewLine;

            // if (string.IsNullOrWhiteSpace(name))
            // {
            // MessageBox.Show("teknogods.ini is malformed!", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            // return;
            // }

            // ini += "Name=" + name + Environment.NewLine;

            // if (string.IsNullOrWhiteSpace(steamid) == false && steamid.Length == 8)
            // {
            // ini += "ID=" + steamid + Environment.NewLine;
            // }

            // try
            // {
            // int fovi = Convert.ToInt32(fov);

            // if (fovi > 80 || fovi < 65)
            // {
            // fovi = 65;
            // }

            // fov = fovi.ToString();
            // }
            // catch (Exception)
            // {
            // fov = "65";
            // }

            // ini += "FOV=" + fov + Environment.NewLine;

            // File.WriteAllText("teknogods.ini", ini);
            var runProc = new RunProc { ExecutableName = ExecutableName, Commandargs = arguements };
            runProc.ShowDialog();
        }
예제 #3
0
        /// <summary>
        /// The start the process.
        /// </summary>
        /// <param name="ExecutableName">
        /// The executable name. 
        /// </param>
        /// <param name="arguements">
        /// The arguements. 
        /// </param>
        private void StartTheProcess(string ExecutableName, string arguements)
        {
            // var parser = new IniParser("teknogods.ini");
            // string name = parser.GetSetting("Settings", "Name");
            // string steamid = parser.GetSetting("Settings", "ID");
            // string fov = parser.GetSetting("Settings", "FOV");

            // string ini = "[Settings]" + Environment.NewLine;

            // if (string.IsNullOrWhiteSpace(name))
            // {
            // MessageBox.Show("teknogods.ini is malformed!", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            // return;
            // }

            // ini += "Name=" + name + Environment.NewLine;

            // if (string.IsNullOrWhiteSpace(steamid) == false && steamid.Length == 8)
            // {
            // ini += "ID=" + steamid + Environment.NewLine;
            // }

            // try
            // {
            // int fovi = Convert.ToInt32(fov);

            // if (fovi > 80 || fovi < 65)
            // {
            // fovi = 65;
            // }

            // fov = fovi.ToString();
            // }
            // catch (Exception)
            // {
            // fov = "65";
            // }

            // ini += "FOV=" + fov + Environment.NewLine;

            // File.WriteAllText("teknogods.ini", ini);
            var runProc = new RunProc { ExecutableName = ExecutableName, Commandargs = arguements };
            runProc.ShowDialog();
        }