How to Make a Game Launcher and an Auto Updater With WPF | C# Game Launcher Tutorial

  Рет қаралды 106,914

Tom Weiland

Tom Weiland

4 жыл бұрын

In this launcher tutorial you'll learn how to make a game launcher and an auto updater for your Unity (or other) games.
Check out my devlogs: • Multiplayer Pirate Gam...
⎯⎯⎯⎯⎯⎯
Source code: github.com/tom-weiland/csharp...
Google Drive link converter (updated because the original one doesn't work anymore): www.wonderplugin.com/online-t...
Discord server: tomweiland.net/discord
Support me on GitHub Sponsors: github.com/sponsors/tom-weiland
Support me on Ko-fi: tomweiland.net/kofi
GitHub: tomweiland.net/github
Website: tomweiland.net/
⎯⎯⎯⎯⎯⎯
In this game launcher tutorial, we set up a launcher that can also automatically install updates for players. When I created a launcher and auto updater for my Unity multiplayer game in one of my devlogs, I got a lot of comments asking for a tutorial on how to do this, so here it is!
By the end of this tutorial, you'll know how to make a launcher and game updater for your Unity games. You can also use it to automatically update games built with other engines-even regular applications will work!
#UnityTutorial #GameLauncher #Unity3D #AutoUpdater #GameDev

Пікірлер: 870
@tomweiland
@tomweiland 4 жыл бұрын
Here's the source code: github.com/tom-weiland/csharp-game-launcher *If you've run into issues with the zip file not extracting properly, there's a few things you can do:* 1. Make sure you zipped your files using the default Windows method, _not_ with a third party application such as WinRAR, WinZip, 7-zip, etc. 2. Try using a different file storage provider, such as OneDrive or Dropbox. 3. Host the files on your computer and just use the file path as the download link. Obviously this won't work if the launcher isn't running on your computer, but it'll do the trick for testing/development purposes. You'll have to find a _proper_ file hosting solution at some point anyways, as Google Drive, OneDrive, Dropbox, etc. all have limits on how frequently a file can be downloaded, so all of those are really only usable during development. 4. The last (and most involved potential solution) is to stick with Google Drive and to try and fix the error, which may be caused by Google Drive sometimes showing a confirmation page when downloading files. This prevents the zip file from downloading properly, which in turn means that it can't be unzipped. Unfortunately I never ran into this problem myself when building my launcher, so I wasn't able to account for it in this video, but here's a StackOverflow answer that mentions a GitHub repo which you should be able to use to circumvent the popup: stackoverflow.com/a/44402826 From my research it sounds like the confirmation only pops up if the file is larger than a certain size, although I'm not sure what that threshold is. The StackOverflow answer claims that it's 50mb (my zipped folder was 20mb), but others have apparently gotten the popup with files under 30mb. Edit: the original Drive link converter doesn't seem to work anymore, so here's an alternative: www.wonderplugin.com/online-tools/google-drive-direct-link-generator/
@jmgb2645
@jmgb2645 4 жыл бұрын
Thank you for the fix! Was running into the issue. How would I adjust the code to fix the 50mb issue? Great tutorial as always.
@tomweiland
@tomweiland 4 жыл бұрын
I haven't used the solution in that answer, but from looking through the code it seems that you just need to call the DownloadGoogleDriveFileFromURLToPath method. Alternatively you can use other storage solutions-according to some members on Discord, using OneDrive avoids the popup problem. You probably won't want to host your files on Drive anyways once you publicly release your game.
@jmgb2645
@jmgb2645 4 жыл бұрын
@@tomweiland Just tested it and OneDrive works. Thank you, it's much more simple!
@tomweiland
@tomweiland 4 жыл бұрын
@@jmgb2645 great :)
@toyotacorolla-2001
@toyotacorolla-2001 4 жыл бұрын
@@jmgb2645 how do you do it?
@tomweiland
@tomweiland 4 жыл бұрын
What do you guys think of the new end screen? I spent way too much time on it, but I'm still not sure if I actually like it 🤔 Also, at 5:10 I added a popup saying "this should be false!" even though it should say "this should be true!"-I guess that's what happens when you've been editing for too long :P
@naturalevo180
@naturalevo180 4 жыл бұрын
its good
@tomweiland
@tomweiland 4 жыл бұрын
Thanks guys :)
@tomweiland
@tomweiland 4 жыл бұрын
@@stefffi2003 thank :)
@tomweiland
@tomweiland 4 жыл бұрын
@SwiftzEnd -I actually just shared the project on Discord because someone else asked for it-it doesn't seem like it's worth putting on GitHub, but you can find it in the resources channel :)- Edit: I ended up making a GitHub repo after all :)
@ChillyPixel
@ChillyPixel Ай бұрын
@@tomweiland no steffi, no money?
@eraykaya2628
@eraykaya2628 4 жыл бұрын
Wow! These series are just going better and better... I first watched you in networking series and you made this topic very easy to understand for me. You are doing excellent job. Please keep it up!
@tomweiland
@tomweiland 4 жыл бұрын
Thank you, I definitely will!
@xzippyzachx
@xzippyzachx 4 жыл бұрын
I think I'm gonna try this out! It will be very useful when developing a game because it is updating frequently. This will make it much easier for testers to get the constant new updates. Also nice end screen. You just need to fit in the subscribe card somewhere...
@tomweiland
@tomweiland 4 жыл бұрын
Yeah, it makes distributing builds to beta testers way less of a hassle! About the subscribe card, I'm not sure where to put it as I don't really want to blot out the footage, but there's no other place it can go...
@andrews4208
@andrews4208 2 жыл бұрын
yo Zippy, i love your devlogs man
@joelfrom08
@joelfrom08 3 жыл бұрын
My game is getting close to being finished and I have been searching a lot on how to make a launcher. Thank you FBI and other trackers for putting this into my recommended!
@tomweiland
@tomweiland 3 жыл бұрын
:P Just be aware that this only works on Windows. The logic/process should be similar for other platforms, but WPF is Windows-only as far as I know.
@ayoitsjack7319
@ayoitsjack7319 4 жыл бұрын
Just wanted to say Tom loving these videos. They are super informative and a massive help. Thank you
@tomweiland
@tomweiland 4 жыл бұрын
I'm glad you liked it :)
@RobLang
@RobLang 4 жыл бұрын
Tutorial is excellent, as always! I'd add more specific error trapping to give the user more info on how to solve problems. Also I would write an Equals/Hash pair for the version number struct. Loving the tutorials, tho, they're great! Like the new end screen, forgotten that I'd appear on it.
@tomweiland
@tomweiland 4 жыл бұрын
I mean the errors print out the exception itself, so you do get the actual error message. I didn't want to go through and consider every possible exception that could arise and then write a more "understandable" summary for all of them-that'd take forever :P What do you mean "hash pair for the version number struct"? Edit: do you mean taking the version string and hashing it so that instead of the IsDifferentThan method you can just check if the two hashes match? That'd definitely work, but it's a bit more effort to set up and just does the same thing 🤔
@DJLKM1
@DJLKM1 4 жыл бұрын
Awesome tutorial, clear, easily followed and at the same time in depth.
@tomweiland
@tomweiland 4 жыл бұрын
Thank you!
@heinzketchup2542
@heinzketchup2542 4 жыл бұрын
This is just what i needed for my dev plan for the summer.
@tomweiland
@tomweiland 4 жыл бұрын
Awesome :)
@smokedjosh6251
@smokedjosh6251 3 жыл бұрын
A fortnite dev?
@thepyro7845
@thepyro7845 2 жыл бұрын
One year later, how did the plan go?
@Pauli1505
@Pauli1505 Жыл бұрын
you just ran into us with winter
@scart3redup304
@scart3redup304 4 жыл бұрын
Thanks! Really the only straight on turorial I could find! Appreciate it man! 👌
@tomweiland
@tomweiland 4 жыл бұрын
I'm glad you liked it :)
@VIKTOR69
@VIKTOR69 4 жыл бұрын
Omg thanks! 🤩 Thats exactly what i need it! Your tutorials are the best! 👌
@tomweiland
@tomweiland 4 жыл бұрын
Thank you, I'm glad you like them :D
@phoenixtheceikraill
@phoenixtheceikraill 2 жыл бұрын
Thanks my guy! I had no issues on my end, I even managed to set a custom user agent string too. The game files are hosted on my own server so there was no issue with it. Thanks again!
@tomweiland
@tomweiland 2 жыл бұрын
Glad it worked!
@ImInfenix
@ImInfenix 4 жыл бұрын
Thanks for this awesome tutorial, your channel is precious you make tutorial about subjects I personally didn't find any tutorial appart here
@tomweiland
@tomweiland 4 жыл бұрын
Thanks, that means a lot :D
@mohitsethi99
@mohitsethi99 4 жыл бұрын
Really cool, needed this badly! Thanks a lot. Became a fan of yours.
@tomweiland
@tomweiland 4 жыл бұрын
Thanks, that means a lot :D
@457Deniz457
@457Deniz457 4 жыл бұрын
After 5 Secs I thought: I LOVE YOU ! 😆 Thanks rly rly nice, usefull AND awesome ! :)
@tomweiland
@tomweiland 4 жыл бұрын
I'm glad you liked it!
@jeanribeiro651
@jeanribeiro651 4 жыл бұрын
Perfect tutorial.. the first that I really learned about how to create an mmo.. Very nice Tom! Brazilian here 😁
@tomweiland
@tomweiland 4 жыл бұрын
Thanks, I'm glad you liked it :)
@jeanribeiro651
@jeanribeiro651 4 жыл бұрын
I'm working on a Launcher that works with versions of files "like git" and their hashes, thus avoiding modifications of "cheaters" but the problem is with large files
@IlIlIlIlIIIIIllll
@IlIlIlIlIIIIIllll 3 жыл бұрын
dude you are so underrated it is insane
@tomweiland
@tomweiland 3 жыл бұрын
I appreciate the kind words 😅
@JeloOW
@JeloOW 4 жыл бұрын
i was looking for a game launcher tutorial for a while lol ty
@tomweiland
@tomweiland 4 жыл бұрын
Glad I could help :)
@DamageSoftware
@DamageSoftware Жыл бұрын
Amazing video. I bookmarked it and will get back to it when I reach the point of implementing an launcher.
@tomweiland
@tomweiland Жыл бұрын
👍
@phantomslayer9714
@phantomslayer9714 Жыл бұрын
Hi, love the content, you literally the only person I’ve seen on KZfaq who made a tutorial like this. Keep up the great work !!😎Also out of curiosity, how would we create a settings menu , with for example the ability to change languages , also how would we make a auto update for the launcher?
@tomweiland
@tomweiland Жыл бұрын
An auto updater for the launcher would pretty much just be the same thing as this launcher, but downloading different files and stuff. For a settings menu you'd add an extra tab or a button somewhere that enables different UI elements when clicked. There's nothing particularly complex about it, so there isn't really much else to say about it.
@phantomslayer9714
@phantomslayer9714 Жыл бұрын
@@tomweiland thank you so much!
@lucidusdev7259
@lucidusdev7259 3 жыл бұрын
I remember looking for something like this in 2015 and 16 when I wasn't experienced in c# at all,thanks for sharing
@tomweiland
@tomweiland 3 жыл бұрын
Well I hope you like(d) it :)
@lucidusdev7259
@lucidusdev7259 3 жыл бұрын
@@tomweiland Sorry but i got an error and i'm not sure how to fix it "Errorfinishing downloading: System.IO.InvalidDataException: End of Central Directory record could not be found. at System.IO.Compression.ZipArchive.ReadEndOfCentr aIDirectory0 at System.IO.Compression.ZipArchive.Init(Stream stream, ZipArchtveMode mode. Boolean leaveOpen) at System.IO.Compression.ZipArchive..ctor(Stream stream, ZipArchiveMode mode, Boolean leaveOpen, Encoding entryNameEncoding) at System.IO.Compression.ZipFile.OpenjString archiveFileNarne, ZipArchtveMode mode, Encoding entryNameEncoding) at System.IC).Compression.ZipFile.ExtractToDirecto ry(String sourceArchiveFileName. String destinationDirectoryName. Encoding entryNameEncoding, Boolean overwriteFiles) at System.IO.Compression.ZipFile.ExtractToDiredory (String sourceArchiveFileNamc, String destinationDirectoryName, Boolean overwriteFiles) at LucidusLauncherV2.MainWindow.DownloadGameComple tedCallback(O eject sender, AsyncCompletedEventArgs e) in D:\LucidusLauncher\LucidusLauncherV2\LucidusLau ncherV2\MainWind ow.xaml.cs:line 129 "
@tomweiland
@tomweiland 3 жыл бұрын
Check the pinned comment on this video, that error looks like it might be caused by what I address there.
@nichoas3495
@nichoas3495 4 жыл бұрын
This is incredible, I will definitely use this. Is it possible you could make another video expanding on the hash comparison you talked about at the end to speed up downloads? If not, it’s totally fine, amazing video!
@tomweiland
@tomweiland 4 жыл бұрын
Thank you :) I'm not sure if I'll cover the hashing part since that's quite a bit more advanced, I haven't _really_ done it myself (I've played around with it a bit), and it won't work with Google Drive. That means I'd need to find another place to host the files, and it presents a roadblock for others who want to follow the tutorial but can't host their files anywhere.
@nichoas3495
@nichoas3495 4 жыл бұрын
Tom Weiland alright, that’s totally alright man! Looking forward to your next devlog : )
@tomweiland
@tomweiland 4 жыл бұрын
@@nichoas3495 awesome, it's nice to know people enjoy the devlogs!
@kelafac6261
@kelafac6261 2 жыл бұрын
@@tomweiland Hi, sorry for my English, I use a translator (I'm from Russia) I really liked the launcher, I made my own and everything works cool, but I would really like to see how a hash comparison can be attached to this code, can you help with this please? make a video or help if possible
@dylanr0662
@dylanr0662 2 жыл бұрын
For anyone having the error on line 129 with google drive that pops up, upload the files to firebase storage and get the access token (The direct download link). Firebase is free to use and it fixed this problem for me. Great Video btw, helped a lot.
@tomweiland
@tomweiland 2 жыл бұрын
OneDrive and Dropbox are potential alternatives as well.
@HaruChanZ64D
@HaruChanZ64D 3 ай бұрын
Hey man! I also use Firebase but have you found a way to auto-refresh the token? Because if I incrementally update my game. I had to update the URLs in the launcher's code.
@LinkinJuan23
@LinkinJuan23 3 жыл бұрын
You are awesome! I enjoy your videos so much! Im not a kind of people that comments videos, but you are the exception. PS: Sorry for my bad english (?)
@tomweiland
@tomweiland 3 жыл бұрын
Thank you, that means a lot to hear :D
@LanPodder
@LanPodder 4 жыл бұрын
This is actually a neat tutorial
@tomweiland
@tomweiland 4 жыл бұрын
Thank you :)
@J_E_N_T
@J_E_N_T 3 жыл бұрын
Brilliant video, thank you!!
@tomweiland
@tomweiland 3 жыл бұрын
I'm glad you liked it!
@Doesky
@Doesky 4 жыл бұрын
ty so much! you make awesome tutorials 😁
@tomweiland
@tomweiland 4 жыл бұрын
I'm glad you like them :D
@antonvrigborn6666
@antonvrigborn6666 2 жыл бұрын
A really great tutorial, good job
@tomweiland
@tomweiland 2 жыл бұрын
Thanks, glad it was helpful :)
@frankzander5946
@frankzander5946 3 жыл бұрын
Great vid ! Many thanks - love it !
@tomweiland
@tomweiland 3 жыл бұрын
Glad you liked it!
@sypdev
@sypdev 4 жыл бұрын
This is super useful, thanks!
@tomweiland
@tomweiland 4 жыл бұрын
I'm glad you think so!
@XordXildo
@XordXildo 2 жыл бұрын
THIS SAVED ME THANK YOU
@tomweiland
@tomweiland 2 жыл бұрын
Glad I could help :)
@SquidyGuitar
@SquidyGuitar 3 жыл бұрын
This work perfectly Thank you so much :)
@tomweiland
@tomweiland 3 жыл бұрын
I'm glad it's working!
@beaujanssen6243
@beaujanssen6243 4 жыл бұрын
This is so cool! THANK U :D
@tomweiland
@tomweiland 4 жыл бұрын
Glad you like it :)
@benrex7775
@benrex7775 3 жыл бұрын
You are very quick at programming.
@tomweiland
@tomweiland 3 жыл бұрын
The footage is a little bit sped up, so this isn't my "organic" typing speed 😅
@benrex7775
@benrex7775 3 жыл бұрын
@@tomweiland I watch those videos speed up anyways. Because of that I didn't mean that. You didn't make any breaks and just typed and typed. I have to make thinking and researching breaks. And I also make distraction breaks. Actually I make a lot of distraction breaks.
@BogdanAndreiRO
@BogdanAndreiRO 3 жыл бұрын
This video helped me with the zip download and extraction, thank you!
@tomweiland
@tomweiland 3 жыл бұрын
Great! Glad I could help :)
@KingDara_
@KingDara_ 2 жыл бұрын
Thank you! This help me really hard !
@tomweiland
@tomweiland 2 жыл бұрын
Glad to hear it :)
@davilkusgames812
@davilkusgames812 2 жыл бұрын
Thank you very much for this lesson!
@tomweiland
@tomweiland 2 жыл бұрын
You're welcome :)
@generalis2095
@generalis2095 3 жыл бұрын
Great job! Thanks!
@tomweiland
@tomweiland 3 жыл бұрын
Glad you liked it :)
@didi-mg2yk
@didi-mg2yk 3 жыл бұрын
Thanks! This is really helpful~
@tomweiland
@tomweiland 3 жыл бұрын
Glad to hear it :)
@DanielLochner
@DanielLochner 4 жыл бұрын
Genius Tom! 😄
@tomweiland
@tomweiland 4 жыл бұрын
Thank you :D
@philberex
@philberex 8 ай бұрын
Thank you for this tutorial. 🙌
@tomweiland
@tomweiland 8 ай бұрын
You're welcome :)
@MasterofFire-sc3yn
@MasterofFire-sc3yn 4 жыл бұрын
THIS IS INSANELY GOOD.
@tomweiland
@tomweiland 4 жыл бұрын
Thanks :D
@dmrdev9934
@dmrdev9934 4 жыл бұрын
Dude you are real hero :)
@tomweiland
@tomweiland 4 жыл бұрын
Thanks :D
@ariskim897
@ariskim897 3 жыл бұрын
Thank for sharing the knowledge!
@tomweiland
@tomweiland 3 жыл бұрын
Glad it was helpful :)
@ariskim897
@ariskim897 3 жыл бұрын
@@tomweiland Just wondering. Is there anyway to pass parameter to game from the launcher?
@ariskim897
@ariskim897 3 жыл бұрын
Found what the answer to my question. Good video.
@MistycznyArbuz2
@MistycznyArbuz2 3 жыл бұрын
Fantastic ! Thanks for source code :D
@tomweiland
@tomweiland 3 жыл бұрын
You're welcome :)
@sullymlg9785
@sullymlg9785 2 жыл бұрын
Only at 6:03 but I'm really loving the tutorial - Thank you!
@tomweiland
@tomweiland 2 жыл бұрын
👍
@Spamap
@Spamap 4 жыл бұрын
Amazing tutorial, very helpful! Anyone else try to type in the direct download link to try and get the game lmao
@tomweiland
@tomweiland 4 жыл бұрын
Thanks :) I'm sure you're not the only one. If you had tried it a few days ago you might have been successful-I found out that files are still accessible by link after they've been moved to the trash, so the game was technically available until I permanently deleted them 😅
@rockydonet
@rockydonet 3 жыл бұрын
thank you so much Sir!
@tomweiland
@tomweiland 3 жыл бұрын
You're welcome :)
@antalervin19-
@antalervin19- Жыл бұрын
Thanks Man You saved Me!
@tomweiland
@tomweiland Жыл бұрын
You're welcome 😅
@scottgamedev8542
@scottgamedev8542 2 жыл бұрын
Thank you for this great video. Im currently modifying the code to support multiple games and it seems to be coming along. If this video wasn't here then I would probably have not bothered with an launcher.
@tomweiland
@tomweiland 2 жыл бұрын
Glad it was helpful!
@cloudchen0831
@cloudchen0831 2 ай бұрын
You are a hero.
@tomweiland
@tomweiland 16 күн бұрын
😅
@AphixDev
@AphixDev 3 жыл бұрын
Awesome. 🤩
@tomweiland
@tomweiland 3 жыл бұрын
Glad you liked it!
@CueVoid
@CueVoid 3 жыл бұрын
Thanks it helped me a lot
@tomweiland
@tomweiland 3 жыл бұрын
Glad to hear it :)
@CueVoid
@CueVoid 3 жыл бұрын
@@tomweiland is devlog #45 coming
@tomweiland
@tomweiland 3 жыл бұрын
Not quite, but there is a new video coming as soon as I finish editing it!
@xyz5454
@xyz5454 3 жыл бұрын
thanks for your help
@tomweiland
@tomweiland 3 жыл бұрын
I'm glad you found it helpful :)
@bluegreen15
@bluegreen15 Жыл бұрын
Ehrenmann, wirklicher Ehrenmann
@tomweiland
@tomweiland Жыл бұрын
😅
@gokuakku9833
@gokuakku9833 2 жыл бұрын
sir u are really great :-)
@tomweiland
@tomweiland 2 жыл бұрын
😅
@delautrer2480
@delautrer2480 Жыл бұрын
Hi! Very nice video! Can you show, how you would implements an slider showing the current progress? And maybe some stats, like mbit/s or a "time left"?
@tomweiland
@tomweiland Жыл бұрын
You can use this to get the download progress, although I don't think it works when downloading files from Google Drive: docs.microsoft.com/en-us/dotnet/api/system.net.webclient.downloadprogresschanged
@frankzander5946
@frankzander5946 3 жыл бұрын
To ease updating literals I have come to use string constants that I define at the start of the code and I name them close to their content. That way updating the stings takes place in one spot and the compiler can spot any typos while coding instead of me having to find them during testing.... just a thought ;-)
@tomweiland
@tomweiland 3 жыл бұрын
That sounds like a smart thing to do :P
@RugbugRedfern
@RugbugRedfern 4 жыл бұрын
Would this also work to retrieve the game files from a github repository? Or do I need to use a service that can host a .zip file like Google Drive?
@tomweiland
@tomweiland 4 жыл бұрын
There's probably a way of getting it to work with GitHub. You'd need to write some code to generate the download links though-it looks like they need to be in this format: raw.githubusercontent.com/user-name/repo-name/branch-name/rest/of/file/path.extension
@miracle__worker
@miracle__worker 3 жыл бұрын
Hello, thanks a lot for your video. I have a question: what will happen with my saves after update?
@tomweiland
@tomweiland 3 жыл бұрын
If you're talking about something like world saves, that depends on where you're storing them. You probably don't want to be storing them within the build folder, as that _will_ cause them to be overwritten with every update.
@mfortn
@mfortn 3 жыл бұрын
Thank you for that explanation ♥. But explain how to add more games in launcher 🙃👍🏻.
@tomweiland
@tomweiland 3 жыл бұрын
It's literally the same code-you'll just need to specify which game should be downloaded/updated/launched.
@malphiem
@malphiem 3 жыл бұрын
Thaaanks alot for this tutorial , it was easy to understand even tho im not familiar with the programming language :D. I was able to finish the launcher/patcher :D , btw is there a way that i can delete the file from local copy if it was not included in zip file ?
@tomweiland
@tomweiland 3 жыл бұрын
Which file is it you want to delete? If I remember correctly you can use File.Delete() and pass it the path & name of the file you want deleted.
@malphiem
@malphiem 3 жыл бұрын
@@tomweiland i forgot whats this problem about , its all working now haha , thaanks for this greate tutorial i was able to make my very own game luncher for the first time ,, i came from java to c# lol
@A1_Plant
@A1_Plant Жыл бұрын
@@malphiem sameeeeeeeeeeeeeeeeeeeee
@EmuTheEmo
@EmuTheEmo 3 жыл бұрын
This might be a stupid question but is there a way to update the launcher once it's released? Say if I wanted to adjust the launcher to have an option for a new game(kinda like steam) is it possible to have it update or will people have to redownload it
@tomweiland
@tomweiland 3 жыл бұрын
You'll need to make a second updater application, as programs can't really modify their own files while they're running.
@makkapakkka
@makkapakkka 3 жыл бұрын
Great video, Question, from 11:00 What do you mean by hashes containing these folders? I'm trying to make the launcher not download every file with each minor update.
@tomweiland
@tomweiland 3 жыл бұрын
You generate a hash for each file. If a file changes, it will produce a different hash, allowing you to easily figure out which files have changed (by comparing the hashes).
@makkapakkka
@makkapakkka 3 жыл бұрын
@@tomweiland thanks for the swift response, what is a hash? And how would you go about coding that in?
@lagosta
@lagosta 4 жыл бұрын
Are you an life savior? Because you saved mine
@tomweiland
@tomweiland 4 жыл бұрын
😅
@arknet4973
@arknet4973 3 жыл бұрын
Good time of day. Ned to connect the extracting process to the progress bar, Found a lot info. Basically I need to compare the extracted size and need to exctract size. How can I get the the archive total size ( size which will be after extracting)? I right clicked on the zip and there is the "Total Size" how can I get it?
@tomweiland
@tomweiland 3 жыл бұрын
If you use the WebClient's DownloadProgressChanged event it provides you with the progress, however this doesn't work if you host on Google Drive as Drive doesn't send the total file size across at the start or something: docs.microsoft.com/en-us/dotnet/api/system.net.webclient.downloadprogresschanged?view=netcore-3.1
@GamingWizardYT
@GamingWizardYT 3 жыл бұрын
Hello, I had commented earlier and I’m not quite sure if you remember you but you replied back to my questions saying that you didn’t understand what I meant by downloading it. I basically mean when you finish building “the first version” of your game and convert it to exe file. So is after I do that when I start the tutorial? Is is that an unnecessary step? Hopefully this provides more clarification
@tomweiland
@tomweiland 3 жыл бұрын
You can start this tutorial whenever you like. None of the code we write will be part of your project, but in order to test the launcher you'll need some kind of exe file-that can be your unfinished game or something entirely different. In theory however, you could build the launcher before even creating your game project as there's no particular order you need to do things in.
@GamingWizardYT
@GamingWizardYT 3 жыл бұрын
Tom Weiland thank you! And yes a did double repost it was accident and I’ll remove it lol
@tux_the_astronaut
@tux_the_astronaut 4 жыл бұрын
If your gonna make a launcher for multiple platforms you will need to use something like Electron or QT creator
@tomweiland
@tomweiland 4 жыл бұрын
Yeah, this is mainly meant to just show people the basics.
@RugbugRedfern
@RugbugRedfern 4 жыл бұрын
I think this might be big! There are virtually no game launcher tutorials for Unity.
@tomweiland
@tomweiland 4 жыл бұрын
True-there's really only one other tutorial, which (if I remember correctly) doesn't even cover downloading/updating the game files, and it's several years old. On the other hand, I'm not sure how many people are actually searching for something like this in the age of Steam, so I guess only time will tell :P
@RugbugRedfern
@RugbugRedfern 4 жыл бұрын
@@tomweiland I've searched for this many times before, but was met with dead forum discussions and unanswered unity answers posts. I'm glad there's finally a decent tutorial on the subject!
@CapCreeperGR_Main
@CapCreeperGR_Main 4 жыл бұрын
There are but this is the best one
@VIKTOR69
@VIKTOR69 4 жыл бұрын
@@tomweiland Well even some Steam games have their own launchers for updates... :D
@tomweiland
@tomweiland 4 жыл бұрын
@@CapCreeperGR_Main thanks :P
@GHOST-dg5tk
@GHOST-dg5tk 4 жыл бұрын
you could also use downloadstring and set that in a variable and then use that with downloadfile
@tomweiland
@tomweiland 4 жыл бұрын
Which part exactly are you referring to? Do you mean instead of using DownloadFileAsync to download the Build folder? You probably don't want to do that-having your application become unresponsive for any amount of time isn't good, and downloads can take really long on slow internet speeds, even for small games.
@GHOST-dg5tk
@GHOST-dg5tk 4 жыл бұрын
@Tom Weiland you could set a string to a pastebin paste by using download string and then use downloadfile to download that string (put the download link in the pastebin paste) so you dont have to use google drive, you could generate a new download link and put it in the pastebin paste
@NY-wh4gs
@NY-wh4gs 3 жыл бұрын
hi :D , thanks to perfect tutorial..!! I have one question about this tutorial. Can this floating object reflect the directional flow velocity(or current) in the marine environment? Where can I check if possible?
@tomweiland
@tomweiland 3 жыл бұрын
Did you comment on the wrong video because this sounds like a question related to my water physics tutorial... That being said, I'm not sure what you mean by directional flow-if you're talking about currents or something you'd need to define those somehow before you can access them and use them to move objects in a certain way.
@watercat1248
@watercat1248 3 жыл бұрын
auto update that sound amazing one question this system works with the offline games as well ?
@tomweiland
@tomweiland 3 жыл бұрын
Your game doesn't need to be multiplayer for this to work, if that's what you're asking, but without an internet connection no updates will be able to happen.
@watercat1248
@watercat1248 3 жыл бұрын
@@tomweiland yes i know that if saman dont have internet connection is the update is not happen is obvious if saman dont have indernet the update is not happen
@samuelgirmagirma4019
@samuelgirmagirma4019 3 жыл бұрын
LOve For tut they are so fun
@tomweiland
@tomweiland 3 жыл бұрын
Glad you like them :)
@haydeghah5527
@haydeghah5527 4 жыл бұрын
Nice
@tomweiland
@tomweiland 4 жыл бұрын
The video has only been out for 3 minutes, how do you know it's nice :P
@haydeghah5527
@haydeghah5527 4 жыл бұрын
Tom Weiland I’m a simple man. I see Tom I know it is gonna be nice
@tomweiland
@tomweiland 4 жыл бұрын
Haha thanks!
@user-ve9xq7le5y
@user-ve9xq7le5y 3 жыл бұрын
is this part 1 of this tutorial? Seems like it doesn't start at the beginning. I'd like a little more info on the set-up and pre-requirements to get this set up. Also, would this work if you want a launcher to be able to launch multiple games?
@tomweiland
@tomweiland 3 жыл бұрын
Yes, this is part 1 (the only part). What extra info exactly are you after? This won't work with multiple games out of the box, but modifying it support more than 1 game should be relatively trivial-all the download/install _logic_ should be the same, but you'll obviously have to change download links and stuff.
@user-ve9xq7le5y
@user-ve9xq7le5y 3 жыл бұрын
I guess I am not quite advanced enough at coding yet to use this. I feel I’m not understanding all of the terminology you use, and I don’t have experience with XAML or WPF. What basic concepts do I need to study before I come back to this? Thanks for your time:)
@itzyaboijoey3398
@itzyaboijoey3398 3 жыл бұрын
Tom i just wanted to let you know that the link converter desnt work any more and also is there a substitute for it
@tomweiland
@tomweiland 3 жыл бұрын
Give this a try: www.wonderplugin.com/online-tools/google-drive-direct-link-generator/
@atgmoperator
@atgmoperator 2 жыл бұрын
There is no need to create a custom Version class/struct. You can just use Version class from the System namespace
@tomweiland
@tomweiland 2 жыл бұрын
I just wanted something simple and understandable, and at the time of making this video I had no idea that existed.
@457Deniz457
@457Deniz457 4 жыл бұрын
Hm weird I can only open that project with VS 2019 not 2017 or 2015 🤔 It doesnt matter but I just wonder why it is like that^^ Thanks again for the GitHub and all of ur Vids
@tomweiland
@tomweiland 4 жыл бұрын
That is indeed strange-not sure why that might be 🤔
@457Deniz457
@457Deniz457 4 жыл бұрын
@@tomweiland Still thanks for ur fast reply 😊
@w1ildcard
@w1ildcard Жыл бұрын
hi! i did this with github and downloading works but whenever i update through github it doesnt update. i have to delete the game and relaunch the launcher for it to update, any idea why this is happening?
@tomweiland
@tomweiland Жыл бұрын
Did you update the version file? If the version stored online/in the cloud differs from the one stored locally, it should trigger the update process.
@erikmckelvey4796
@erikmckelvey4796 3 жыл бұрын
Thanks for the tutorial, it was very helpful! Any idea why the download is not working at all once I make an installer for the launcher? It is working great with no installer, but once I install it to program files the build.zip file won't install at all, and the only error is when the build.zip file is meant to be deleted, and the error is that the file does not exist. I am wondering if this has something to do with windows firewall?
@tomweiland
@tomweiland 3 жыл бұрын
If you're installing it to the Program Files folder that might be causing problems because you need to have administrator privileges to make modifications in there. Aside from that I'm not sure what the issue might be.
@erikmckelvey4796
@erikmckelvey4796 3 жыл бұрын
@@tomweiland Oh lmao that was the problem, I had to run the launcher as administrator. Thanks!
@raoi_
@raoi_ 3 жыл бұрын
If anyone is wondering why the "rootPath = Directory.GetCurrentDirectory();" causes an error just put "using System.IO" on the top (idk if this applies to anyone but it did apply for me) Sometimes it just isn't there
@tomweiland
@tomweiland 3 жыл бұрын
Yep.
@grid4892
@grid4892 3 жыл бұрын
did that but still getting error so instead i just put System.IO before the path code thing
@mr.gromann2929
@mr.gromann2929 4 жыл бұрын
You know that this will always download the Build.zip file, no matter if its downloading an "Update" or the game ? So there is no difference. Just an idea: Do zip files named as the version of the update (like Update-1.0.1.zip) and if the launcher installs the game, it downloads them one by one and for updating it downloads just one by one for actual local version to current version on server. But anyways: great tutorial like always :)
@tomweiland
@tomweiland 4 жыл бұрын
Yeah, I'm aware. The only reason we added two different launcher states was to display different text to the user. I'm not entirely sure what you mean by "it downloads them one by one" though-I don't see why you would want to download files from previous game versions...that's a waste of time and resources.
@mr.gromann2929
@mr.gromann2929 4 жыл бұрын
@@tomweiland this way the archives whould only contain changed Files and can be downloaded very fast 😉 Problem is that then it needs to Download one by one so all changed Files are processed. Thats btw how the Publisher Gamigo AG's Fiesta Online Launcher works. When you have an old Version you see Patch by Patch downloading but very fast.
@tomweiland
@tomweiland 4 жыл бұрын
Hmm, interesting. That doesn't sound like it would work with Drive though (at least not the way we've done it), since you're not updating the zip file, but instead adding new ones, which means you'd have more download links that the launcher isn't aware of.
@mr.gromann2929
@mr.gromann2929 4 жыл бұрын
@@tomweiland the links could be in a separate Text File (Line by line) or Something. This way it could work with Google Drive too.
@tomweiland
@tomweiland 4 жыл бұрын
That's exactly what I was thinking of when I added "(at least not the way we've done it)" :P
@axeljefyua9387
@axeljefyua9387 2 жыл бұрын
If your having errors, upload your files to dropbox, use a direct link converter, put the links in, and there! it works!
@tomweiland
@tomweiland 2 жыл бұрын
Yeah, a lot of people seem to have issues with Google Drive. OneDrive is another alternative.
@axeljefyua9387
@axeljefyua9387 2 жыл бұрын
@@tomweiland I think they don’t let you download exes or zips anymore unless you confirm it, so using other file hosting alternatives like Dropbox, one drive, idk about icloud but maybe, should do just the thing.
@axeljefyua9387
@axeljefyua9387 2 жыл бұрын
@@tomweiland I do have a few questions, I’m in the discord but my first question is can I make different buttons to launch different games? So I can have all my games on there, not just based on one?
@tomweiland
@tomweiland 2 жыл бұрын
Yes, you can add as many buttons/games as you like.
@DiscoDerpAnimations
@DiscoDerpAnimations 3 жыл бұрын
If you are doing this on the .NET framework and you can't find the ZipFile class, you need to install System.IO.Compression.ZipFile in the nuget package manager then include the namespace there
@tomweiland
@tomweiland 3 жыл бұрын
Thanks for the tip :)
@itzyaboijoey3398
@itzyaboijoey3398 3 жыл бұрын
Tom one last thing sorry to be critical but im using .net framework and the ZipFile.ExtractToDirectory(gameZip, rootPath, true); line is giving me an error saying Argument 3: cannot convert from 'bool' to 'System.Text.Encoding' what do i do?
@itzyaboijoey3398
@itzyaboijoey3398 3 жыл бұрын
Wait nvm fixed it i just took out the boolean ("true") and it works
@tomweiland
@tomweiland 3 жыл бұрын
Yeah in .NET framework the ExtractToDirectory method doesn't take a third boolean parameter, so you just need to remove it. If that causes any kind of issues, you may need to manually check if the files exist and delete them before extracting the zip file.
@SuperNidey
@SuperNidey Жыл бұрын
I have a question. Will extracting the zip file work If my game is installed inside the 'Program Files' folder? I'm afraid the launcher might request 'admin access'. (Which is a hassle for my clients who aren't tech savvy).
@tomweiland
@tomweiland Жыл бұрын
Yes, it'll need administrator permissions if it's in Program Files. That whole folder is protected.
@RysticYT
@RysticYT 2 жыл бұрын
@Tom Weiland on 7:00 is there a problem with ZipFile , on you're screen it is blue and on mine it is white Could you help me please
@RysticYT
@RysticYT 2 жыл бұрын
And it doesnt work :( i copied everything from MainWindow.xmal.cs and renamed the namespace
@tomweiland
@tomweiland 2 жыл бұрын
Join the Discord server and ask there.
@Forzurda
@Forzurda 3 жыл бұрын
Hey man, great video, im at the end of the tutorial but can't get the thing to run, Visual Studio doesnt seem to make an exe and "build" function doesn work, it only shows one error in code, it being "The name 'ZipFile' does not exist in the current context, would you know how to fix it?
@tomweiland
@tomweiland 3 жыл бұрын
Are you missing a using statement at the top? Maybe compare your code to mine on GitHub.
@combasnalah
@combasnalah 3 жыл бұрын
You probably figured it out already, but this might help for someone in the future who runs into the same problem; You are indeed missing a reference. As was the case with me, "using System.IO;" is appearantly not enough for the code to recognize the ZipFile extension. Add "using System.IO.Compression.FileSystem;" should fix this. If its not recognized, it means you do not have the reference to this extension enabled. In the solution explorer right click on References and click "Add reference" Then find "System.Io.Compression.FileSystem" in the list and enable the checkbox in front of it. Hit OK and it should work.
@max1mde
@max1mde 3 жыл бұрын
@@combasnalah oh thanks actually had the same problem :)
@Ivan-kh3gn
@Ivan-kh3gn 2 жыл бұрын
@@combasnalah This worked to me too, thanks!
@joridev1038
@joridev1038 2 жыл бұрын
@@combasnalah Man i love u
@shortiez3149
@shortiez3149 4 жыл бұрын
Great Tutorial! how would we do a progress bar for the download?
@tomweiland
@tomweiland 4 жыл бұрын
The WebClient class has a DownloadProgressChanged event-when it triggers is rather self explanatory. Unfortunately this doesn't work with Google Drive because (I'm fairly sure this is why) Drive doesn't send the file size beforehand, so you can't calculate the percentage of data that's already been transferred. It should work when downloading files from other sources though.
@thomasalvarez2089
@thomasalvarez2089 2 жыл бұрын
@@tomweiland just curious but are you aware if one drive would work for this?
@italianstallion1413
@italianstallion1413 4 жыл бұрын
Hey, awesome tutorial im just getting this one error. my zip folder only downloads to 39 kb then I get the error: System.IO.InvalidDataException:End of Central Directory record could not be found. any help would be awesome cheers!
@tomweiland
@tomweiland 4 жыл бұрын
I've never run into an error like that-have you tried googling it? If Google isn't able to help, I suggest joining the Discord server (link in description) as it's much easier to debug stuff there than here in the comments section.
@Tornadoally
@Tornadoally 4 жыл бұрын
Switch from google drive to OneDrive. It is because of the filesize. I had the same error and fixed it that way. Also sorry for being a month late but I hope this helps. :P Also if you can't figure out how to do that just reply with questions
@tomweiland
@tomweiland 4 жыл бұрын
@@Tornadoally yeah, after multiple people mentioned that this was happening (with various file sizes, so still not sure if there is a threshold), I pinned a comment with a solution from StackOverflow on this video. Switching to other hosting sites will also do the trick :)
@RealBlackCastle
@RealBlackCastle 3 жыл бұрын
Hi, thanks for this great tutorial, But I got into some problem the google method is not working anymore so I was asking if there is any other way to do this Please?
@tomweiland
@tomweiland 3 жыл бұрын
Hosting the files on Google Drive should really only be a temporary solution anyways, as I'm pretty sure they have limits on how many times a file can be downloaded in a given time frame. While you're testing you could also try using something like OneDrive or Dropbox, but in the long run you'll probably need to pay to host files somewhere.
@the_fluffinator
@the_fluffinator 3 жыл бұрын
When I try downloading the game, it says error finishing download: System.IO.InvalidDataException: End of Central Directory record could not be found and occurs at line 128. May someone please help me?
@tomweiland
@tomweiland 3 жыл бұрын
Check the pinned comment :)
@kleins0
@kleins0 3 жыл бұрын
Niiiice!!! But can you add a progress bar to this?
@tomweiland
@tomweiland 3 жыл бұрын
You can: docs.microsoft.com/en-us/dotnet/api/system.net.webclient.downloadprogresschanged?view=net-5.0 Although that won't work while you're using Google Drive to host the files due to the way that Drive handles downloads or something.
@s1m1ng7on
@s1m1ng7on 2 жыл бұрын
Hey, is there a way to select the location of the game files before installing the game (just like in a setup wizard)?
@tomweiland
@tomweiland 2 жыл бұрын
You could make a button for that.
@lbbrowns37
@lbbrowns37 2 жыл бұрын
when i launch the game launcher it wont download the file but gives a really long error message that says the problem is at line 135 "ZipFile.ExtractToDirectory(gameZip, rootPath, true);" and the zip file it downloads is corrupted any idea on why this might be
@tomweiland
@tomweiland 2 жыл бұрын
You asked about this on Discord right? Did you get it fixed?
@augustoantenucci4725
@augustoantenucci4725 2 жыл бұрын
Hey!, I have this error, "Error finishing download: Central Directory corrupt. It occurs in line 129 (Zipfile.ExtractToDirectory) Thank you
@tomweiland
@tomweiland 2 жыл бұрын
Make sure you're zipping your files the regular Windows way (not with something like Winrar, 7zip, etc). If that doesn't fix it, try using OneDrive or Dropbox instead of Google Drive.
@robinnlmn3205
@robinnlmn3205 4 жыл бұрын
Hi im doing the launcher and in the DownloadingGameCompleteCallback there is a error with : ZipFile.ExtractToDirectory(gameZip, rootPath, true); Can someone pls help
@tomweiland
@tomweiland 4 жыл бұрын
Check the pinned comment.
@rohaaltair89
@rohaaltair89 Жыл бұрын
Great video! Is it possible to display a webpage on the background instead of an image?
@tomweiland
@tomweiland Жыл бұрын
Probably? I'm not sure though.
@rohaaltair89
@rohaaltair89 Жыл бұрын
@@tomweiland Already figure it out by changing to web source, but I'm having error when creating WPF App (.NET Core) it's stating to use preview versions. Would you mind telling what version of SDK you're using? I'm using VS 2019 with 5.0.408 core SDK but I can't create WPF App (.NET Core) Project. Thank you! :D
@tormozgames
@tormozgames 2 жыл бұрын
Great tutorial , but i have a question, how do i delete the old game file and the version file?
@tomweiland
@tomweiland 2 жыл бұрын
docs.microsoft.com/en-us/dotnet/api/system.io.file.delete
@miracle__worker
@miracle__worker 3 жыл бұрын
Привет. За видео большое спасибо. Вопрос: если у меня в игре есть сохранение, то при скачивании новой версии что будет с файлом сохранения?
@tomweiland
@tomweiland 3 жыл бұрын
I'm guessing your other comment is a translation of this one, so take a look at my response to that.
Why Making Multiplayer Games SUCKS
6:46
Tom Weiland
Рет қаралды 407 М.
So you want to make a Game Engine!? (WATCH THIS before you start)
14:39
Giant Sloth Games
Рет қаралды 268 М.
WHO DO I LOVE MOST?
00:22
dednahype
Рет қаралды 77 МЛН
Haha😂 Power💪 #trending #funny #viral #shorts
00:18
Reaction Station TV
Рет қаралды 15 МЛН
A new way to generate worlds (stitched WFC)
10:51
Watt Designs
Рет қаралды 511 М.
Learning C# In A Week... Otherwise I Fail University
9:04
Making My Own Programming Language and Coding a Game in It
10:19
AstroSam
Рет қаралды 1,2 МЛН
Making a Game With C++ and SDL2
8:14
PolyMars
Рет қаралды 1,7 МЛН
How I Fixed the Ocean in My Pirate Game
6:04
Tom Weiland
Рет қаралды 80 М.
I Made a Neural Network with just Redstone!
17:23
mattbatwings
Рет қаралды 675 М.
Why I Cant Stand IDE's After Using VIM | Prime Reacts
17:51
ThePrimeTime
Рет қаралды 270 М.
I Created A Slime That Ends All Life
19:26
DangerouslyFunny
Рет қаралды 529 М.
How do non-euclidean games work? | Bitwise
14:19
DigiDigger
Рет қаралды 2,4 МЛН
WHO DO I LOVE MOST?
00:22
dednahype
Рет қаралды 77 МЛН