2

I've seen a ton of games and what not opening their applications using links like "game://15.64.15.64:25876" or something.

I want to be able to launch my game's .exe from my website for users who installed it, and for it to work on any browser; At the same time I want to be able to pass a parameter (just 1).

What registry values would need to be added/modified for this to work for all browsers? If there's extra steps to setting it up in all browsers, can you explain these steps? Other questions I've found didn't quite help or worked only in IE. I require Firefox, Chrome, and IE at the least.

Anonymous
  • 553
  • 5
  • 17
  • 41
  • Your best bet would probably be to just write plugins for the major browsers you want to support and then use the plugin (via javascript) to launch the application. Presumably you need to install the game first, so you could include the plugin installation as part of the game setup. (That "game" part is called the [URI Scheme](http://en.wikipedia.org/wiki/URI_scheme), and what you are trying to do is considered non-standard and thus probably won't be consistently implemented across various browsers.) – JDB Mar 25 '13 at 17:55
  • By the way, if you do opt for a custom scheme, make sure that the user can modify it (at least through a config setting or something). Since you are not registering with IANA, there's a chance that your software could end up conflicting with someone else's. If users call to complain that their XYZ software broke, at least you'd have a workaround to provide them. – JDB Mar 25 '13 at 19:42

2 Answers2

2

A similar question was asked here: How do I make the website execute links?

You would end up with a structure like this in your registry:

HKEY_CLASSES_ROOT
   game
      (Default) = "URL:Game Protocol"
      URL Protocol = ""
      DefaultIcon
         (Default) = "game.exe,1"
      shell
         open
            command
               (Default) = "C:\Games\YourGame\game.exe" "%1"

See this article on MSDN for details: Registering an Application to a URI Scheme

As mentioned by OP, the above approach only works in IE. Here are some thoughts on how to make it work in other browsers:

Community
  • 1
  • 1
Victor Zakharov
  • 25,801
  • 18
  • 85
  • 151
  • AFAIK, this only supports Internet Explorer though. What about Chrome and such? – Anonymous Mar 19 '13 at 18:10
  • @Bailey: I never used it myself. Did you try it in non-IE browsers? – Victor Zakharov Mar 19 '13 at 18:11
  • I looked at that link, it only supports IE according to Microsoft. =/ – Anonymous Mar 19 '13 at 18:12
  • @Bailey: Did you try [this](http://stackoverflow.com/questions/2330545/is-it-possible-to-open-custom-url-scheme-with-google-chrome) for Chrome? – Victor Zakharov Mar 19 '13 at 18:15
  • I think I figured it out at that link. I'll find a way to test on FireFox in a few – Anonymous Mar 19 '13 at 18:24
  • Your Chrome link doesn't really explain how to register a custom scheme with Chrome. Good Firefox article, though. – JDB Mar 25 '13 at 19:57
  • @Cyborgx37: As far as I understood, Chrome should handle whatever you have in your system. If for some reason it does not do it, [this answer](http://stackoverflow.com/a/2337525/897326) describes a workaround, i.e. doing it via IFRAME. – Victor Zakharov Mar 25 '13 at 20:47
0

One way I can think is download a file from browser ( gamesession.gme or your extension) and set your game as the default application for that extension.

schar
  • 2,618
  • 5
  • 25
  • 24