iamgreaser / iceball

Open-source rewrite of the VOXLAP version of Ace of Spades.
http://iceball.build
GNU General Public License v3.0
113 stars 32 forks source link

iceball:// protocol handler registration #207

Open rakiru opened 9 years ago

rakiru commented 9 years ago

The windows builds previously came with a shouty-named executable to register Iceball as the iceball:// protocol handler. While this is less of an issue now that the game contains a launcher, this functionality should really be included in the game (since we don't have an installer), perhaps a button in the not-yet-existent options menu, and/or automatically on start up if not already registered.

I'm not sure how this is dealt with on OSX or any of the various *nix setups, but the same should be done there if possible.

iamgreaser commented 9 years ago

I don't want it to actually be part of the engine as the behaviour is different on each platform.

For Windows, you go through the registry. For non-OSX, you create a .desktop file and shove it in the right place and edit a config of some sort... and it's actually pretty damn flimsy. For OSX, I have no idea. sillesta, where are you?

I really do not want to have to make a futile attempt at automating the non-OSX version due to how bloody awful it is.

rakiru commented 9 years ago

My main concern with this is that most users won't do anything to enable this, and it should really be automatic where possible. I guess on non-OSX/Windows, it would be acceptable not to have it, due to the variance between systems and the fact that most people on those systems are capable of figuring it out themselves. Having it on Windows and OSX shouldn't be a problem though, right?

I'm not sure how exactly to handle it in that situation though. If there wasn't a Lua API method available for it, then the only option would be to do it on startup, in which case, would it override the existing one, or only apply it if it doesn't already exist? The former could be rather intrusive (although perhaps not something most people would notice), and the latter creates problems if the game is moved.

Hmm...

fkaa commented 9 years ago

@iamgreaser OS X solution seems pretty straightforward. All that's needed is some extra information in Info.plist and for the application bundle to be in the Applications folder.

<key>CFBundleURLTypes</key>
<array>
  <dict>
    <key>CFBundleURLName</key>
    <string>Iceball</string>
    <key>CFBundleURLSchemes</key>
    <array>
      <string>iceball</string>
    </array>
  </dict>
</array>

Note that I haven't tested this at all, will do tomorrow!

rakiru commented 9 years ago

So the application just makes it known that it can handle a certain protocol rather than saying it should be the one that deals with it?

fkaa commented 9 years ago

Pretty much. I think if multiple applications handle the same protocol it will prompt the user to choose a default but I'm not entirely sure..

rakiru commented 9 years ago

I see. I guess we should do that then, whether we do it for anything else or not. I'm still not certain how to deal with Windows.

fkaa commented 9 years ago

From what @iamgreaser said you set some registry key. However it doesn't seem like this should be handled by the application, but rather some kind of installer.

Is it possible to make a .msi with mingw executables? I'm not well versed in the windows hemisphere at all. I think providing an installer would also mix well with #191.

I could possibly also change the OS X packaging process to create a .dmg containing the application, which is the preferred way to distribute applications.

rakiru commented 9 years ago

You can make an MSI with whatever you want. You could make one that installs a JPEG if you wanted.

However, Iceball is a portable application, so we don't have an installer. That's something that should probably be discussed (along with how users should update their game).