Welcome to Ac-Web AC-Web

Join us now to get access to all our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, and so, so much more. It's also quick and totally free, so what are you waiting for?

Ask a Question

Ask Questions and Get Answers from Our Community

Ac-Web Official Repacks !

Here you will find all our official repacks

Contact Us

Contact a Staff member if needed

[How To] Make A Game Launcher For Your Server (VB.Net 2010)

The5thelement

Senior
Senior
joined: Jul 2, 2010
messages: 520
Reaction score: 56
Points: 0
Location: DBC Modding, SQL, C#
Credits: 0
*The following tutorial is for people who have experience and knowledge of how to use
Visual Basics 2010. However if you have not used Visual Basics before please feel
free to add my on skype egamaton420. If you need any help understanding how
something works or if you need help in general.

If you need VB.Net 2010 you can download it here. You will also need to download the
LauncherGUI.


Lets Get Started!

Start Visual Basics and start a new project. Select "Windows Form Application" and
name it Launcher then click okay. Once the project loads right click Launcher in the
"Solution Explorer" and click "Properties". When the next window opens click the
"Application" tab and set the icon to LauncherIcon.ico. Then open
"Resources" tab. At the top click "Add Resources" then "Add Existing File". Select
all the images from the LauncherGUI folder. Click Ok.
rsbrbp.jpg

11ae8g4.jpg

14occhs.jpg


Click the Form1 image in the "Form1.vb [Design] tab". Got to the "Properties" box
and change the form size to 657, 516. Change the form text to say "Launcher".
Change is Start Position to Center Screen and set its Icon to the LancherIcon.ico
that was included in the LauncherGUI. Set the form background to the
FormBG.png that was included in the LauncherGUI
29crnlk.jpg


Add a PictureBox to the form and change its size to 95, 53 its location to 529, 413
and it's image to PlayLeave.png. Add another PictureBox to the form and change
its size to 103, 25 its location to 132, 437 and set its image to SupportLeave.png.
Add a third PictureBox to the form and change its size to 103, 25 its location to
16, 437 and set its image to OptionsLeave.
2cqen8w.jpg


Time For Some Coding! [Basic Launcher]

Press F7 to open the source code of our application.

We need to add a import so the application can read and write to files. to do this
enter "Imports System.IO" at the very top.

In the source code add a new "General" for PictureBox1 and add a "Declaration"
as MouseEnter. When the mouse enters PictureBox1 we want the image to
change to show that something is happening. To do this add this code to
PictureBox1_MouseEnter.
Code:
PictureBox1.Image = My.Resources.PlayEnter 
REM This tells the PictureBox image to change to PlayEnter.png
Add a new "General" for PictureBox1 and add a "Declaration"
as MouseLeave. When the mouse leaves PictureBox1 we want the image to
change to show that something is happening. To do this add this code to
PictureBox1_MouseLeave.
Code:
PictureBox1.Image = My.Resources.PlayLeave 
REMThis tells the PictureBox image to change to PlayLeave.png

Add a new "General" for PictureBox1 and add a "Declaration" as MouseClick.
When the mouse clicks PictureBox1 we want the image to change to show
that something is happening and we want to start World of Warcraft.
To do this add this code to PictureBox1_MouseClick.
Code:
PictureBox1.Image = My.Resources.PlayClick
        If File.Exists(My.Computer.FileSystem.CurrentDirectory & "/Wow.exe") Then
        REM This tells the launcher to check the current directory for Wow.exe
            Shell(My.Computer.FileSystem.CurrentDirectory & "/Wow.exe")
            REM If Wow.exe is found this tells the launcher to start Wow.exe
            Me.Close()
            REM This tells the launcher to close after it start Wow.exe
        Else
            MsgBox("Could not start Wow.exe", MsgBoxStyle.Critical, "Application Not Found")
            REM If Wow.exe is not found this tells the launcher to show an error message
        End If

Add a new "General" for PictureBox2 and add a "Declaration"
as MouseEnter. When the mouse enters PictureBox2 we want the image to
change to show that something is happening. To do this add this code to
PictureBox2_MouseEnter.
Code:
PictureBox2.Image = My.Resources.SupportEnter 
REM This tells the PictureBox2 image to change to SupportEnter.png
Add a new "General" for PictureBox2 and add a "Declaration"
as MouseLeave. When the mouse leaves PictureBox2 we want the image to
change to show that something is happening. To do this add this code to
PictureBox2_MouseLeave.
Code:
PictureBox2.Image = My.Resources.SupportLeave 
REM This tells the PictureBox2 image to change to SupportLeave.png

Add a new "General" for PictureBox2 and add a "Declaration" as MouseClick.
When the mouse clicks PictureBox2 we want the image to change to show
that something is happening and we want to launch you website in a browser.
To do this add this code to PictureBox2_MouseClick.
Code:
PictureBox2.Image = My.Resources.SupportClick
REM This tells the PictureBox2 image to change to SupportClick.png
Process.Start("http://[COLOR="Red"]YOUR WEBSITE HERE[/COLOR]")
REM This tells the launcher to open your servers website

Add a new "General" for PictureBox3 and add a "Declaration"
as MouseEnter. When the mouse enters PictureBox3 we want the image to
change to show that something is happening. To do this add this code to
PictureBox3_MouseEnter.
Code:
PictureBox3.Image = My.Resources.OptionsEnter
REM This tells the PictureBox3 image to change to OptionsEnter.png
Add a new "General" for PictureBox3 and add a "Declaration"
as MouseLeave. When the mouse leaves PictureBox3 we want the image to
change to show that something is happening. To do this add this code to
PictureBox3_MouseLeave.
Code:
PictureBox3.Image = My.Resources.OptionsLeave 
REM This tells the PictureBox3 image to change to OptionsLeave.png

Add a new "General" for PictureBox3 and add a "Declaration" as MouseClick.
When the mouse clicks PictureBox3 we want the image to change to show
that something is happening and we want to clear the wow/cache folder.
To do this add this code to PictureBox3_MouseClick.
Code:
PictureBox3.Image = My.Resources.OptionsClick
REM This tells the PictureBox3 image to change to OptionsClick.png
        If Directory.Exists(My.Computer.FileSystem.CurrentDirectory & "/Cache") Then
        REM This tells the launcher to check its current directory for a folder named "Cache"
            Dim Cache As String = (My.Computer.FileSystem.CurrentDirectory & "/Cache")
            REM This tells the launcher to turn the directory location of the cache folder into a string.
            Select Case MsgBox("Do you want to delete the Cache folder?", MsgBoxStyle.Critical + MsgBoxStyle.YesNo, "WARNING")
            REM This tells the launcher to display a message box with a yes and no button
                Case MsgBoxResult.Yes
                REM What happens when you press the yes button
                    Directory.Delete(Cache, True)
                    REM Deletes the cache folder
                Case MsgBoxResult.No
                REM Tells the launcher to do nothing if the no button is pressed
                End Select
         End If

Time For Some Coding! [Advanced Launcher]
*To do this part of the launcher you will need to download this.

In the source code above "Public Class Form1" We need to do some imports
Enter these imports.
Code:
Imports System.Net
Imports System.Net.Sockets

Now we will add the Server News to the launcher to do this add a WebBrowser to the form.
Change its size to 395, 269 and its location to 123, 106 and its visibility to false. Add a
label and set its text to "Could not connect to the News Server. Please check the network
and try again later." Set the labels visibility to true its location to 184, 224 and it background
color to transparent.
vqhcu0.jpg


Add a label and set its text to "Server Status:" and its location to 344, 435. Add another
label and set its text to "OFFLINE" and its location to 445, 435. And set its
forecolor to red. Set both as background color transparent.
2jadv13.jpg

Now for the coding
press F7.

Under Public Class Form1 add these Dims.
Code:
 Dim Apache As New TcpClient
Dim World As New TcpClient

Add a new "General" for Form1 Events and add a "Declaration" as Load.
When the form loads we want it to check a connection to your servers website
along with a connection to your world server.
To do this add this code to Form1_Load.
Code:
        Try
        REM Tells the launcher to try to do the following
            Apache.Connect("[COLOR="Red"]Your Servers IP Address[/COLOR]", (80))
        REM Tells the launcher to connect to your servers IP address on port 80
        Catch ex As Exception
        REM Tells the launcher what to do if a connection is not made
            Label1.Visible = True
            REM Tells the launcher to make label1 visible
        End Try
        REM Tells the launcher to stop trying the above
        Try
        REM Tell the launcher to try the following
            World.Connect("[COLOR="Red"]Your Servers IP Address[/COLOR]", (8085))
            REM Tells the launcher to connect to your server IP address on port 8085
        Catch ex As Exception
        REM Tells the launcher what to do if a connection is not made
            Label3.Text = "OFFLINE"
            REM Tells the launcher to set label3's text to "OFFLINE'
            Label3.ForeColor = Color.Red
            REM Tells the launcher to set label3's forecolor to red
        End Try
        REM Tells the launcher to stop trying the above

        If Apache.Connected Then
        REM Checks if Apache is connected
            WebBrowser1.Visible = True
            REM Makes the web browser visible if Apache is connected
            WebBrowser1.Navigate("http://[COLOR="Red"]Your Website Here[/COLOR]/launcher/news.html")
            REM Navigates the web browser to http://[COLOR="Red"]Your Website Here[/COLOR]/launcher/news.html
            Label1.Hide()
            REM Hides label1 from view
            Apache.Close()
            REM Closes the socket Apache was using *ALWAYS CLOSE YOUR SOCKETS
        End If
        REM Ends the above IF statement

        If World.Connected Then
        REM Checks if World is connected
            Label3.Text = "ONLINE"
            REM Changes lebel3's text to "ONLINE" if World is connected
            Label3.ForeColor = Color.Green
            REM Changes label3's fore color to green if World is connected
            World.Close()
            REM Closes the socket World was using *ALWAYS CLOSE YOUR SOCKETS
        End If
        Rem Ends the above if statement

And Your Done!

Now that you are done its time to check out the kick ass launcher you just made.
At the top of Visual Basics 2010 locate "Debug" on the menu bar. Click it and
select "Build Launcher". Now travel to "Documents/Visual Studio 2010/Projects/Launcher/Launcher/bin/Release".
Inside you will find your "Launcher.exe' place it within your wow folder and start it up. Pretty awesome yea!

But What About Server News?
To show the server news simply place the launcher folder you downloaded in
the root folder of your website. Inside you will find two images and an html
document. The images are displayed as the background of the news server. The
html document is used to display the news. Edit this to say anything you like.
 
Last edited:

Tazzer

Retired from Emulation
Pu
joined: Aug 28, 2010
messages: 950
Reaction score: 90
Points: 0
Age: 25
Location: youtube.com/ProTazzerHD
Credits: 15
Nice tut, Maybe some images would been nice as well +rep
 

<Baldo>

Registered
joined: May 20, 2012
messages: 29
Reaction score: 3
Points: 0
Location: Developing in SQL
Credits: 0
I did all the steps,copyed all the codes but still they are mistakes in the codes that my visual basic shows me.But nice tut!Good luck :)
 

AwkwardDev

running amongst ghouls ..
Spu
joined: Feb 24, 2010
messages: 11,191
Reaction score: 492
Points: 83
Age: 30
Location: Thinking in assembly, dreaming in symbols, talking
Credits: 17
Amazing tutorial! + rep
 

The5thelement

Senior
Senior
joined: Jul 2, 2010
messages: 520
Reaction score: 56
Points: 0
Location: DBC Modding, SQL, C#
Credits: 0
<Baldo>
I did all the steps,copyed all the codes but still they are mistakes in the codes that my visual basic shows me.But nice tut!Good luck :)
You are using VB.Net 2010? Also what errors is it showing?

AwkwardDev
Amazing tutorial! + rep

Thank you very much! I know many do not like VB.Net but I am a starting programer and
find this a great way to start out.
 

kris914g

Registered
joined: Aug 8, 2012
messages: 40
Reaction score: 0
Points: 6
Location: Denmark http://wow.nssgaming.com/
Credits: 5
pictures

pls where did you funde the wow pictures
 

The5thelement

Senior
Senior
joined: Jul 2, 2010
messages: 520
Reaction score: 56
Points: 0
Location: DBC Modding, SQL, C#
Credits: 0
pls where did you funde the wow pictures

They are inside
Code:
WoW\Data\enUS(Or whatever you use)\base-enUS.MPQ\World of Warcraft Launcher.app\Contents\Resources\launcher.MPQ
 

asbert75

Super Power User
Spu
joined: May 26, 2010
messages: 5,441
Reaction score: 310
Points: 83
Age: 26
Credits: 5
Could you add the download link to mediafire instead of filebeam? I don't know why but I have never been able to download from filebeam :(
 

Korrigal

Senior
Senior
joined: Mar 26, 2011
messages: 567
Reaction score: 27
Points: 28
Credits: 0
Am I able to do all of this just using Visual Studio 2010 Ultimate, or must I use Visual Basic as well?
 

The5thelement

Senior
Senior
joined: Jul 2, 2010
messages: 520
Reaction score: 56
Points: 0
Location: DBC Modding, SQL, C#
Credits: 0
Getting some build errors...

Here is the code I have if you hit F7 http://pastebin.com/DzVBS1ja And here is the errors when I try to build... http://pastebin.com/UaEmYWBD

I'm sure I musta done something wrong, but no clue...


At the top of the code type "Imports System.IO"

As for error 2 you need to go to the line and add an "End If" on the next line.
As for error 5 you need to go to the line and add an "End Select" on the next line.

Am I able to do all of this just using Visual Studio 2010 Ultimate, or must I use Visual Basic as well?

Visual Basics is apart of the Visual Studio suite. So I would say yes.
 
Last edited:

DeadGit

AintNobodyGotTimeFoDat
Spu
joined: Oct 21, 2009
messages: 1,832
Reaction score: 67
Points: 0
Location: United Kingdom
Credits: 0
Great tutorial :D
 

statoil

Registered
joined: Jun 9, 2008
messages: 173
Reaction score: 2
Points: 0
Location: Norway
Credits: 0
Sweet tutorial but, is it possible to make that news tingy in rss too?
 

khazan

Senior
Senior
joined: Mar 29, 2010
messages: 930
Reaction score: 40
Points: 0
Location: Canada
Credits: 0
nice tutorial thanks !
 

The5thelement

Senior
Senior
joined: Jul 2, 2010
messages: 520
Reaction score: 56
Points: 0
Location: DBC Modding, SQL, C#
Credits: 0
Sweet tutorial but, is it possible to make that news tingy in rss too?

Im sorry it took so long to respond I have been very busy lately. To be honest with you I don't know
RSS. However in the next week or so I will be updating the "News" section of the guide with one that
can be read from the database instead of having to add new code to the html.
 

LordAres

Veteran
joined: Dec 27, 2012
messages: 82
Reaction score: 8
Points: 0
Credits: 0
In the code how would i do
Code:
Add a new "General" for Form1 Events and add a "Declaration" as Load.

In my code all i have is

Code:
Public Class Form1

End Class
 

jgg

Registered
joined: Oct 31, 2009
messages: 10
Reaction score: 0
Points: 0
Credits: 0
- - - Updated - - -

nice guide
please edit it
PictureBox1_MouseLeave.
Code:
PictureBox1.Image = My.Resources.PlayLeave
REMThis tells the PictureBox image to change to PlayLeave.png

and there isnt any END IF
REM This tells the PictureBox3 image to change to OptionsClick.png
If Directory.Exists(My.Computer.FileSystem.CurrentDirectory & "/Cache") Then
REM This tells the launcher to check its current directory for a folder named "Cache"
Dim Cache As String = (My.Computer.FileSystem.CurrentDirectory & "/Cache")
REM This tells the launcher to turn the directory location of the cache folder into a string.
Select Case MsgBox("Do you want to delete the Cache folder?", MsgBoxStyle.Critical + MsgBoxStyle.YesNo, "WARNING")
REM This tells the launcher to display a message box with a yes and no button
Case MsgBoxResult.Yes
REM What happens when you press the yes button
Directory.Delete(Cache, True)
REM Deletes the cache folder
Case MsgBoxResult.No
REM Tells the launcher to do nothing if the no button is pressed
 
Last edited:
Back
Top