Linux Game Development Part 3
Installers
Additional HintsDepending on which installer you choose, it may or may not provide all of the features that you need. So here are some miscellaneous tidbits to help make up for any deficiencies in the installer system you choose. Where to Install Some of the installers are LSB-compliant, but others are not. You should ensure that your game is installed into the correct place according to the LSB. The LSB directory standards for installation can be found here. Startup Script Remember the script for launching your game that I presented in the last article? The paths in that example script were hard-coded for my specific development environment. As a result, that script would probably not work on anyone else’s computer. When you choose an installer, you’ll want to pick one that will allow you to auto-generate a startup script for your game. You want the script to point to the install path provided by the user. With Bitrock, you can do this via the “addTextToFile” tag in the XML project file, and by using the ${installdir} variable. I know InstallJammer provides a way to do this too, but I am not familiar with the specifics. Desktop/menu shortcuts At the time this article was written, Bitrock did not provide a way to add menu entries to the system menu. I worked with their engineers to figure out a way to do it, and they are currently adding this functionality to Bitrock. However, for the benefit of those who might choose other installers lacking this functionality, you need to use the XdgUtils tools. You can find these tools here. The specific tool you are interested in is xdg-desktop-menu, which allows you to install submenus and menu entries into the system menu of any LSB-compliant distribution. With Bitrock, I included the xdg-desktop-menu tool and the menu entry files in my installer, and I tweaked the XML to auto-generate a postinstall script that would invoke xdg-desktop-menu to install my menu entry files on the user’s system. This same solution works for InstallJammer, and will probably work for other installers as well. Command Line Access Some Linux users prefer to use the command line, rather than desktop or menu shortcuts. Other users have Fluxbox or another window manager that is not LSB-compliant, which means they will not get any desktop or menu shortcuts, so they will be forced to run your game from the command line. Therefore, it’s a good idea to put a symbolic link somewhere in the PATH. That way, people can launch the game by typing its name (or more appropriately the name of the script that launches your game) without having to first cd to the game’s install directory. Bitrock provides an easy way to do this via the “addDirectoryToPath” tag in the XML project file. Symbolic Links I’ve noticed that on some distributions, for whatever reason, the system will look for dynamic libraries that end in .so, and on others it looks for the specific version of the dynamic library, like .so.0.8. I have no idea why this is, but when you include your custom libraries in your installer (which we talked about last time), you need to make sure the end user’s system can find them, regardless of how you named them. To do that, your installer should create symbolic links to each of your custom libraries for all of the possible names that the system might use to try and find them. If you look for the version of the library that comes with your distribution, and you go to the directory where it is installed (.e.g, /usr/lib), you can usually see the symbolic links it created for the library. Then you just need to configure your installer to create similar links to your custom library in your install directory. Bitrock provides an easy way to do this via the “createSymLink” tag in the XML project file. I believe InstallJammer can also do this, based on what I’ve seen with the two aforementioned commercial games that use it.
|