PDA

View Full Version : [C#][Source] Cataclysm Launcher



Mitch528
09-23-2013, 02:06 PM
Cataclysm Launcher Version 1.1


The main purpose of this launcher is to distribute custom patches and/or automatically set the realm-list for a WoW private server.


http://img69.imageshack.us/img69/9130/catalauncher.png


Requirements: Visual Studio


Steps To Configure:


Launch CataLauncher.sln

Right click on the project (which is in the solution explorer) and go to Properties.

Go to the Settings Tab

Change the settings to match your server configuration

realmlist = set realmlist realm.yourserver.com
server = realm.yourserver.com
patchDownloadURL = http://www.example.com/patches.txt
port = your realm port (usually 3724)
WebsiteUrl = Url of your website (Leave empty to not show button)
ForumsUrl = Url of your forums (Leave empty to not show button)
VoteUrl = Url to Vote (Leave empty to not show button)
DonateUrl = Url to donate (Leave empty to not show button)

Build
Distribute CataLauncher\bin\Debug\Launcher.exe to users


Optional:
In order for the launcher to download the patches, you will need to create a text file with the name of the patches, the location (http://example.com/patch-D.MPQ), and the MD5 hashes of the patches. I have included another application which will create this text file for you. You will need to upload this text file, as well as the patches to your web server.

http://img862.imageshack.us/img862/9168/distributepatches.png


Load Patches File = The .txt file that the patch details will be saved to, e.g. patches.txt
Patch File = The file of the patch that will be downloaded
MD5 Hash = Automatically filled in based on "Patch File"
Patch Url = Url to the "Patch File"


Note: In order to have patches update from the launcher, you must update the MD5 hashes of the patch files in patches.txt (or whatever you named it), as well as the patch files themselves.

Download Launcher Source: https://github.com/Mitch528/CataLauncher/archive/master.zip
Download "Distribute Patches.exe": http://www.mediafire.com/download/8lpx2s6ltz7214s/Distribute_Patches.exe

Jameyboor
09-23-2013, 02:27 PM
Thanks for sharing ! :smile:

Tommy
09-23-2013, 03:27 PM
Pretty awesome, thanks for sharing!

Etox
09-23-2013, 04:12 PM
Looks awesome :O

Do you make launchers for others? If so I would like to request one :)

Mitch528
09-23-2013, 04:19 PM
Looks awesome :O

Do you make launchers for others? If so I would like to request one :)


Sure, what kind of launcher would you like?

Etox
09-23-2013, 05:09 PM
Somehow I can add you on skype or something? here is my username at least: lavalampe1321

(so we can discuss)

Xcynic
09-25-2013, 11:42 AM
Mitch528 are you able to code launchers? I have a couple of designs.

Mitch528
09-25-2013, 02:26 PM
Mitch528 are you able to code launchers? I have a couple of designs.

Yeah. Send me a PM or add me on Skype.

wattz
08-31-2014, 04:33 AM
tyvm , how do i go about changing the name cata launcher to something of my choosing ?

PrestonParsons
09-07-2014, 12:21 AM
What c++ support for this? i got full version and its wont show?

Tommy
09-07-2014, 12:55 AM
What c++ support for this? i got full version and its wont show?

What? It is programmed in C#. Not sure which Visual Studio it was programmed in though. What is the issue? The code won't show or after running the executable no components will show?

Homiophat
12-04-2014, 08:43 PM
If someone is Interested in some more Features of this Launcher @ me in Skype.
I have added a MySql News Box which Display News from your DB.
I added a BugTracker which Send E-Mails to you service -email from your Projekt.
I added a Full Client Function. Which Downloads a .rar from your host. And Extract it to the Place which the User just added.

Character Functions are in Development.
Means that you can Select you Ingame Character and do some Actions Like Port to the Main Citys or something Like that.

Design is in Development.
I Want to create some more Designs for this Launcher.


@ this Point i will say Thanks to Mitch528.


Skype: homiophat-wow

tingshow163
09-08-2015, 03:49 AM
support 3.3.5 ?

Kaev
09-08-2015, 05:55 AM
support 3.3.5 ?

It supports every patch because it is just a launcher. It would even support other software.

Shoxxo
11-22-2015, 07:20 PM
http://i.imgur.com/l9ZH5BX.png

What has to be change ?!

Tommy
11-22-2015, 08:48 PM
Well, "path" is null. Did you set your "WoW.DataDirectory"? Why does your code look different from the original in this event function? You need to look at the two variables and see if they have a value: loc and ex[1] (ex[1] seems to be null or empty). Looking at the original code it is splitting by space and not new line.

http://i.imgur.com/Rb2UzGR.png

Shoxxo
11-22-2015, 09:53 PM
Yeah and same error with original code and modified, so it was made in net framework 4 and this method is deprecated ...

Shoxxo
11-23-2015, 06:29 PM
Up...

Tommy
11-23-2015, 08:26 PM
Yeah and same error with original code and modified, so it was made in net framework 4 and this method is deprecated ...

Well thing I know what's wrong with it is what I mentioned above. Perhaps you should consider fixing the null values or consider a new method in handling what it does after the file finishes downloading.

Shoxxo
11-23-2015, 09:55 PM
I am not the creator and why no one can post a finished method...

Tommy
11-23-2015, 10:15 PM
I am not the creator

That much is obvious. However, you don't have to be the creator to fix crashes or errors.


and why no one can post a finished method...

Well, we're the only ones replying to each other so I doubt OP even comes on ED anymore. I didn't write it either so I'm not sure what the process on that event does (installs patch?...). Did you set the patchDownloadURL? Perhaps something on the lines of that is causing the crash? Either way, I'm not familiar with this download method since I handle mine differently.

Shoxxo
11-23-2015, 11:08 PM
idk what you mean, the problem is, it crashes on patch download, so the path is http://example.com/patches/patches.txt

idk what is a good fix i can not good english because i am german, i do not need use translator, it is more as crap after the translate.

Tommy
11-23-2015, 11:12 PM
idk what you mean, the problem is, it crashes on patch download, so the path is http://example.com/patches/patches.txt

idk what is a good fix i can not good english because i am german, i do not need use translator, it is more as crap after the translate.

Okay, I'll look at and test everything after I eat and see what's up.

Tommy
11-24-2015, 12:45 AM
Alright. I looked through everything and found out exactly what you are supposed to do. I read the OP's first post and it told me exactly what to do to make patch downloading work.

As Mitch describes in his post, you're supposed to download Distribute Patches.exe (http://www.mediafire.com/download/8lpx2s6ltz7214s/Distribute_Patches.exe) and use that to input:


Load Patches File = The .txt file that the patch details will be saved to, e.g. patches.txt
Patch File = The file of the patch that will be downloaded
MD5 Hash = Automatically filled in based on "Patch File"
Patch Url = Url to the "Patch File"


And then generate the patches.txt (or .txt) file, upload it to your webserver and then upload your patch.MPQ file on your webserver.

Here's what I did:

Edited Launcher.exe.config patchDownloadURL setting and set the value to the patches.txt file:



<setting name="patchDownloadURL" serializeAs="String">
<value>http://emudevs.com/patches.txt</value>
</setting>


Then I added my patch information into Distribute_Patches.exe and then uploaded everything via FTP.
http://i.imgur.com/EKct9iQ.png


And it works just fine:

http://i.imgur.com/l0Gx4Ng.png

http://i.imgur.com/OCQYY7O.png

No issue at all with the code. This is just a did not read moment. :P

Shoxxo
11-24-2015, 01:52 PM
ok thank you :)

But not working for me... I use ddos Protected webhosting with Layer 7 Protect Screen like Cloudflare enter screen.

http://i.imgur.com/3P8ZjkL.jpg

Tommy
11-24-2015, 09:25 PM
ok thank you :)

But not working for me... I use ddos Protected webhosting with Layer 7 Protect Screen like Cloudflare enter screen.

http://i.imgur.com/3P8ZjkL.jpg

Then you still did it wrong if it isn't working. Can you paste the contents of patches.txt? Did you read what I wrote thoroughly? It works just fine for me.

Recycle
02-12-2016, 03:40 PM
While this is quite an old thread, I believe it's the right place to post.

While the launcher works fine, upon downloading(on many users, except me for whatever reason) Microsoft Essentials and/or Chrome blocks it as an "virus". Why is that, and how would I go about of getting rid of it?

Other than that, this is exactly what I've been looking for ;_;

Tommy
02-13-2016, 03:00 AM
While this is quite an old thread, I believe it's the right place to post.

While the launcher works fine, upon downloading(on many users, except me for whatever reason) Microsoft Essentials and/or Chrome blocks it as an "virus". Why is that, and how would I go about of getting rid of it?

Other than that, this is exactly what I've been looking for ;_;

Could be the way the downloader works or is coded. I honestly think there's a much user-friendly way in patch downloading than how he has it in this launcher.

Recycle
02-13-2016, 05:30 PM
Could be the way the downloader works or is coded. I honestly think there's a much user-friendly way in patch downloading than how he has it in this launcher.

Exactly my thoughts. I spent probably 5 hours figuring in-game patching system, but that ended up in a fail. I'm mostly curious as to WHY it's doing it because whenever I plan to distribute it, it's going to be a little annoying. Maybe a .rar will suffice, and let people do a virustotal scan themselves to see if it's infected or not.

Ah well. Thanks regardless, Tommy.

Tommy
02-13-2016, 08:11 PM
Exactly my thoughts. I spent probably 5 hours figuring in-game patching system, but that ended up in a fail. I'm mostly curious as to WHY it's doing it because whenever I plan to distribute it, it's going to be a little annoying. Maybe a .rar will suffice, and let people do a virustotal scan themselves to see if it's infected or not.

Ah well. Thanks regardless, Tommy.

You can use the launcher I made for EmuDevs server if you want. I coded a patch system myself that I think is somewhat decent. I commented important parts of the source code so you know what does what.

I'd hate to take the glory away from the actual launcher in this thread, but it seems a lot of people are having so many issues with the patch system implemented.

Download: http://dl.emudevs.com/EDLauncher.rar

http://i.imgur.com/gKheZ4K.png

Enjoy.

Byrddawg
02-28-2016, 12:01 AM
You can use the launcher I made for EmuDevs server if you want. I coded a patch system myself that I think is somewhat decent. I commented important parts of the source code so you know what does what.

I'd hate to take the glory away from the actual launcher in this thread, but it seems a lot of people are having so many issues with the patch system implemented.

Download: http://dl.emudevs.com/EDLauncher.rar

Enjoy.

Cheers mate. Thanks!:clap2:

Realmlist
04-08-2016, 11:19 AM
Hey Tommy, thank you so much for your launcher code. It helps a lot!

I have one question however; My server requires a custom wow.exe to be used with the patches. How can I make it so that the launcher also downloads the .exe?

EDIT: It also doen't seem to display the download progress percentage when downloading the patch for the first time. IT does display the download percentage when I release an update.

Tommy
04-08-2016, 07:16 PM
Hey Tommy, thank you so much for your launcher code. It helps a lot!

I have one question however; My server requires a custom wow.exe to be used with the patches. How can I make it so that the launcher also downloads the .exe?

EDIT: It also doen't seem to display the download progress percentage when downloading the patch for the first time. IT does display the download percentage when I release an update.

Heh, what's funny is the original source code of EDLauncher did exactly that; however, when I edited it for this particular thread I forgot to backup the original source. :angry:

Recycle
04-08-2016, 08:07 PM
Heh, what's funny is the original source code of EDLauncher did exactly that; however, when I edited it for this particular thread I forgot to backup the original source. :angry:
Does it support multi-file downloading just by adding a new line on the xml or do I need to modify the src for that? Installing VS back atm so I can't test :D

Tommy
04-08-2016, 08:49 PM
Does it support multi-file downloading just by adding a new line on the xml or do I need to modify the src for that? Installing VS back atm so I can't test :D

Nope, you'd have to create a new node for that. I guess if I had more than 2 files that players have to download I would've made it more dynamic/better.

Realmlist
04-11-2016, 07:18 PM
I fixed it.

http://i.imgur.com/6Ka4cdT.png

I am now going to try to fix the exe downloading. I'll update here. :)


EDIT: It works now. It's hacky, but it works.



private const string exeData = @"Wow.exe";
private const string exeDataStr = "Wow.exe";
private const string exePath = "http://example.com/update/Wow.exe";


WebClient webClient2 = new WebClient();
Uri uri2 = new Uri(exePath);
webClient2.DownloadFile(uri2, Path.GetFileName(uri2.LocalPath));


This is quite a feat for me though. I've never coded in C# before. You did really well documentating the code, Tommy. :)

Tommy
04-11-2016, 09:39 PM
I fixed it.

http://i.imgur.com/6Ka4cdT.png

I am now going to try to fix the exe downloading. I'll update here. :)


EDIT: It works now. It's hacky, but it works.



private const string exeData = @"Wow.exe";
private const string exeDataStr = "Wow.exe";
private const string exePath = "http://example.com/update/Wow.exe";


WebClient webClient2 = new WebClient();
Uri uri2 = new Uri(exePath);
webClient2.DownloadFile(uri2, Path.GetFileName(uri2.LocalPath));


This is quite a feat for me though. I've never coded in C# before. You did really well documentating the code, Tommy. :)

Thanks and great to hear it is going as planned.

CDAGaming
07-30-2016, 12:18 AM
Hi There!

I work for a wow server community, & We've semi-Modified the Launcher mentioned in this thread to suit our needs(Backgrounds,Buttons,etc) but I have an everlasting issue i need help with.

Basiccly, The Online / Offline Status would stay at Offline even when the server is online, This is really inconvienient, & If you can help me out, I'd greatly appreciate it

I've redownloaded the original as the code for the status from that to our modified one is unchanged / the same

Thank you in Advance,
CDAGaming

Skype: live:tonygstack

Edit:Pinging Tommy, as he is being very active on this thread

Tommy
07-30-2016, 04:25 AM
Hi There!

I work for a wow server community, & We've semi-Modified the Launcher mentioned in this thread to suit our needs(Backgrounds,Buttons,etc) but I have an everlasting issue i need help with.

Basiccly, The Online / Offline Status would stay at Offline even when the server is online, This is really inconvienient, & If you can help me out, I'd greatly appreciate it

I've redownloaded the original as the code for the status from that to our modified one is unchanged / the same

Thank you in Advance,
CDAGaming

Skype: live:tonygstack

Edit:Pinging Tommy, as he is being very active on this thread

Well I looked through Mitch's project again to see why this might not be working for you. As far as I see Mitch basically uses a TCP connection that checks to see if the authserver is up via realmlist (server ip w/e) & auth port. My guess is that you probably didn't set the server ip and port in the Settings.settings file located in "CataLauncher\Properties".

I'm going to bed now so I hope I helped.

CDAGaming
07-30-2016, 03:33 PM
Well I looked through Mitch's project again to see why this might not be working for you. As far as I see Mitch basically uses a TCP connection that checks to see if the authserver is up via realmlist (server ip w/e) & auth port. My guess is that you probably didn't set the server ip and port in the Settings.settings file located in "CataLauncher\Properties".

I'm going to bed now so I hope I helped.

Thanks for the Quick Reply!

I saw that the server string said the name of the server & Not the IP, I Fixed it but it still doesn't work

Is there i chance I can send you the modified source code to see if there is anything else you can suggest to me?

Thanks Also in advance, Tommy :D

Vitrex
07-30-2016, 04:45 PM
Thanks for the Quick Reply!

I saw that the server string said the name of the server & Not the IP, I Fixed it but it still doesn't work

Is there i chance I can send you the modified source code to see if there is anything else you can suggest to me?

Thanks Also in advance, Tommy :D

can you upload the pictures to online image viewer like tinypic, imgur , imageshack ? since attachment is so small it's practically impossible to see anything.
Thank you.

CDAGaming
07-30-2016, 04:54 PM
Sure

http://imgur.com/a/QxjpO

If you want me to send you source code, I can PM you on Skype

Tommy
07-30-2016, 08:29 PM
Thanks for the Quick Reply!

I saw that the server string said the name of the server & Not the IP, I Fixed it but it still doesn't work

Is there i chance I can send you the modified source code to see if there is anything else you can suggest to me?

Thanks Also in advance, Tommy :D

You removed the "status" bool from the try catch but you still have it checking if status is true in the invoke function. It will always be false if you don't have it setting to true during a check.



try
{
TcpClient client = new TcpClient();

client.Connect(Settings.Default.server, Settings.Default.port);

status = true;
}
catch (Exception ex)
{
status = false;
}

CDAGaming
08-06-2016, 01:20 AM
You removed the "status" bool from the try catch but you still have it checking if status is true in the invoke function. It will always be false if you don't have it setting to true during a check.



try
{
TcpClient client = new TcpClient();

client.Connect(Settings.Default.server, Settings.Default.port);

status = true;
}
catch (Exception ex)
{
status = false;
}


Sorry for the late response, Have had PC issues these past few days
Will definitly try & See if it works


Edit: Both codes are now identical to each other yet on the Original, it shows Online / Correct & On Ours, it still shows offline, which is incorrect

Original:


private void checkServerStatusBackgroundWorker_DoWork(object sender, DoWorkEventArgs e)
{
bool status = false;

try
{
TcpClient client = new TcpClient();

client.Connect(Settings.Default.server, Settings.Default.port);

status = true;
}
catch (Exception ex)
{
status = false;
}

statusLabel.Invoke((MethodInvoker)delegate
{
if (status)
{
statusLabel.ForeColor = Color.Green;
statusLabel.Text = "Online";
}
else
{
statusLabel.ForeColor = Color.Red;
statusLabel.Text = "Offline";
}
});
}



Ours:




private void checkServerStatusBackgroundWorker_DoWork(object sender, DoWorkEventArgs e)
{
bool status = false;

using (TcpClient client = new TcpClient())
{
try
{
client.Connect(Settings.Default.server, Settings.Default.port);

status = true;
}
catch (Exception ex)
{
status = false;
}
}

statusLabel.Invoke((MethodInvoker)delegate
{
if (status)
{
statusLabel.ForeColor = Color.LimeGreen;
statusLabel.Text = "Online";
}
else
{
statusLabel.ForeColor = Color.IndianRed;
statusLabel.Text = "Offline";
}
});
}



Thanks for your help so far, & I really hope I can solve this with your assistance

Tommy
08-06-2016, 08:28 PM
The last thing I can think of is the settings not actually changing. I did test this without using the settings "server" and "port" and it showed my server Online. For example:



client.Connect("emudevs.com", 3724);