1. Nick Daly
  2. GemRB Launcher


GemRB Launcher /

Filename Size Date modified Message
66 B
328 B
17.6 KB
7.6 KB
618 B
5.8 KB
12.7 KB
69.6 KB
4.3 KB
Nick Daly
    Email: myownlittlworld@hotmail.com
    Jabber: zanzabo@clanthac0.com

        A GemRB launcher that handles everything automagically?  Really?  Yup.
        Copyright (C) 2009 Nick Daly

        This program is free software; you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
        the Free Software Foundation; either version 2 of the License, or
        (at your option) any later version.

        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        GNU General Public License for more details.

        You should have received a copy of the GNU General Public License along
        with this program; if not, write to the Free Software Foundation, Inc.,
        51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

        See the file "COPYING" for more details.

    1. Intro.
    2. Setup Instructions
        A. CD Configuration Instructions
            i. CDs Copied to HD
            ii. CD images
            iii. CD images with CD# subdirectories
        B. Running Instructions
    3. Hacking Instructions

1. Intro

A GemRB launcher that handles everything automagically?  Really?  Yup.

Proof that my boss doesn't give me enough work every day, this is a GemRB
launcher that:

1. Sets up an appropriate config file (really, just copies an already existing one)
2. Does startup configuration
3. Starts the game
4. Does shutdown configuration

For more information, check the launcher page on the GemRB wiki:

2. Setup Instructions

To run it:

You'll need gksu (it's pretty standard, you should have it already) or
  fuseiso and fusermount.
You'll need pyGTK.
You'll need gemrb.

A. CD Configuration Instructions

Copy your regular GemRB.cfg file to each of:

You'll have to configure each config file for each individual game, so set the 
game_type, the title, and the CD data.

i. CDs Copied to HD

The CD data is a bit tricky, so be wary here.  If you've gone and copied the 
game data from each CD into directories on your system (or used the "full 
install" option in the installer), just set the CD1 through CD(whatever) 
variables to the correct directories, and you're done.

I don't believe GemRB currently works with using the actual CDs (it won't 
prompt you to "Insert Disc #...", and crashes instead), so I won't cover that 
here.  If it does become possible to use the actual CDs with GemRB, it should 
be possible to use the actual CDs by setting the CD1...CD# variables to your CD 
drive's directory (usually /media/cdrom).

ii. CD images

If you want to do things the complicated way and you've made CD images that 
exist on your harddrive, the launcher can cope with that too.  You'll need to 
add an extra entry or two per CD to your config file.

The first entry you'll need to add is:
This value tells the launcher where to find the CD image itself (usually 
something.iso) so it knows what it needs to mount.

At this point, the launcher can do one of two things: If mounting the CD to the
specified directory satisfies GemRB, you're done.  However, if you bought the 
games sometime after the initial release (especially for BG1:TOS) and have the 
weird omni-cds (CDs which in turn contain directories like CD2, CD3, CD4, etc - 
technically, they can be called "meta-discs", as they're discs that themselves 
contain other discs), you'll have to differentiate between the point where the 
CD image is mounted and the place that GemRB reads each CD's data from.

iii. CD images with CD# subdirectories

Let's take an example, the third disc of BG:TOS (the original Baldur's Gate 
with the Tales of the Sword Coast expansion included, sold some time in the 
early 2000's - a 3 CD set in total, encompassing the data of 6 discs).

A directory listing of CD3:

As you can see, the third CD contains 3 subdirectories, each containing one of 
the original six discs in and of itself, making things annoyingly complex for 
the rest of us who tend to assume that 1 CD acutally is 1 CD.  The launcher, 
however, can handle even this strange situation.  You'll need to add another 
entry in your config file though:
This tells the launcher where to mount a disc, great when using meta-discs like 
this one.  The trick is to mount the meta-disc itself as a primary directory 
and then have gemrb search for the CD data in the sub-directories.  In the case
of BG:TOS CD3, your config file would look like:

    # the disc image

    # where to mount the disc image
    # where GemRB will read the CD data from

Just remember, each disc image contains the data from several CDs.  GemRB needs
to see each individual CD's data, not the list of CD folders.  I know it's 
confusing, but blame BlackIsle for making it confusing...

One last note about mounting CDs: If you're a member of the "fuse" group and 
the necessary executable files are available ("fuseiso" and "fusermount"), any 
disc images you need to mount will go through fuseiso, negating the need for 
root privileges.  If you're not a "fuse" member, the program will attempt to 
acquire root privileges to mount and unmount the necessary discs.  This should 
not be dangerous (the r/w/x privileges are set conservatively when the file is
made - and you can check the contents of the file before running it if you'd 
like) but, as always, be smart and trust no one.  Especially not the guy who 
tells you to trust him.

B. Running Instructions

Open a console, and type:
    ./autorun-gemrb.py [config_directory]

The config directory argument is optional and overrides the value found in the
autorun script itself. This should prevent you from needing to edit the script
at all, allowing it to be installed in a read-only location.

Then, watch the console output and hope it works.

I've tested it for Baldur's Gate 1 and 2, though it should work for all the
rest of the games, and you shouldn't need to do anything but set up the config
files for each game you plan on playing.

Hope you like it!

3. Hacking Instructions

To hack on it (to, say, add another game):

You'll also need Glade-3.

Open up the autorun-gemrb.glade file in glade-3, it should be somewhat
self-explanatory (I tried to keep it as simple as possible).

The key to note is that everything is based on the widget's names.  If you name
a button "play_the_mystery_of_fangdoodle", the launcher will search for a .cfg 
file named "mystery_of_fangdoodle.cfg".

The launcher will strip everything before and including the first underscore "_"
from the widget's name.  You could call it "fly_the_mystery_of_fangdoodle" and
it would still do the same thing.

    Add your widget (set "Border Relief=None" for the sexy transparent effect)
        You can use any widget that responds to clicking, not just buttons!
        Or you can make a container button and add any widget you want!
    make sure it fires some "on_clicked" event
    edit the background as necessary (you can use .svg, .png, and probably
        .jpg, or any other picture format your heart desires)
    connect your widget's signal to the play_game method
    create the correct config file
    Enjoy and bask in your greatness!