Likes: 0
Results 1 to 2 of 2
-
13-08-08, 07:48 AM #1
Create A Server Launcher EASY WAY
Register to remove this adOverview
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: Downloads
Now you will need some images for the background etc. Just some material really, its not “needed” but if you want it to look good, it needs some images lets continue, shall we?
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 past this in
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.ProgramFil es)
.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
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
Enjoy
› See More: Create A Server Launcher EASY WAY
-
13-08-08, 05:19 PM #2SuccyGuest
Register to remove this adWewt, Long, but usefull Guide! I like it! +Rep