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

Поделиться
HTML-код
  • Опубликовано: 28 окт 2024

Комментарии • 874

  • @tomweiland
    @tomweiland  4 года назад +66

    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 года назад +1

      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 года назад +3

      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 года назад +3

      @@tomweiland Just tested it and OneDrive works. Thank you, it's much more simple!

    • @tomweiland
      @tomweiland  4 года назад +2

      @@jmgb2645 great :)

    • @toyotacorolla-2001
      @toyotacorolla-2001 4 года назад +1

      @@jmgb2645 how do you do it?

  • @tomweiland
    @tomweiland  4 года назад +67

    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 года назад +3

      @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 :)

    • @IChillAlways
      @IChillAlways 5 месяцев назад

      @@tomweiland no steffi, no money?

  • @heinzketchup2542
    @heinzketchup2542 4 года назад +70

    This is just what i needed for my dev plan for the summer.

  • @joelfrom08
    @joelfrom08 3 года назад +6

    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 года назад +1

      :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.

  • @xzippyzachx
    @xzippyzachx 4 года назад +26

    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 года назад +5

      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

  • @dylanr0662
    @dylanr0662 2 года назад +3

    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 года назад +2

      OneDrive and Dropbox are potential alternatives as well.

    • @haruchanz64
      @haruchanz64 7 месяцев назад

      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.

  • @RobLang
    @RobLang 4 года назад +11

    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 года назад +1

      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 🤔

  • @IlIlIlIlIIIIIllll
    @IlIlIlIlIIIIIllll 3 года назад +3

    dude you are so underrated it is insane

    • @tomweiland
      @tomweiland  3 года назад +1

      I appreciate the kind words 😅

  • @benrex7775
    @benrex7775 3 года назад +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 года назад +1

      @@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.

  • @eraykaya2628
    @eraykaya2628 4 года назад +6

    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!

  • @457Deniz457
    @457Deniz457 4 года назад +10

    After 5 Secs I thought:
    I LOVE YOU ! 😆
    Thanks rly rly nice, usefull AND awesome ! :)

    • @tomweiland
      @tomweiland  4 года назад +1

      I'm glad you liked it!

  • @nichoas3495
    @nichoas3495 4 года назад +8

    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

  • @ayoitsjack7319
    @ayoitsjack7319 4 года назад +2

    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 :)

  • @jeanribeiro651
    @jeanribeiro651 4 года назад +2

    Perfect tutorial.. the first that I really learned about how to create an mmo.. Very nice Tom!
    Brazilian here 😁

    • @tomweiland
      @tomweiland  4 года назад +2

      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

  • @drimiteros_21
    @drimiteros_21 2 месяца назад

    Wow, that was exactly what I was searching for. Great video!

  • @RugbugRedfern
    @RugbugRedfern 4 года назад +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

  • @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!

  • @DJLKM1
    @DJLKM1 4 года назад +2

    Awesome tutorial, clear, easily followed and at the same time in depth.

  • @Malificentmelon
    @Malificentmelon 4 года назад

    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  4 года назад

      Well I hope you like(d) it :)

    • @Malificentmelon
      @Malificentmelon 4 года назад

      @@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  4 года назад

      Check the pinned comment on this video, that error looks like it might be caused by what I address there.

  • @JeloOW
    @JeloOW 4 года назад +1

    i was looking for a game launcher tutorial for a while lol ty

  • @phantomslayer9714
    @phantomslayer9714 2 года назад +1

    Hi, love the content, you literally the only person I’ve seen on RUclips 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  2 года назад +1

      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 2 года назад

      @@tomweiland thank you so much!

  • @sullymlg9785
    @sullymlg9785 2 года назад +1

    Only at 6:03 but I'm really loving the tutorial - Thank you!

  • @scart3redup304
    @scart3redup304 4 года назад +1

    Thanks! Really the only straight on turorial I could find! Appreciate it man! 👌

    • @tomweiland
      @tomweiland  4 года назад

      I'm glad you liked it :)

  • @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

  • @DamageSoftware
    @DamageSoftware 2 года назад

    Amazing video.
    I bookmarked it and will get back to it when I reach the point of implementing an launcher.

  • @VIKTOR69
    @VIKTOR69 4 года назад +1

    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

  • @gloriousptr
    @gloriousptr 4 года назад +1

    Really cool, needed this badly! Thanks a lot. Became a fan of yours.

    • @tomweiland
      @tomweiland  4 года назад +2

      Thanks, that means a lot :D

  • @scottgamedev8542
    @scottgamedev8542 2 года назад +1

    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.

  • @axeljefyua9387
    @axeljefyua9387 3 года назад +1

    If your having errors, upload your files to dropbox, use a direct link converter, put the links in, and there! it works!

    • @tomweiland
      @tomweiland  3 года назад +1

      Yeah, a lot of people seem to have issues with Google Drive. OneDrive is another alternative.

    • @axeljefyua9387
      @axeljefyua9387 3 года назад

      @@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 3 года назад

      @@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  3 года назад

      Yes, you can add as many buttons/games as you like.

  • @LinkinJuan23
    @LinkinJuan23 4 года назад

    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  4 года назад +1

      Thank you, that means a lot to hear :D

  • @LanPodder
    @LanPodder 4 года назад +1

    This is actually a neat tutorial

  • @Spamap
    @Spamap 4 года назад +2

    Amazing tutorial, very helpful! Anyone else try to type in the direct download link to try and get the game lmao

    • @tomweiland
      @tomweiland  4 года назад +2

      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 😅

  • @J_E_N_T
    @J_E_N_T 3 года назад +1

    Brilliant video, thank you!!

  • @DanielLochner
    @DanielLochner 4 года назад

    Genius Tom! 😄

  • @philberex
    @philberex Год назад

    Thank you for this tutorial. 🙌

  • @Acrellux
    @Acrellux 2 года назад

    Hello. I'm having some trouble. Everything works fine, but when I press play, it won't do anything. Do you know what could be causing this? I had to tamper with Norton to get it to download, also, if that changes anything. Thank you.

    • @tomweiland
      @tomweiland  2 года назад

      Make sure your file paths are correct. Beyond that there's not much I can do to help, especially if you're not getting errors. If you are getting an error, go ask on Discord (debugging here in the comments is really tedious).

    • @altermann4072
      @altermann4072 9 месяцев назад

      gameExe = Path.Combine(rootPath, "Build/YourAppName.exe");
      Adding "Build/..." fixed my issue.

    • @Acrellux
      @Acrellux 9 месяцев назад

      @@altermann4072 Appreciate you dude!!

  • @BogdanAndreiRO
    @BogdanAndreiRO 3 года назад

    This video helped me with the zip download and extraction, thank you!

    • @tomweiland
      @tomweiland  3 года назад

      Great! Glad I could help :)

  • @Doesky
    @Doesky 4 года назад +1

    ty so much! you make awesome tutorials 😁

    • @tomweiland
      @tomweiland  4 года назад +1

      I'm glad you like them :D

  • @RugbugRedfern
    @RugbugRedfern 4 года назад +3

    I think this might be big! There are virtually no game launcher tutorials for Unity.

    • @tomweiland
      @tomweiland  4 года назад +2

      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 года назад +2

      @@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!

    • @Enum_Dev
      @Enum_Dev 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 года назад

      @@Enum_Dev thanks :P

  • @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.

  • @MasterofFire-sc3yn
    @MasterofFire-sc3yn 4 года назад

    THIS IS INSANELY GOOD.

  • @cloudchen0831
    @cloudchen0831 6 месяцев назад

    You are a hero.

  • @antonvrigborn6666
    @antonvrigborn6666 3 года назад

    A really great tutorial, good job

    • @tomweiland
      @tomweiland  3 года назад

      Thanks, glad it was helpful :)

  • @KingDara_
    @KingDara_ 2 года назад

    Thank you! This help me really hard !

  • @dmrdev9934
    @dmrdev9934 4 года назад

    Dude you are real hero :)

  • @raoi_
    @raoi_ 3 года назад +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

  • @davilkusgames
    @davilkusgames 2 года назад

    Thank you very much for this lesson!

  • @frankzander5946
    @frankzander5946 3 года назад

    Great vid ! Many thanks - love it !

  • @generalis2095
    @generalis2095 3 года назад

    Great job! Thanks!

  • @EmuTheEmo
    @EmuTheEmo 3 года назад +1

    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.

  • @beaujanssen6243
    @beaujanssen6243 4 года назад +1

    This is so cool! THANK U :D

  • @arknet4973
    @arknet4973 4 года назад +1

    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  4 года назад

      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 4 года назад

    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  4 года назад

      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 4 года назад

      Tom Weiland thank you! And yes a did double repost it was accident and I’ll remove it lol

  • @augustoantenucci4725
    @augustoantenucci4725 2 года назад +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.

  • @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?

  • @SquidyGuitar
    @SquidyGuitar 4 года назад

    This work perfectly
    Thank you so much :)

  • @DiscoDerpAnimations
    @DiscoDerpAnimations 4 года назад +6

    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

  • @x_triff_x
    @x_triff_x 2 месяца назад

    Can I put a video or a gif on the Launcher's background, instead of only an image, because an image sounds a bit boring for me :D
    If it is possible, how do you do that?

    • @tomweiland
      @tomweiland  24 дня назад

      It's almost certainly possible, but I couldn't tell you how. I'm no WPF expert 😅

  • @MistycznyArbuz2
    @MistycznyArbuz2 3 года назад

    Fantastic ! Thanks for source code :D

  • @RysticYT
    @RysticYT 2 года назад +1

    @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.

  • @bluegreen15
    @bluegreen15 Год назад

    Ehrenmann, wirklicher Ehrenmann

  • @the_fluffinator
    @the_fluffinator 3 года назад +2

    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 :)

  • @delautrer2480
    @delautrer2480 2 года назад

    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  2 года назад

      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

  • @w1ildcard
    @w1ildcard 2 года назад +1

    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  2 года назад

      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.

  • @Forzurda
    @Forzurda 4 года назад +2

    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  4 года назад

      Are you missing a using statement at the top? Maybe compare your code to mine on GitHub.

    • @combasnalah
      @combasnalah 3 года назад +4

      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 года назад +1

      @@combasnalah oh thanks actually had the same problem :)

    • @Ivan-kh3gn
      @Ivan-kh3gn 3 года назад +1

      @@combasnalah This worked to me too, thanks!

    • @joridev1038
      @joridev1038 2 года назад +1

      @@combasnalah Man i love u

  • @antalervin19-
    @antalervin19- Год назад

    Thanks Man You saved Me!

  • @miracle__worker
    @miracle__worker 4 года назад +1

    Hello, thanks a lot for your video. I have a question: what will happen with my saves after update?

    • @tomweiland
      @tomweiland  4 года назад +1

      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.

  • @lagosta
    @lagosta 4 года назад

    Are you an life savior? Because you saved mine

  • @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

  • @MaybeAnge
    @MaybeAnge 2 года назад +1

    Nothing happens when I launch the application, even the "play" button stays on "Checking For Update" Do you know why?

    • @tomweiland
      @tomweiland  2 года назад

      Sounds like it's getting stuck somewhere along the way, but I'm not really sure what would cause it, especially if you're not getting any errors. Best I can say is to compare your code to what's on GitHub.

    • @MaybeAnge
      @MaybeAnge 2 года назад

      @@tomweiland Exactly I did and it is same as your code

  • @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 Год назад +1

      @@malphiem sameeeeeeeeeeeeeeeeeeeee

  • @itzyaboijoey3398
    @itzyaboijoey3398 3 года назад +2

    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.

  • @lbbrowns37
    @lbbrowns37 3 года назад +1

    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  3 года назад

      You asked about this on Discord right? Did you get it fixed?

  • @tristankubih
    @tristankubih Год назад +2

    7:05 ERROR: The Object "ZipFile" does not exist in the current content. How can I fix it?

    • @tomweiland
      @tomweiland  Год назад

      Add the necessary using directive at the top of your file. I think it's System.IO.Compression or something.

    • @JadenAllen
      @JadenAllen 9 месяцев назад

      @@tomweiland System.IO.Compression doesnt add it, i had to right click on my references and add System.IO.Compression.FileSystem. Wasnt able to add it by adding "using" either, very strange

  • @italianstallion1413
    @italianstallion1413 4 года назад +2

    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 :)

  • @itzyaboijoey3398
    @itzyaboijoey3398 3 года назад +1

    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 года назад +1

      Give this a try: www.wonderplugin.com/online-tools/google-drive-direct-link-generator/

  • @tristankubih
    @tristankubih Год назад

    Hi, I have a question, because as soon as I open Visual Studio, I don't get the template for a WPF App so i have none of the code that yall start with.. Please help..?

    • @tomweiland
      @tomweiland  Год назад +1

      If you don't have the WPF App template then you're missing a VS workload-maybe the .NET Desktop Development one? You'll have to modify your VS installation via the installer.

  • @robinnlmn3205
    @robinnlmn3205 4 года назад +2

    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.

  • @nicksparrow009
    @nicksparrow009 4 года назад +1

    Hey bro, so I put down a OnMouseEnter Function and I try to change the background of a button, but I have worked half a day to get it working and I don't get it to work, mind if you help me?

    • @tomweiland
      @tomweiland  4 года назад

      Try this: stackoverflow.com/a/20073418
      Alternatively you can take advantage of a library, such as this one: github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit

    • @nicksparrow009
      @nicksparrow009 4 года назад

      @@tomweiland Alright otherwise I'll join ur Discord. Thhnxxx

  • @tux_the_astronaut
    @tux_the_astronaut 4 года назад +2

    If your gonna make a launcher for multiple platforms you will need to use something like Electron or QT creator

    • @tomweiland
      @tomweiland  4 года назад +1

      Yeah, this is mainly meant to just show people the basics.

  • @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:)

  • @mr.gromann2929
    @mr.gromann2929 4 года назад +1

    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 года назад +1

      That's exactly what I was thinking of when I added "(at least not the way we've done it)" :P

  • @nay0ngg
    @nay0ngg 4 года назад

    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  4 года назад +1

      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.

  • @cardboardpi314
    @cardboardpi314 3 года назад

    How does the code work when you update and there is already a build folder for unity. Whenever this happens to me I get an error since it will not allow me to overwrite existing files. I saw that ZipFile.ExtractToDirectory has an additional bool parameter but I cannot add that in my project, as it claims it cannot convert bool to System.Text.Encoding. I know that the bool parameter essentially says whether or not to overwrite files, unfortunately I can't use that at all.
    If there is a solution? I will be happy to hear if so, great video by the way.

    • @tomweiland
      @tomweiland  3 года назад +1

      If you don't have the method that takes a bool as one of its parameters, then you're probably using .NET Framework (the methods are a bit different than in .NET Core, which I didn't realize before making this video). You could just check if the file exists, and if it does, delete it before extracting the new one.

    • @cardboardpi314
      @cardboardpi314 3 года назад

      @@tomweiland I was able to get it resolved. Thanks.

  • @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!

  • @rohaaltair89
    @rohaaltair89 Год назад

    Great video! Is it possible to display a webpage on the background instead of an image?

    • @tomweiland
      @tomweiland  Год назад +1

      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

  • @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

  • @457Deniz457
    @457Deniz457 4 года назад +1

    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 года назад +1

      That is indeed strange-not sure why that might be 🤔

    • @457Deniz457
      @457Deniz457 4 года назад

      @@tomweiland Still thanks for ur fast reply 😊

  • @AphixDev
    @AphixDev 4 года назад

    Awesome. 🤩

  • @XordXildo
    @XordXildo 3 года назад +1

    THIS SAVED ME THANK YOU

  • @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.

  • @rockydonet
    @rockydonet 3 года назад

    thank you so much Sir!

  • @miracle__worker
    @miracle__worker 4 года назад +1

    Привет. За видео большое спасибо. Вопрос: если у меня в игре есть сохранение, то при скачивании новой версии что будет с файлом сохранения?

    • @tomweiland
      @tomweiland  4 года назад

      I'm guessing your other comment is a translation of this one, so take a look at my response to that.

  • @mfortn
    @mfortn 4 года назад

    Thank you for that explanation ♥.
    But explain how to add more games in launcher 🙃👍🏻.

    • @tomweiland
      @tomweiland  4 года назад +1

      It's literally the same code-you'll just need to specify which game should be downloaded/updated/launched.

  • @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 года назад +1

      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!

  • @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.

  • @TheAce5511
    @TheAce5511 10 месяцев назад

    On my non tech savvy friends computers, they are required to download the .NET framework to launch my GameLauncher. Is this always going to be the case? Also their antivirus doesnt like the .dll files

    • @tomweiland
      @tomweiland  10 месяцев назад

      .NET Framework is included in Windows. If you built the launcher with .NET Core your friends would have to install that-the way around it is to either switch to .NET Framework or to publish the launcher with the _self-contained_ option enabled (which will include .NET Core in the launcher build).
      As for the antivirus issue, I think you'll have to get a code signing certificate to get around that, which I believe costs money (though I'm not 100% sure, I haven't really looked into it).

  • @seankerr1822
    @seankerr1822 Год назад

    Awesome video the only problem im having is that on line 129 it says The name 'ZipFile' does not exist in the current context would you know what's up with that?

    • @tomweiland
      @tomweiland  Год назад

      Did you add the necessary namespace?

    • @seankerr1822
      @seankerr1822 Год назад

      @@tomweiland If I try putting my game zip in it then the extract to directory does not work

    • @Blobfish_Sidearm
      @Blobfish_Sidearm Год назад

      @@tomweiland Im not sure what name space you mean

  • @OpenGamesCommunity
    @OpenGamesCommunity 2 года назад

    _This launcher can be turned to work as onlinepath also ? I see rootpath, instead of __build.zip__ can we add a url path ? To download from a FTP Server, then change drive links ?._

    • @tomweiland
      @tomweiland  2 года назад

      What? _rootPath_ is the path to the directory where you want to install the game locally. The Drive download links act as the "online path", and yes, you can change those out to download from somewhere else.

  • @jw200
    @jw200 Год назад +1

    Thanks.
    Its possible to earn good money with this launcher app: 2000-5000$ easily.
    Cant write here in details. But good tutorial to make "fake" launcher.

    • @tomweiland
      @tomweiland  Год назад +5

      Are you talking about scams or malware distribution or something?
      I know me asking probably won't change your mind, but please don't use it for that...