How to program your very own custom launcher in Vb .net
Original Guide by
kolklik_Frozen@hotmail.com AC WEB Tutorial Part 1
Overview
1 - Things you need
2 - Getting started
3 - Sample code (complete code)
4 – Personalizing the code
5 – Design the form
6 - finalizing
7 - Notes!! (important!!)
1
Quite logically you need visual basic 2008 .net since we will work in it. To get it simply download it from Microsoft, its completely free link is:
Download 2
Now, you’re done downloading Vb.net, you’ll have to install it, now ill let YOU figure out how to do this. Once your done, you start up Vb.net now step by step:
1. Click “files”
2. Click “new project”
3. By default it should select “windows forms application” if it hasn’t, select it.
4. Name: something you want.
5. Now you will see a “form” called “Form1” this is the form you will “design” for your application/launcher.
3
Now you double click the form, and a code window will appear. This is where the code will be entered. The code tells the application what to do when something happens, fx. If user clicks button1
.
Press Ctrl + a, and delete all the code in there. Now copy paste this in
Code:
Imports System.IO
Imports System.Environment
Public Class Form1
Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim fs As New FileStream("realmlist.wtf", FileMode.Create, FileAccess.Write)
Dim s As New StreamWriter(fs)
s.WriteLine("set realmlist winter-wow.servegame.org")
s.Close()
Dim ss As String = startgame("HKEY_LOCAL_MACHINE\SOFTWARE\blizzard entertainment\world of warcraft", "installpath", "WoW.exe")
If ss <> String.Empty Then
My.Settings.wow = ss
My.Settings.Save()
End If
End Sub
Private Function startgame(ByVal RegPath As String, ByVal RegValue As String, ByVal ExeFile As String) As String
Dim retval
Dim installpath As String = String.Empty
installpath = My.Computer.Registry.GetValue(RegPath, RegValue, Nothing)
If Directory.Exists(installpath) Then
ChDir(installpath)
retval = Shell(ExeFile, 1)
Else
With OpenFileDialog1
.InitialDirectory = GetFolderPath(Environment.SpecialFolder.ProgramFiles)
.Title = "Please Select " & ExeFile
.Filter = "Windows Executable *.Exe|*.exe"
.FileName = ExeFile
If .ShowDialog() = Windows.Forms.DialogResult.OK Then
Process.Start(.FileName)
Return .FileName
End If
End With
End If
Return String.Empty
End Function
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
Now this might look VERY confusing, and it is if you’ve never worked with Vb.net, but ill help you guys break it down.
4
Lets start personalizing the code, as you properly don’t want your launcher to connect all your players to winter-
wow (hehe ) so find:
s.WriteLine("set realmlist winter-
wow.servegame.org")
In the code, and change the content between “” to match what you need. Fx. “Set realmlist myserver.org” Just leave the rest, as that is mainly the code to start
wow when button1 is clicked.
Also go into “project” -> “[name] properties” and then select the tab called “settings”
Inside “settings” you change the first box saying “setting” to “
wow” then you click the x and when it asks if you want to save changes, you click yes. Now you should be back in the code window.
5
Now we are going to design the form! There is a lot of things you can do, but for now, lets add a cool background image, and some buttons!
1. Go back to your design by clicking the bar saying “form1[design]”.
2. In the lower right corner you will see a properties window.
3. Inside the properties window you can change tons of things, but for now, we will change the background. So find “background image” and mark it by a single click
4. Now click the little buttons with the 3 dots (…) a window saying “select resources” will pop up. Chose local resource, and click import.
5. Now browse to your picture and mark it, and click open, it will then add it as your background
6. Under “background image” in the properties window, you will see “background image layout” this determines weather your image is stretch or centered or what ever. Consider changing it to what you like.
7. Now, lets change the name of the window, because “form1” isn’t that cool is it?
8. Go to the button of the properties window, there you will find “text” now, change text to what you want your window to display in the top left corner.
9. Also, that ugly icon isn’t cool is it? Lets change it! Scroll up a bit and you will find “icon” now it’s the same as with the background image, once done, you will notice your new icon followed by the name you entered in “text”
10. When your done, you will get an .exe file, but we don’t want it to say the default beneath it do we? (no we don’t) so go to “project” in the top bar, and click the last thing in the menu it will be “{name) Properties”
11. Now a settings window will appear, so lets get down to business. In the tab called “application” you click on “assembly information” now you can change what you like, just not the GUID nor the native language.
12. You may notice it has a little box saying “icon” now go ahead and change it, this is the icon your .exe file will have when its inside your world of warcraft folder or your desktop or what ever.
13. Assembly name, you should change that to {name) Launcher. Fx. Winter
WoW Launcher or “Toxic
WoW launcher” or what ever, you know what I meen.
14. once done changing what you want, just click the little x.
15. Now we are back on the form again, lets add a button! In the left you can see your “toolbox” this is where you can get all the nifty stuff, now click on button, and draw a button on your form.
16. If you click on the button 1 time, you will notice the properties window changes, so that now you can edit the button, go ahead, change the button settings to your liking fx. An image on it (cos the traditional button isn’t very wowish is it?)
17. now in the toolbox find “open file dialog” and add one of those to the form, don’t worry about it not showing up, it adds it self to the “code” so to say, as it’s a dynamic item.
18. Now you can add a “label” to your form, just like with the button, you can find it in the toolbox. A label is used to have text on your form like “Thank you for using our launcher and playing on our server” or what do I know. Once again, you can modify it in the properties window.
19. This is all you have to have for the application to work (the label isn’t needed)
6
Now, if you did all of this correctly, go to “file” “Save As” and change “location” to where you want it, I normally save mine in c:\ fx c:\winterwow\ or c:\ult launcher\ or something. When you’ve done that, you go to “build” and “build [name]”
When its done building (will take like 1 second or something) you go to your location. Fx. C:\winterwow\Winterwow\Winterwow\bin\Release\ and in there I can see “Winter
wow launcher.exe” because that is what I’ve chosen to call my application!
I hope this was fairly easy to understand, now I will show you how mine ended up looking. Have fun messing around with Vb .net, and congratulations with making your first programmed application!
7
Please note, that when you click the button, it creates a new realmlist.wtf for you, so you need to have the .exe file in your world of warcraft folder, but you can make a shortcut to the desktop
original guide written by kolklik_Frozen@hotmail(dot)com
Part 2
Original Guide by
kolklik_Frozen@hotmail.com AC WEB Tutorial
Content
1 - Delete Cache
2 - Normal Realmlist or yours
3 - Get rid of the windows frame
1 - Delete the Cache
1.Add an new button to your form and double click it so you get into the code window.
2.Enter this
Code:
Dim installpath As String = String.Empty
installpath = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\blizzard entertainment\world of warcraft", "installpath", Nothing)
If Directory.Exists(installpath & "/cache") Then
Directory.Delete(installpath & "/cache", True)
MsgBox("Cache deleted successfully")
Else
MsgBox("There is no cache")
End If
2 - Normal Realmlist or yours
What i will explain to you now, is how to change so the launcher can switch peoples realmlist for them. Also, i will remove the code part that makes
wow start with your realmlist when you click the button (In my previous guide i told you how to make it do so):
1. Go to "project" in the top bar.
2. Click "Add windows form".
3. Select "windows form".
4. Click "add"
5. You should now see a new form in the solution explorer the form will by default be named "form2.vb" By now, it should also display form2 in design mode.
6. Now make your form like you want it.
7. Add 3 buttons. 1 for engb, one for enus and one for your own server.
8. Double click the engb button.
9 Insert this code before anything els in the code window.
10. Insert code into the button click sub
Code:
Dim installpath As String = String.Empty
installpath = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\blizzard entertainment\world of warcraft", "installpath", Nothing)
Dim fs As New FileStream(installpath & "realmlist.wtf", FileMode.Create, FileAccess.Write)
Dim s As New StreamWriter(fs)
s.WriteLine("set realmlist eu.logon.worldofwarcraft.com")
s.WriteLine("set patchlist eu.version.worldofwarcraft.com")
s.Close()
11. Lets do the same with the enus
Code:
Dim installpath As String = String.Empty
installpath = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\blizzard entertainment\world of warcraft", "installpath", Nothing)
Dim fs As New FileStream(installpath & "realmlist.wtf", FileMode.Create, FileAccess.Write)
Dim s As New StreamWriter(fs)
s.WriteLine("set realmlist us.logon.worldofwarcraft.com")
s.WriteLine("set patchlist us.version.worldofwarcraft.com")
s.Close()
12. Now lets add some code to your own realmlist button.
Code:
Dim installpath As String = String.Empty
installpath = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\blizzard entertainment\world of warcraft", "installpath", Nothing)
If File.Exists(installpath & "realmlist.wtf") Then
File.Delete(installpath & "realmlist.wtf")
Dim fs As New FileStream(installpath & "realmlist.wtf", FileMode.Create, FileAccess.Write)
Dim s As New StreamWriter(fs)
s.WriteLine("set realmlist your realmlist")
s.Close()
End If
13. Now go to form1
14. Double click the button you've used to start
wow.
15. Delete
Code:
Dim fs As New FileStream("realmlist.wtf", FileMode.Create, FileAccess.Write)
Dim s As New StreamWriter(fs)
s.WriteLine("set realmlist your realmlist")
s.Close()
16. You're done!
3 - Remove the windows frame
Now i will show you how to remove that ugly blue/silver/what ever bar on top of your application.
1. Go to form1[design]
2. Make sure you got the whole window marked (so that you edit the form and not an button)
3. In the lower right corner you will find the properties window.
4. Now find Font -> FormBorderStyle.
5. Change it to None.
6. Now you may notice that the border above your application is gone () Lets start making our own.
7. Depending on what you want your user to be able to do add:
-Only close the application: 1 button.
-Close and minimize the application: 2 buttons.
-All the things you normaly can (minimize, maximize, and close): 3 buttons.
8. Double click the button you've added to close the appication.
9. Add this code
10. If you have an button to minimize the application add this code
Code:
Me.WindowState = FormWindowState.Minimized
11. If you have an button to maximize the application add this code
Code:
If Me.WindowState = FormWindowState.Maximized Then
Me.WindowState = FormWindowState.Normal
Else
Me.WindowState = FormWindowState.Maximized
End If
If you do chose to do this, i would advise you to do the same with the realmlist form. (form2)
That's it! you're done! I hope this was any help to you, as I've spend a lot of time on this guide.
Original Guide by
kolklik_Frozen@hotmail.com AC WEB Tutorial