C# Launcher [Little help please] menu

Shout-Out

User Tag List

Results 1 to 9 of 9
  1. #1
    disgustedoak's Avatar Member
    Reputation
    2
    Join Date
    Apr 2009
    Posts
    10
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    C# Launcher [Little help please]

    Hello MMowned, If somone could provide me with a little help please this would be greatly appreciated,

    I'm making a WoW launcher for my private server, i have made the play button to Set realmlist and launch the game at the same time, i will provide the code i used maybe this could help somone,

    To Start the game:
    Code:
      private void button2_Click(object sender, EventArgs e)
            {
                if (File.Exists("C/Program Files/World of Warcraft/WoW.exe"))
                {
                    System.Diagnostics.Process.Start(@"C:\Program Files\World of Warcraft\WoW.exe");
                }
    To Set realmlist.
    At the top where it says "using " " " Put using System.IO;

    Code:
          if (File.Exists("C:/Program Files/World of Warcraft/Data/EnUS/realmlist.wtf"))
                {
                    StreamWriter realmlist = new StreamWriter(@"C:\Program Files\World of Warcraft\Data\EnUS\realmlist.wtf");
                    realmlist.Write("you realmlist");
                    realmlist.Close();
    All i need to know is how to get my "Website button" to take me to my website, I have researched for hours but i cannot find the code or examples anywhere

    Thank's alot,
    Caskast!
    Last edited by disgustedoak; 07-08-2009 at 04:41 PM.

    C# Launcher [Little help please]
  2. #2
    Oceanblack's Avatar Member
    Reputation
    17
    Join Date
    Feb 2009
    Posts
    67
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Couple of unrelated issues with your code..

    1. You shouldn't use a static file directory, set the C:\Program Files\WoW directory to a variable that the user can change to because my WoW location for example doesn't go there.
    2. You can simplify calling .NET commands by adding using <namespace> name at the top of your code, for example instead of writing System.Diagnostics.Process.Start you can write "using System.Diagnostics;" at the top and then just write Process.Start for the rest of your code.
    3. Name all your GUI members, "button2" is a bad habit


    To start a website, you can simply write "Process.Start("http://www.website.com");" and it will automatically open default browser to view.

  3. #3
    disgustedoak's Avatar Member
    Reputation
    2
    Join Date
    Apr 2009
    Posts
    10
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok thank's dude you taught me somthing new, i only started doing this yesterday so im a bit rough on it atm but my wow launcher is working quite cool and for that code you just gave me was too simple why didnt i try it? no idea lmao but thanks alot i will try these things!! +Rep if it will let me


    EDIT2: Ok so thats all sorted if anyone knows, after i press play i want it to close the launcher so the code is atm

    Code:
    using System.Diagnostics;
    Code:
    if (File.Exists ("WoW.exe"))
    {
       Process.Start (@"WoW.exe);
    }
    Somwhere after that needs to be a trigger to close the program anyone know how to do this? All help much appreciated thanks!
    Last edited by disgustedoak; 07-08-2009 at 08:43 PM.

  4. #4
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this.close(). You need to check the registry to see where WoW is installed, then go from there. This will make your users much happier.

    After you launch WoW, just make sure that it's running(Process.Create() should return true or something). Then you can this.close().

  5. #5
    Mr.Zunz's Avatar Contributor
    Reputation
    92
    Join Date
    Mar 2007
    Posts
    393
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I dunno if i may post in a thread 4 weeks old, but anyway...

    Code:
    RegistryKey read = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Blizzard Entertainment\World of Warcraft");
    string path = read.GetValue("InstallPath").ToString();
    Code:
    
    
    Gives you the install path, it's way better then using C:\blabla.


  6. #6
    Seifer's Avatar Site Donator
    Reputation
    129
    Join Date
    Apr 2007
    Posts
    270
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The following code opens up your given URL in the foo variable in the machine's default browser.

    Code:
    var foo = "http://yoursite.com";
    System.Diagnostics.Process.Start(foo);
    Also one search on MSDN provided the following:
    Code:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using System.Net;
    
    namespace Test
    {
        public partial class Form1 : Form
        {
            private string url = http://www.google.com;
    
            public Form1()
            {
                InitializeComponent();
            }
    
            private void button1_Click(object sender, EventArgs e)
            {
                System.Diagnostics.Process.Start(url);
            }
        }
    }
    - Seif
    Last edited by Seifer; 08-21-2009 at 06:28 PM.

  7. #7
    Lytle69's Avatar Member
    Reputation
    13
    Join Date
    Aug 2008
    Posts
    66
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Idk if I can add to this. But how Would I make a Launcher Del Cache automatically upon every time it's used?



    Environment.Exit(-1); Also Works to Exit after it launches.
    Last edited by Lytle69; 09-03-2009 at 06:45 AM.

  8. #8
    XxCyanidexX's Avatar Member
    Reputation
    56
    Join Date
    Nov 2008
    Posts
    138
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Lytle69 View Post
    Idk if I can add to this. But how Would I make a Launcher Del Cache automatically upon every time it's used?



    Environment.Exit(-1); Also Works to Exit after it launches.
    Make sure you are using System.IO and then add to the buttonclick void before WoW is started:

    Code:
    Directory.Delete(@"Cache", true);
    //Replace cache with whatever path you need

  9. #9
    insignia96's Avatar Banned
    Reputation
    33
    Join Date
    Oct 2008
    Posts
    304
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ProcessStartInfo

    This is the worst code i have ever seen for the game starting. You have to set the working directory of the process. Like this

    Code:
    using System;
    using System.Diagnostics;
    
    ProcessStartInfo wowprocess = New ProcessStartInfo("A\registry\read\WoW\Path\WoW.exe");
    
    wowprocess.WorkingDir = "A\registry\read\WoW\Path\";
    
    Process.Start(wowprocess);


    If you dont set the working dir, the game will crash.

    Have a nice day

    Links for Help:

    Process.Start Method (ProcessStartInfo)

    ProcessStartInfo Class

Similar Threads

  1. Little help please :(
    By Masterkenshin in forum World of Warcraft Emulator Servers
    Replies: 10
    Last Post: 01-09-2008, 12:47 PM
  2. A little help please
    By VausIsBoss in forum WoW ME Questions and Requests
    Replies: 1
    Last Post: 12-10-2007, 03:26 AM
  3. A little help please
    By vernath in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 10-18-2007, 04:14 PM
  4. a little help please
    By trika in forum World of Warcraft Model Editing
    Replies: 5
    Last Post: 07-01-2007, 12:52 PM
  5. a little help please
    By Vital in forum World of Warcraft General
    Replies: 1
    Last Post: 10-25-2006, 06:39 PM
All times are GMT -5. The time now is 06:31 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search