Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using System.Diagnostics;
- using System.IO;
- namespace Create_Your_Own_Launcher
- {
- public partial class Form1 : Form
- {
- string location;
- string realm;
- public Form1()
- {
- InitializeComponent();
- }
- private void b_web_Click(object sender, EventArgs e)
- {
- Process openWeb = Process.Start("http://unforgivenwow.com");
- private void Form1_Load(object sender, EventArgs e)
- {
- realm = "set realmlist logon.unforgivenwow.com";
- this.Text = "UnforgivenWoW's Launcher";
- toolTip1.SetToolTip(b_web, "Click to visit http://unforgivenwow.com");
- toolTip1.SetToolTip(c_realm, "Check, if you want to set your realmlist to \"" + realm + "\".");
- locateWow(false);
- }
- public void locateWow(bool recreate)
- {
- if (recreate == true)
- {
- try
- {
- File.Delete("data");
- }
- catch
- { }
- }
- if (!File.Exists("data"))
- {
- if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
- {
- try
- {
- StreamWriter write = new StreamWriter("data", true);
- write.Write(folderBrowserDialog1.SelectedPath);
- write.Close();
- location = folderBrowserDialog1.SelectedPath.ToString();
- }
- catch
- {
- }
- }
- else
- {
- DialogResult dr = MessageBox.Show("For full launcher functionability, you have to set your wow directory. Hit 'Retry' to repeat your selection, hiting 'Cancel' will close the launcher.", "Repeat directory selection?", MessageBoxButtons.RetryCancel, MessageBoxIcon.Warning);
- if (dr == DialogResult.Retry)
- {
- locateWow(false);
- }
- else
- {
- this.Close();
- }
- }
- }
- else
- {
- try
- {
- StreamReader reader = new StreamReader("data");
- location = reader.ReadToEnd();
- reader.Close();
- }
- catch
- { }
- }
- }
- private void b_locate_Click(object sender, EventArgs e)
- {
- locateWow(true);
- }
- private void b_launch_Click(object sender, EventArgs e)
- {
- if (c_realm.Checked == true)
- {
- try
- {
- string path = location;
- if (Directory.Exists(location + "\\Data\\enUS"))
- {
- path = location + "\\Data\\enUS";
- }
- else if (Directory.Exists(location + "\\Data\\enGB"))
- {
- path = location + "\\Data\\enGB";
- }
- if (File.Exists(path + "\\realmlist.wtf"))
- {
- File.Delete(path + "\\realmlist.wtf");
- }
- StreamWriter writer = new StreamWriter(path + "\\realmlist.wtf", true);
- writer.Write(realm);
- writer.Close();
- }
- catch
- {
- MessageBox.Show("An error occoured while working with realmlist.wtf. This file wasnt probably edited.", "An error occoured while working with realmlist.wtf:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- }
- if (c_cache.Checked == true)
- {
- try
- {
- if (Directory.Exists(location + "\\cache"))
- {
- Directory.Delete(location + "\\cache", true);
- }
- Directory.CreateDirectory(location + "\\cache");
- }
- catch
- {
- MessageBox.Show("An error occoured while working with cache folder. This folder probably wasnt deleted.", "An error occoured while working with cache folder:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- }
- try
- {
- Process.Start(location + "\\Wow.exe");
- }
- catch
- {
- MessageBox.Show("Launching Wow.exe failed. Are you sure you have choosen right directory?", "Launching Wow.exe failed:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- }
- private void c_cache_CheckedChanged(object sender, EventArgs e)
- {
- }
- private void button2_Click(object sender, EventArgs e)
- {
- process1.Start();
- MessageBox.Show("Before trying to join Ventrilo, you must set your server information up. Host:unforgivenwow.instantvent.com,Port:3444! Remeber to set this before you try to log into Vent!", "Note:", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
- }
- private void b_for_Click(object sender, EventArgs e)
- {
- Process openWeb = Process.Start("http://forum.unforgivenwow.com");
- }
- private void c_realm_CheckedChanged(object sender, EventArgs e)
- {
- }
- private void button1_Click(object sender, EventArgs e)
- {
- Process openWeb = Process.Start("http://torrents.thepiratebay.org/6163279/World_of_Warcraft__Wrath_of_the_Lich_King_3.3.5a_(12340).6163279.TPB.torrent");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement