Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Diagnostics;
- using System.IO;
- using System.Reflection;
- using System.Windows.Forms;
- namespace HL2_Cinematic_Mod_Launcher
- {
- public partial class Form1 : Form
- {
- private ToolStripMenuItem _fileToolStripMenuItem;
- public Form1()
- {
- InitializeComponent();
- }
- public void Form1_Load(object sender, EventArgs e)
- {
- }
- string _gameDir = null;
- private void button1_Click(object sender, EventArgs e)
- {
- var myDir = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
- if (myDir == null) return;
- if (string.IsNullOrEmpty(_gameDir))
- {
- MessageBox.Show(@"Please select the Cinematic Mod installation directory first");
- return;
- }
- var gameExe = Path.Combine(_gameDir, "Configurator.EXE");
- var proc1 = new Process
- {
- StartInfo = { FileName = gameExe, WorkingDirectory = _gameDir },
- SynchronizingObject = this,
- EnableRaisingEvents = true
- };
- proc1.Start();
- }
- private void button2_Click(object sender, EventArgs e)
- {
- var myDir = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
- if (myDir == null) return;
- if (string.IsNullOrEmpty(_gameDir))
- {
- MessageBox.Show(@"Please select the Cinematic Mod installation directory first");
- return;
- }
- var gameExe = Path.Combine(_gameDir, "Launcher_EP0.exe");
- var proc2 = new Process
- {
- StartInfo = { FileName = gameExe, WorkingDirectory = _gameDir },
- SynchronizingObject = this,
- EnableRaisingEvents = true
- };
- proc2.Start();
- }
- private void button3_Click(object sender, EventArgs e)
- {
- var myDir = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
- if (myDir == null) return;
- if (string.IsNullOrEmpty(_gameDir))
- {
- MessageBox.Show(@"Please select the Cinematic Mod installation directory first");
- return;
- }
- var gameExe = Path.Combine(_gameDir, "launcher_EP1.exe");
- var proc3 = new Process
- {
- StartInfo = { FileName = gameExe, WorkingDirectory = _gameDir },
- SynchronizingObject = this,
- EnableRaisingEvents = true
- };
- proc3.Start();
- }
- private void button4_Click(object sender, EventArgs e)
- {
- var myDir = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
- if (myDir == null) return;
- if (string.IsNullOrEmpty(_gameDir))
- {
- MessageBox.Show(@"Please select the Cinematic Mod installation directory first");
- return;
- }
- var gameExe = Path.Combine(_gameDir, "Launcher_EP2.exe");
- var proc4 = new Process
- {
- StartInfo = { FileName = gameExe, WorkingDirectory = _gameDir },
- SynchronizingObject = this,
- EnableRaisingEvents = true
- };
- proc4.Start();
- }
- private void button5_Click(object sender, EventArgs e)
- {
- var fbd = new FolderBrowserDialog
- {
- Description = @"Please select the Cinematic Mod installation directory."
- };
- if (fbd.ShowDialog() != DialogResult.OK) return;
- {
- _gameDir = fbd.SelectedPath;
- }
- }
- private void exitToolStripMenuItem_Click(object sender, EventArgs e)
- {
- Close();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement