Advertisement
Guest User

Form1.cs

a guest
May 9th, 2014
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 4.84 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Diagnostics;
  7. using System.IO;
  8. using System.Linq;
  9. using System.Reflection;
  10. using System.Text;
  11. using System.Threading.Tasks;
  12. using System.Windows.Forms;
  13.  
  14. namespace HL2_Cinematic_Mod_Launcher
  15. {
  16.     public partial class Form1 : Form
  17.     {
  18.         public Form1()
  19.         {
  20.             InitializeComponent();
  21.         }
  22.  
  23.         public void Form1_Load(object sender, EventArgs e)
  24.         {
  25.         }
  26.  
  27.         void InitializeComponents()
  28.         {
  29.             this.button1 = (new System.Windows.Forms.Button());
  30.             this.button2 = (new System.Windows.Forms.Button());
  31.             this.button3 = (new System.Windows.Forms.Button());
  32.             this.button4 = (new System.Windows.Forms.Button());
  33.             this.SuspendLayout();
  34.             ///
  35.             /// FORM
  36.             ///
  37.             this.Controls.Add(this.button1);
  38.             this.Controls.Add(this.button2);
  39.             this.Controls.Add(this.button3);
  40.             this.Controls.Add(this.button4);
  41.             this.Name = "Form1";
  42.             this.Text = "Launcher";
  43.             this.Load += new System.EventHandler(Form1_Load);
  44.             this.ResumeLayout(false);
  45.             this.PerformLayout();
  46.             ///
  47.             /// BUTTON 1
  48.             ///
  49.             this.button1.Text = "Configurator";
  50.             this.button1.UseVisualStyleBackColor = false;
  51.             this.button1.Click += new System.EventHandler(button1_Click);
  52.             ///
  53.             /// BUTTON 2
  54.             ///
  55.             this.button2.Text = "Half-Life 2";
  56.             this.button2.UseVisualStyleBackColor = false;
  57.             this.button2.Click += new System.EventHandler(button2_Click);
  58.             ///
  59.             /// BUTTON 3
  60.             ///
  61.             this.button3.Text = "Half-Life 2: Episode One";
  62.             this.button3.UseVisualStyleBackColor = false;
  63.             this.button3.Click += new System.EventHandler(button3_Click);
  64.             ///
  65.             /// BUTTON 4
  66.             ///
  67.             this.button4.Text = "Half-Life 2: Episode Two";
  68.             this.button4.UseVisualStyleBackColor = false;
  69.             this.button4.Click += new System.EventHandler(button4_Click);
  70.         }
  71.  
  72.         private void button1_Click(object sender, EventArgs e)
  73.         {
  74.             string myDir = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
  75.             string gameDir = Path.Combine(myDir, "E:\\Steam Games\\SteamApps\\common\\CM2013");
  76.             string gameExe = Path.Combine(gameDir, "Configurator.EXE");
  77.             Process proc1 = new Process();
  78.             proc1.StartInfo.FileName = gameExe;
  79.             proc1.StartInfo.WorkingDirectory = gameDir;
  80.             proc1.SynchronizingObject = this;
  81.             proc1.EnableRaisingEvents = true;
  82.             proc1.Start();
  83.         }
  84.  
  85.         private void button2_Click(object sender, EventArgs e)
  86.         {
  87.             string myDir = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
  88.             string gameDir = Path.Combine(myDir, "E:\\Steam Games\\SteamApps\\common\\CM2013");
  89.             string gameExe = Path.Combine(gameDir, "Launcher_EP0.exe");
  90.             Process proc2 = new Process();
  91.             proc2.StartInfo.FileName = gameExe;
  92.             proc2.StartInfo.WorkingDirectory = gameDir;
  93.             proc2.SynchronizingObject = this;
  94.             proc2.EnableRaisingEvents = true;
  95.             proc2.Start();
  96.         }
  97.  
  98.         private void button3_Click(object sender, EventArgs e)
  99.         {
  100.             string myDir = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
  101.             string gameDir = Path.Combine(myDir, "E:\\Steam Games\\SteamApps\\common\\CM2013");
  102.             string gameExe = Path.Combine(gameDir, "launcher_EP1.exe");
  103.             Process proc3 = new Process();
  104.             proc3.StartInfo.FileName = gameExe;
  105.             proc3.StartInfo.WorkingDirectory = gameDir;
  106.             proc3.SynchronizingObject = this;
  107.             proc3.EnableRaisingEvents = true;
  108.             proc3.Start();
  109.         }
  110.  
  111.         private void button4_Click(object sender, EventArgs e)
  112.         {
  113.             string myDir = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
  114.             string gameDir = Path.Combine(myDir, "E:\\Steam Games\\SteamApps\\common\\CM2013");
  115.             string gameExe = Path.Combine(gameDir, "Launcher_EP2.exe");
  116.             Process proc4 = new Process();
  117.             proc4.StartInfo.FileName = gameExe;
  118.             proc4.StartInfo.WorkingDirectory = gameDir;
  119.             proc4.SynchronizingObject = this;
  120.             proc4.EnableRaisingEvents = true;
  121.             proc4.Start();
  122.         }
  123.  
  124.         private void exitToolStripMenuItem_Click(object sender, EventArgs e)
  125.         {
  126.             this.Close();
  127.         }
  128.     }
  129. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement