Sign in to follow this  

Unity Creating a game launcher.

This topic is 1118 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Greetings dear community.

 

Although my question is not 100% game related, I didn't find the better place to put my topic.

 

I need to create a launcher for our game. This will be online game and I need a way to easily update it. Also launcher itself should be easily updateable. I mostly interested in high level architecture, i.e. how thing works at all. Our game will be cross platform, but for now I'm trying to do it for Windows (Win7). There's very little info in the web, so I don't know what is the "industry standard". I investigated how major launcher/programs work, and here's a quick description:

 

1. Launching Battle.net launches 2 exes - Battle.net.exe and Agent.exe. I suppose that Battle.net.exe is user interface exe and Agent.exe always runs in background. This Agent.exe can be found in C:\ProgramData\Battle.net\Agent\... folder. But what is this Agent.exe for? Why it's in ProgramData folder? Who starts who - agent starts launcher or other way? What I like about Blizzard's work - I don't have any system dialogs while run a program, like dialog asking to run as administrator.

 

2. Steam is seems only one process in task manager. When it's time to update, who updates exe? As far as I know the program can't update itself (at least on windows - you can't replace running exe).

 

Thank you.

Share this post


Link to post
Share on other sites

I would write inside of exe just simple stuff like checking update and dll launch function call.
Make everything inside your dynamic library and when update is needed, free the library and replace it then open library again and its done.
That would be easiest thing in my eye.

Share this post


Link to post
Share on other sites
One thing to keep in mind is most modern operating systems have limited user accounts that will get in the way of your program updating itself.

I admit to not being familiar with OSX or Linux, but on Windows you should have your updater app download all updates to a non-privileged location (Say, the user's app data or temporary folders - usually NOT the folder your program is installed in), and then you have a secondary program, signed with a certificate and flagged to require administrative rights, which does the actual work of copying the data from the temporary location to the actual install location.

This lets your updater run under the user's account without requiring it to hold onto admin rights all the time and only require admin access for the final copy - minimizing the risk to the user's system, and helping your program behave like a "good citizen" in the OS.

Share this post


Link to post
Share on other sites

Or you could go with a more extreme solution.

 

App starts up and phones home, if an update is available it downloads it and overwrites existing data. The game downloaded is not an exe. It's just a memory image.

 

Load the current memory image into ram and execute it.

 

You might have issues on Apple OS's, I don't think they give developers executable memory, but it's a different approach that is worth thinking about.

Share this post


Link to post
Share on other sites

Thank you guys. That helped a lot.

 

Agent is primarily responsible for launching and updating the games, so a broken agent leads to a couple of problems.

 

 

So agent is also installing a game, right? How can it do so? For example, for initial installation we use third-party installer. But since game should be installed from some executable and should have some feedback from installation process how to do this? For example, Battle.net allows to start a game before full download/update.

 

You could also download the new version into a temporary location, launch that, then if that succeeds, have it delete the old version and move itself into that location. This has the advantage that the old launcher.exe won't be replaced if the update is botched and gets a new but broken .exe for some reason.

 

 

Thanks a lot, that's very clever.

 

then you have a secondary program, signed with a certificate and flagged to require administrative rights

 

 

Does that means that I can run this program without user permission? Or every time user starts such program he will need to approve?

Share this post


Link to post
Share on other sites

then you have a secondary program, signed with a certificate and flagged to require administrative rights

 
Does that means that I can run this program without user permission? Or every time user starts such program he will need to approve?


Your launcher (which does the downloads) would not require user permission. This is ideal, because most of the time the launcher doesn't do anything - after all, it only has to do something when a patch comes out. However the secondary program that does the copying/installing of the patch once it's downloaded will require user permission each time a patch is downloaded. This is also why you want to sign the app, because then the user can see that the program has come from a source they trust (you) and that it hasn't been tampered with.

Share this post


Link to post
Share on other sites

However the secondary program that does the copying/installing of the patch once it's downloaded will require user permission each time a patch is downloaded.


In general true for sane setups, but as a note: this is only true if the game is installed in a secured central location. A number of games don't have a real installer, but rather just a small launcher that you run directly which installs the game into %HOME% or %APPDATA% or the like (optionally in some cases).

Share this post


Link to post
Share on other sites

However the secondary program that does the copying/installing of the patch once it's downloaded will require user permission each time a patch is downloaded.


In general true for sane setups, but as a note: this is only true if the game is installed in a secured central location. A number of games don't have a real installer, but rather just a small launcher that you run directly which installs the game into %HOME% or %APPDATA% or the like (optionally in some cases).


Yup - that works too. The downside there is those folders may be on drives where the user doesn't want the game installed (especially if it is a large game) - like on the OS's SSD.

Share this post


Link to post
Share on other sites

This topic is 1118 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this