How to Make a Game Launcher and an Auto Updater With WPF | C# Game Launcher Tutorial
HTML-код
- Опубликовано: 22 май 2020
- 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
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/
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.
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.
@@tomweiland Just tested it and OneDrive works. Thank you, it's much more simple!
@@jmgb2645 great :)
@@jmgb2645 how do you do it?
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
its good
Thanks guys :)
@@stefffi2003 thank :)
@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 :)
@@tomweiland no steffi, no money?
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!
Thank you, I definitely will!
This is just what i needed for my dev plan for the summer.
Awesome :)
A fortnite dev?
One year later, how did the plan go?
you just ran into us with winter
Just wanted to say Tom loving these videos. They are super informative and a massive help. Thank you
I'm glad you liked it :)
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!
: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.
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...
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...
yo Zippy, i love your devlogs man
Awesome tutorial, clear, easily followed and at the same time in depth.
Thank you!
Thanks! Really the only straight on turorial I could find! Appreciate it man! 👌
I'm glad you liked it :)
Thanks for this awesome tutorial, your channel is precious you make tutorial about subjects I personally didn't find any tutorial appart here
Thanks, that means a lot :D
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.
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 🤔
Omg thanks! 🤩 Thats exactly what i need it! Your tutorials are the best! 👌
Thank you, I'm glad you like them :D
Really cool, needed this badly! Thanks a lot. Became a fan of yours.
Thanks, that means a lot :D
After 5 Secs I thought:
I LOVE YOU ! 😆
Thanks rly rly nice, usefull AND awesome ! :)
I'm glad you liked it!
dude you are so underrated it is insane
I appreciate the kind words 😅
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?
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
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!
Glad it worked!
Perfect tutorial.. the first that I really learned about how to create an mmo.. Very nice Tom!
Brazilian here 😁
Thanks, I'm glad you liked it :)
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
i was looking for a game launcher tutorial for a while lol ty
Glad I could help :)
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?
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.
@@tomweiland thank you so much!
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.
OneDrive and Dropbox are potential alternatives as well.
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.
Amazing video.
I bookmarked it and will get back to it when I reach the point of implementing an launcher.
👍
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 (?)
Thank you, that means a lot to hear :D
Brilliant video, thank you!!
I'm glad you liked it!
ty so much! you make awesome tutorials 😁
I'm glad you like them :D
This work perfectly
Thank you so much :)
I'm glad it's working!
Great vid ! Many thanks - love it !
Glad you liked it!
A really great tutorial, good job
Thanks, glad it was helpful :)
This is actually a neat tutorial
Thank you :)
I remember looking for something like this in 2015 and 16 when I wasn't experienced in c# at all,thanks for sharing
Well I hope you like(d) it :)
@@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 "
Check the pinned comment on this video, that error looks like it might be caused by what I address there.
This is super useful, thanks!
I'm glad you think so!
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!
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.
Tom Weiland alright, that’s totally alright man! Looking forward to your next devlog : )
@@nichoas3495 awesome, it's nice to know people enjoy the devlogs!
@@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
This is so cool! THANK U :D
Glad you like it :)
Thank you very much for this lesson!
You're welcome :)
Thank you! This help me really hard !
Glad to hear it :)
THIS SAVED ME THANK YOU
Glad I could help :)
Thanks! This is really helpful~
Glad to hear it :)
You are a hero.
You are very quick at programming.
The footage is a little bit sped up, so this isn't my "organic" typing speed 😅
@@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.
Thank you for this tutorial. 🙌
You're welcome :)
This video helped me with the zip download and extraction, thank you!
Great! Glad I could help :)
Great job! Thanks!
Glad you liked it :)
Dude you are real hero :)
Thanks :D
THIS IS INSANELY GOOD.
Thanks :D
Fantastic ! Thanks for source code :D
You're welcome :)
Thank for sharing the knowledge!
Glad it was helpful :)
@@tomweiland Just wondering. Is there anyway to pass parameter to game from the launcher?
Found what the answer to my question. Good video.
Genius Tom! 😄
Thank you :D
Only at 6:03 but I'm really loving the tutorial - Thank you!
👍
Thanks Man You saved Me!
You're welcome 😅
Amazing tutorial, very helpful! Anyone else try to type in the direct download link to try and get the game lmao
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 😅
thank you so much Sir!
You're welcome :)
Thanks it helped me a lot
Glad to hear it :)
@@tomweiland is devlog #45 coming
Not quite, but there is a new video coming as soon as I finish editing it!
sir u are really great :-)
😅
Awesome. 🤩
Glad you liked it!
Ehrenmann, wirklicher Ehrenmann
😅
thanks for your help
I'm glad you found it helpful :)
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.
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).
gameExe = Path.Combine(rootPath, "Build/YourAppName.exe");
Adding "Build/..." fixed my issue.
@@altermann4072 Appreciate you dude!!
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.
Glad it was helpful!
Hello, thanks a lot for your video. I have a question: what will happen with my saves after update?
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.
Are you an life savior? Because you saved mine
😅
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?
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
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?
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.
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
You'll need to make a second updater application, as programs can't really modify their own files while they're running.
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?
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.
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"?
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
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.
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).
@@tomweiland thanks for the swift response, what is a hash? And how would you go about coding that in?
Hi im doing the launcher and in the DownloadingGameCompleteCallback there is a error with : ZipFile.ExtractToDirectory(gameZip, rootPath, true);
Can someone pls help
Check the pinned comment.
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
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.
Tom Weiland thank you! And yes a did double repost it was accident and I’ll remove it lol
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?
Check the pinned comment :)
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 ;-)
That sounds like a smart thing to do :P
_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 ?._
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.
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
You asked about this on Discord right? Did you get it fixed?
Hey, is there a way to select the location of the game files before installing the game (just like in a setup wizard)?
You could make a button for that.
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).
Yes, it'll need administrator permissions if it's in Program Files. That whole folder is protected.
Привет. За видео большое спасибо. Вопрос: если у меня в игре есть сохранение, то при скачивании новой версии что будет с файлом сохранения?
I'm guessing your other comment is a translation of this one, so take a look at my response to that.
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?
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.
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?
Wait nvm fixed it i just took out the boolean ("true") and it works
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.
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
Thanks for the tip :)
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 ?
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.
@@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
@@malphiem sameeeeeeeeeeeeeeeeeeeee
When Creating a new Project, I dont get that Preview window. Any reason why? It worked before but now it doesnt show at all. Ive reinstalled my Visual Studio and reset all my setting yet nothing.
Maybe try this? stackoverflow.com/questions/30090719/xaml-designer-not-showing-up
LOve For tut they are so fun
Glad you like them :)
Hey!, I have this error, "Error finishing download: Central Directory corrupt.
It occurs in line 129 (Zipfile.ExtractToDirectory)
Thank you
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.
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..?
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.
Would it be possible to use the games.exe version for version tracking, cutting the need for the txt?
Are you talking about the version that you set in the Unity editor (in the player settings I think)? I had that thought when I was building my launcher, but I couldn't find a way to access that information from outside the game. Even if you could access it, you'd still need to have the version file stored online.
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!
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.
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
@@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 :)
So I'm having an issue with this, it shows no errors in visual studio but when I compile and try to run it it gives me an error message at line 129, I assumed it was the issue that he pinned about the google drive confirmation so I switched to onedrive, it still prompted the exact same error.
Without the error message and whatever is on line 129 (since code spacing might not be identical), no one will be able to help...
Tom i just wanted to let you know that the link converter desnt work any more and also is there a substitute for it
Give this a try: www.wonderplugin.com/online-tools/google-drive-direct-link-generator/
I think this might be big! There are virtually no game launcher tutorials for Unity.
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
@@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!
There are but this is the best one
@@tomweiland Well even some Steam games have their own launchers for updates... :D
@@CapCreeperGR_Main thanks :P
Hi, I made everything work, but I get a error whenever I make an update to the game.
It downloads the .zip to the folder, but then it pops up with multiple errors, and also hinting that something went wrong on line 129.
As far as I can see, the error is that the Build.zip is downloaded, tries to unpack, but can't cause the old "Build" folder is still there. So apparently it can't overwrite it. Do you know how I can fix this, or where I went wrong? Thank you very much:)
Without seeing the actual errors you're getting, what you have on line 120, and/or your code in general, there's not much I or anyone else will be able to do to help. I recommend joining the Discord server and asking there, and including that information.
Also, read the pinned comment (if you haven't already) and make sure your issue isn't related to anything mentioned there.
is there a limit on file size for when it extract the zip? it works for other projects but it stops when it tries to downlaod the project i need it to download. am i missing soemthing?
Join the Discord server and ask there. Troubleshooting is a pain in the RUclips comments.
@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
And it doesnt work :( i copied everything from MainWindow.xmal.cs and renamed the namespace
Join the Discord server and ask there.
Thank you for that explanation ♥.
But explain how to add more games in launcher 🙃👍🏻.
It's literally the same code-you'll just need to specify which game should be downloaded/updated/launched.
Hello! I really liked your tutorial, but for some reason I got an error: Error finishing download: System. IO. InvalidDataException: End of Central Directory record could not be found. Could you tell me how to fix this error? Thank you in advance
Check the pinned comment.
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?
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.
@@tomweiland Oh lmao that was the problem, I had to run the launcher as administrator. Thanks!
you could also use downloadstring and set that in a variable and then use that with downloadfile
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.
@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
If your having errors, upload your files to dropbox, use a direct link converter, put the links in, and there! it works!
Yeah, a lot of people seem to have issues with Google Drive. OneDrive is another alternative.
@@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.
@@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?
Yes, you can add as many buttons/games as you like.
If your gonna make a launcher for multiple platforms you will need to use something like Electron or QT creator
Yeah, this is mainly meant to just show people the basics.
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?
Try this: stackoverflow.com/a/20073418
Alternatively you can take advantage of a library, such as this one: github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit
@@tomweiland Alright otherwise I'll join ur Discord. Thhnxxx
In the ZIpFile.Extract... when I add true it says “Argument 3: cannot convert from ‘bool’ to ‘System.Text.Encoding’ “
Are you using .NET Framework? I think the Extract method takes different parameters there than in .NET Core. However, that boolean isn't really necessary-it just tells it to overwrite any existing files with that name.
I just looked for .Net so I guess I took the wrong one
I'm just wondering how to make the launcher find out if the files have changed and if not, not to download anything...
To check the files themselves, you'd need to use a hashing system like I talked about at the end of the video. However, assuming you only change the version number that's stored online when you release an update, the launcher will only ever download the files when something has changed.