Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Web [Tools]Creating a launcher in VB .NET 2010

Status
Not open for further replies.
Newbie Spellweaver
Joined
May 3, 2008
Messages
35
Reaction score
5
Brief Introduction:
Hey everyone, I have floated around for awhile and have never really contributed anything. Well here today I have decided I would try my best to take what I know into helping you create a launcher for your Maplestory server! Progressively through this tutorial you will get from the simple start up, to a little more flashy, and advanced launcher. So hopefully some of you will enjoy this tutorial! Thank you!

Keep in mind it is a good idea to have a default directory for the private server client! It will be hard-coded and if the launcher cannot find the program it is looking for, it will not work! (ie. C:\Nexon\Maplestory\localhost.exe)

Little Info on VB .NET 2010
As most everyone here knows, Visual Basic is a language that allows you to visually construct a user interface by simply dragging and dropping controls onto a form. (The window that comes up when a program is run.)

Barebones:
So let's start simple. In Visual Studio .NET 2010 go ahead and open up a new Windows Forms Application.

Sylint19 - [Tools]Creating a launcher in VB .NET 2010 - RaGEZONE Forums


Now you'll see something like this. I've already resized my form. You can do that by dragging the little white handles on the side of the form. I also went ahead and renamed my form. Inside the properties window, located to the right near the bottom, there is a property called "Text". Click that and type in what ever you want. Also, look for the property called "MaximizeBox" set this value to "False", we do not want people resizing this.

Sylint19 - [Tools]Creating a launcher in VB .NET 2010 - RaGEZONE Forums


So now that our form is named and at a size we like, let's go ahead and add our shiny "Start" button. In order to add the button, we need our toolbox open, if it isn't up at the moment, go ahead and click the "View" drop-down window at the top of the Visual Studio Interface. Or if you're not a fan of clicking, go ahead and press CTRL + ALT + X.

Sylint19 - [Tools]Creating a launcher in VB .NET 2010 - RaGEZONE Forums


The toolbox is now open. Don't be startled by what's there! It's actually pretty simple. Look carefully, the toolbox has been divided into categories. Now the button we are looking for is under the category "Common Controls."

Sylint19 - [Tools]Creating a launcher in VB .NET 2010 - RaGEZONE Forums


Now simply by clicking on the text, the category will expand, revealing a numerous amount of controls available for your pleasure. Now all we need right now is the "Button" control. Go ahead and drag and drop the "Button" control from the toolbox onto your form.

Sylint19 - [Tools]Creating a launcher in VB .NET 2010 - RaGEZONE Forums


When you click the button on your form, it becomes selected. The handles appear around it, allowing you to resize it. Go ahead and resize it to your liking. You may also drag the button around your form, so place it where you'd like as well.

Now since I assume the ones following this tutorial are not avid coders and may just be getting started, I am going to help you keep things organized.

When your button is selected, the properties of the button are now displayed in the properties window to the right. Look for the "(Name)" property, currently this control is named "Button1". To practice good organization in our code, let's go ahead and change that to something like "btnStart". Controls in Visual Basic can be better identified by renaming them, since the name is what we use in the code.

Sylint19 - [Tools]Creating a launcher in VB .NET 2010 - RaGEZONE Forums


Scroll down to the "Text" property in the properties window for the button and change it to something like "Start Game".

Now our form is clean and easily accessible to any player that utilizes it!

Coding the Start Button:
Now we will be adding code to "btnStart", so to access the coding window, simply double click the button we created earlier. A new window will appear with the code:

Code:
Public Class Form1

    Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click

    End Sub
End Class

This simply shows where the code is running. Your cursor will be underneath the Private Sub and above the End Sub. This is where we will tell the program what to do when the button is clicked.

First we need to create a String Variable. This string will tell the program where the client is when the button is pressed. To declare a variable we must type in:

Code:
Dim directory As String

Now that the variable is declared we must let the program know what Directory is. To do this, type this:

Code:
directory = "C:\Nexon\Maplestory\localhost.exe\"

NOTE: If you plan to have players install Maplestory elsewhere, place that directory in, instead of the one I provided!

The program now knows what it will be executing, but we must now tell it how to get there. This code may seem a little bit weird, but it is basically the equivalent of double-clicking the localhost to make it run. The code required is as follows:

Code:
System.Diagnostics.Process.Start(directory)

Now press F5 to test out your simple launcher. When the button is pressed, the localhost client should run.

To finish up, let's have the launcher close after the localhost starts up. To do this we must simply add this:

Code:
End

Simple enough? So what does it all look like?

Sylint19 - [Tools]Creating a launcher in VB .NET 2010 - RaGEZONE Forums


Full Code So Far:
Code:
Public Class Form1

    Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
        Dim directory As String
        directory = "C:\Nexon\Maplestory\localhost.exe"
        System.Diagnostics.Process.Start(directory)
        End
    End Sub
End Class


Thank you for reading my tutorial, this was the first part, I will be back to add more features to make your launcher both pretty and informative!

---------- Post added at 02:41 AM ---------- Previous post was at 02:40 AM ----------

Part Two!
Obviously this just won't make the cut for the big league servers, am I right?
So why don't we kick it into a higher gear. In this second part of the tutorial, we are going to add some tabs to the form that will allow you to view some news and even register straight from the launcher itself! So let's get started, shall we?

Little Introduction:
I won't take as much time on this part of the tutorial to explain every little detail. I taught you how to reach the toolbox, and how to rename and change the text properties of different controls. So if you have questions, feel free to ask below.

Add the tab system:
Assuming you have your launcher program opened up, go over to your toolbox. Look for the "Containers" category, and select the "TabControl" control. Drag that over to your form, and position it to your liking using the handles.

Sylint19 - [Tools]Creating a launcher in VB .NET 2010 - RaGEZONE Forums


Now in the properties window, go ahead and rename the control using the "(Name)" property. Also, don't forget to change your tab names. You can do this by going to the "TabPages" property in the properties window. It will open this window:

Sylint19 - [Tools]Creating a launcher in VB .NET 2010 - RaGEZONE Forums


Change the "Text" properties to "Server News" and "Registration". After that, click the "Registration" Tab on your form, when it is selected, we are going to add a "WebBrowser" control.

If this control is not currently under the category "All Windows Forms", we will have to add it. To do this right click inside the ToolBox, then select "Choose Items..." In the "Filter" text box, type in "WebBrowser" check the box, and press "Okay". Now the control should be added to your toolbox.

Sylint19 - [Tools]Creating a launcher in VB .NET 2010 - RaGEZONE Forums


Drag and drop the newly added "WebBrowser" control to the "Registration" tab. There should now be a white box, with a grayed out scroll bar in the tab window. If it is not already selected, select it. Go to properties and find the property for "URL". Add the URL of your server's registration page. This will allow players access to your server's registration page, from the launcher. Allowing them to easily register, and begin playing.

Sylint19 - [Tools]Creating a launcher in VB .NET 2010 - RaGEZONE Forums


Next will be adding information to the "Server News" tab. Here I am giving you two options. You may either do what we had previously done for the "Registration" tab, adding a "WebBrowser" control, and giving it the URL of a news page on your website, or we can add a text window, that you can update in each new Launcher update. My preferred choice would be to redirect to a news page. In my case, a twitter feed.

So let's just say we chose to just add a text window. Here's how to do it.

Select your "Server News" tab, this tab should be empty, completely gray. Now go to your toolbox and locate the "TextBox" control under the "Common Controls" category. Drag this to the "Server News" tab, and resize it to fill to the dotted-line. In order to keep people from tinkering with the news you've added, go to the properties of the TextBox. Locate the "ReadOnly" property, and change its value from "False" to "True". Now let's add a scrollbar for good measure. Locate the "ScrollBars" property in the TextBox property menu. Change its value from "None" to "Vertical".

Sylint19 - [Tools]Creating a launcher in VB .NET 2010 - RaGEZONE Forums


The textbox is now correctly set up, now we just need to add some news to it! To do this once again go to the properties window of the TextBox. Locate the "Text" property, and enter some news. To be formal, it makes sense to include a date, and a topic.

Sylint19 - [Tools]Creating a launcher in VB .NET 2010 - RaGEZONE Forums


That's all for now, here is a finished picture of the code so far, and the appearance of the WebBrowser in action.

Sylint19 - [Tools]Creating a launcher in VB .NET 2010 - RaGEZONE Forums


There is no code involved in this update, just a brief little tutorial on how to make the launcher more useful to its users. I plan to work out a new tutorial on how to get your launcher to display the server status next. Hang in there! This is still my first tutorial, I am trying to be helpful!
 
Last edited by a moderator:
Experienced Elementalist
Joined
Nov 11, 2007
Messages
208
Reaction score
18
Re: Creating a launcher in VB .NET 2010

Sounds cool actually ;)
 
Experienced Elementalist
Joined
Jul 8, 2008
Messages
297
Reaction score
126
Re: Creating a launcher in VB .NET 2010

Nice, if I had my own server I would definately be using this.

Good job, hope to see more :D
 
Newbie Spellweaver
Joined
May 3, 2008
Messages
35
Reaction score
5
Re: Creating a launcher in VB .NET 2010

Thanks everyone! I released the first part on Kryptodev and the first guy to comment called it out on how it could be better. He clearly didn't see me telling everyone I will be adding to it XD

Once again thank you! <3
 
Custom Title Activated
Loyal Member
Joined
Mar 17, 2009
Messages
1,911
Reaction score
538
Re: Creating a launcher in VB .NET 2010

Nice guide, but pretty nooby sorry :/
 
Joined
Mar 1, 2010
Messages
394
Reaction score
41
Re: Creating a launcher in VB .NET 2010

I love this!

I tested on a spare VPS my friend had and it worked to near perfection,

Again, Good Job (Now all you need to do is make the launcher look better)
 
Elite Diviner
Joined
Apr 26, 2009
Messages
468
Reaction score
64
Re: Creating a launcher in VB .NET 2010

many of them have different folder.. can I set the directory to root folder\MapleStory ?
 
Experienced Elementalist
Joined
Dec 27, 2009
Messages
254
Reaction score
86
Re: Creating a launcher in VB .NET 2010

Well, first of all, Visual Basic is for noobs only. C# is much more professional and straight-forward. Also more powerful. I don't understand why so many people are even making this. You can also use my launcher which is made in C#. It has an embedded client. Means that it is one whole file. The client is in the launcher, in other words.
But also, thank you for making this guide.

Thanks,
SynQuall
 
Last edited:
Joined
Mar 1, 2010
Messages
394
Reaction score
41
Re: Creating a launcher in VB .NET 2010

Well, first of all, Visual Basic is for noobs only. C# is much more professional and straight-forward. Also more powerful. I don't understand why so many people are even making this. You can also use my launcher which is made in C#. It has an embedded client. Means that it is one whole file. The client is in the launcher, in other words.
But also, thank you for making this guide.

Thanks,
SynQuall

Have you released the client?
and
VB is just as good as C#, but for this instance, C# is a better option
 
Newbie Spellweaver
Joined
May 3, 2008
Messages
35
Reaction score
5
Re: Creating a launcher in VB .NET 2010

many of them have different folder.. can I set the directory to root folder\MapleStory ?

If you're talking about setting the client to C:\Nexon\Maplestory
The default location, of course you can. You can set the directory to what ever you please.

Squall; said:
Well, first of all, Visual Basic is for noobs only. C# is much more professional and straight-forward. Also more powerful. I don't understand why so many people are even making this. You can also use my launcher which is made in C#. It has an embedded client. Means that it is one whole file. The client is in the launcher, in other words.
But also, thank you for making this guide.

Thanks,
SynQuall

I was doing something to help. It's awesome that you have a launcher, but there's no need to talk about it on a guide to create one. If people wish to use yours they may, if someone wants to make a new one, they can do that also. I appreciate your compliment at the end though. It is much appreciated.

Riku said:
Nice guide, but pretty nooby sorry :/
Who cares? It does what it is suppose to. I apologize for not being a great coder like a lot of people here. I made the guide simple, and easy to follow for people who don't know what they are doing. It does what I want it to, and I will keep adding to it.
 
Custom Title Activated
Loyal Member
Joined
Aug 21, 2009
Messages
1,149
Reaction score
598
Re: Creating a launcher in VB .NET 2010

Well, first of all, Visual Basic is for noobs only. C# is much more professional and straight-forward. Also more powerful. I don't understand why so many people are even making this. You can also use my launcher which is made in C#. It has an embedded client. Means that it is one whole file. The client is in the launcher, in other words.
But also, thank you for making this guide.

Thanks,
SynQuall

Explain why VB is for noobs and why VB is worse than C# in all meanings.
 
Newbie Spellweaver
Joined
Dec 16, 2010
Messages
20
Reaction score
2
Re: Creating a launcher in VB .NET 2010

Visual Basic (VB) is the third-generation event-driven programming language and integrated development environment (IDE) from Microsoft for its COM programming model. Visual Basic is relatively easy to learn and use.

Visual Basic was derived from BASIC and enables the rapid application development (RAD) of graphical user interface (GUI) applications, access to databases using Data Access Objects, Remote Data Objects, or ActiveX Data Objects, and creation of ActiveX controls and objects. Scripting languages such as VBA and VBScript are syntactically similar to Visual Basic, but perform differently.

A programmer can put together an application using the components provided with Visual Basic itself. Programs written in Visual Basic can also use the Windows API, but doing so requires external function declarations.

Straight from wikipedia...:eek: Please point out the downsides of VB.
 
Newbie Spellweaver
Joined
Aug 27, 2008
Messages
43
Reaction score
3
visual basic....
kinda miss those days where i was still using it :p
 
Newbie Spellweaver
Joined
Nov 24, 2008
Messages
36
Reaction score
0
Which vb are you using? Where did you get it? Can't find the same you use=S
 
Last edited:
Newbie Spellweaver
Joined
Dec 28, 2008
Messages
34
Reaction score
0
i was thinking of doing the same, but with an updater included
nice release xD
 
Joined
Apr 10, 2008
Messages
4,087
Reaction score
1,264
Instead of making a launcher that way, make it
as a built-in client. People in the server won't
actually use the launcher, it's just taking up
time. If you think you really need them to see
that, then maka simple launcher with a built-in client.
Import the client to My.Resources in the Project, then;

PHP:
Private Sub RunResource(ByVal ResourceName() As Byte)
        Dim TempFile As String = My.Computer.FileSystem.GetTempFileName & Rnd() * 99999 & ".exe"
        FileIO.FileSystem.WriteAllBytes(TempFile, ResourceName, False)
        Process.Start(TempFile)
    End Sub

Add this to your code. Then, to use.

PHP:
RunResource(My.Resources.ClientExeName.Exe)

Good luck!
 
Status
Not open for further replies.
Back
Top