- 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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Now for the coding
press F7.
Under Public Class Form1 add these Dims.
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.
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.
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.
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
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.
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
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
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
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.
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.
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: