2013-05-25 05:48:03 +00:00
|
|
|
==================
|
|
|
|
Writing installers
|
|
|
|
==================
|
|
|
|
|
2013-06-09 22:00:52 +00:00
|
|
|
Fetching required files
|
|
|
|
=======================
|
|
|
|
|
2013-06-17 22:05:32 +00:00
|
|
|
The ``files`` section of the installer references every file needed for
|
2014-01-24 12:05:24 +00:00
|
|
|
installing the game. This section's keys are unique identifier used later in
|
|
|
|
the ``installer`` section. The value can either be a string containing a URI
|
|
|
|
pointing at the required file or a dictionary containing the ``filename`` and
|
|
|
|
``uri`` keys. The ``uri`` key is equivalent to passing only a string to the
|
|
|
|
installer and the ``filename`` key will be used to give the local copy another
|
|
|
|
name.
|
2013-06-09 22:00:52 +00:00
|
|
|
|
2013-06-17 22:05:32 +00:00
|
|
|
If the game contains copyrighted files that cannot be redistributed, the value
|
2013-07-11 16:15:32 +00:00
|
|
|
should begin with ``N/A``. When the installer encounter this value, it will
|
|
|
|
prompt the user for the location of the file. To indicate to the user what file
|
2014-02-09 13:39:39 +00:00
|
|
|
to select, append a message to ``N/A`` like this:
|
|
|
|
``N/A:Please select the installer for this game``
|
2013-07-11 16:15:32 +00:00
|
|
|
|
2013-06-09 22:00:52 +00:00
|
|
|
|
2013-06-17 22:05:32 +00:00
|
|
|
If the game makes use of (Windows) Steam data, the value should be
|
2014-02-09 13:39:39 +00:00
|
|
|
``$WINESTEAM:appid:path/to/data``. This will check that the data is available
|
2013-06-09 22:00:52 +00:00
|
|
|
or install it otherwise.
|
|
|
|
|
2014-01-24 12:05:24 +00:00
|
|
|
|
2013-06-18 00:13:03 +00:00
|
|
|
Installer meta data
|
|
|
|
===================
|
|
|
|
|
2014-01-24 12:05:24 +00:00
|
|
|
Referencing the main file
|
|
|
|
---------------------------
|
|
|
|
|
|
|
|
For Linux and Wine games, specify the executable file with the ``exe``
|
2014-02-09 11:29:27 +00:00
|
|
|
directive. The given path is relative to the game dir.
|
2014-01-24 12:05:24 +00:00
|
|
|
|
|
|
|
Examples:
|
|
|
|
``exe: game.sh``
|
|
|
|
``exe: drive_c/Program Files/Game/game.exe``
|
|
|
|
|
|
|
|
For emulator games, in case you don't ask the user to select the rom
|
|
|
|
directly but make the installer extract it from an archive or something, you
|
|
|
|
can reference the rom like this: ``main_file: file.rom``.
|
|
|
|
|
2013-06-18 00:13:03 +00:00
|
|
|
Installing mods and add-ons
|
|
|
|
---------------------------
|
|
|
|
|
|
|
|
Mods and add-ons require that a base game is already available on the system.
|
2014-01-24 12:05:24 +00:00
|
|
|
You can let the installer know that you want to install an add-on by specifying
|
2013-06-28 10:15:37 +00:00
|
|
|
the ``requires`` directive. The value of ``requires`` must be the canonical
|
2013-06-18 00:13:03 +00:00
|
|
|
slug name of a game, not one of its aliases. For example, to install the add-on
|
2013-06-28 10:15:37 +00:00
|
|
|
"The reckoning" for Quake 2, you should add:
|
2013-06-18 00:13:03 +00:00
|
|
|
|
|
|
|
``requires: quake-2``
|
|
|
|
|
2014-01-24 12:05:24 +00:00
|
|
|
|
2013-06-17 22:05:32 +00:00
|
|
|
Writing the installation script
|
|
|
|
===============================
|
|
|
|
|
2014-01-24 12:05:24 +00:00
|
|
|
After every file needed by the game has been aquired, the actual installation
|
2013-06-17 22:05:32 +00:00
|
|
|
can take place. A series of directives will tell the installer how to set up
|
|
|
|
the game correctly.
|
2013-05-25 05:48:03 +00:00
|
|
|
|
2013-05-25 11:08:39 +00:00
|
|
|
Displaying an 'Insert disc' dialog
|
|
|
|
----------------------------------
|
|
|
|
|
2013-05-26 16:43:42 +00:00
|
|
|
The ``insert-disc`` command will display a message box to the user requesting
|
2013-05-25 11:08:39 +00:00
|
|
|
him to insert the game's disc into the optical drive. A link to CDEmu homepage's
|
2013-05-26 16:43:42 +00:00
|
|
|
and PPA will also be displayed if the program isn't detected on the machine,
|
2013-05-25 11:08:39 +00:00
|
|
|
otherwise it will be replaced with a button to open gCDEmu.
|
|
|
|
|
2014-01-24 12:05:24 +00:00
|
|
|
You can override this default text with the ``message`` parameter.
|
2013-05-25 11:08:39 +00:00
|
|
|
|
2013-06-17 22:05:32 +00:00
|
|
|
Moving files and directories
|
|
|
|
----------------------------
|
2013-05-25 05:48:03 +00:00
|
|
|
|
2013-05-26 16:43:42 +00:00
|
|
|
Move files by using the ``move`` command. ``move`` requires two parameters:
|
2013-05-25 05:48:03 +00:00
|
|
|
``src`` and ``dst``.
|
|
|
|
|
2014-01-24 12:05:24 +00:00
|
|
|
The ``src`` parameter can either be a ``file id`` or a path relative to game
|
2014-02-09 11:29:27 +00:00
|
|
|
dir. If the parameter value is not found in the list of file ids,
|
2014-01-24 12:05:24 +00:00
|
|
|
then it must be prefixed by either ``$CACHE`` or ``$GAMEDIR`` to move a file or
|
|
|
|
directory from the download cache or the game's install dir, respectively.
|
2013-05-25 05:48:03 +00:00
|
|
|
|
2013-05-26 16:43:42 +00:00
|
|
|
The ``dst`` parameter should be prefixed by either ``$GAMEDIR`` or ``$HOME``
|
|
|
|
to move files to path relative to the game dir or the current user's home
|
2013-05-25 05:48:03 +00:00
|
|
|
directory.
|
|
|
|
|
|
|
|
The ``move`` command cannot overwrite files.
|
2013-05-26 16:43:42 +00:00
|
|
|
|
2013-06-28 10:15:37 +00:00
|
|
|
Example:
|
|
|
|
|
|
|
|
::
|
2013-07-11 16:15:32 +00:00
|
|
|
|
2013-06-28 10:15:37 +00:00
|
|
|
move:
|
|
|
|
src: game-file-id
|
2014-02-09 11:29:27 +00:00
|
|
|
dst: $GAMEDIR/location
|
2013-07-11 16:15:32 +00:00
|
|
|
|
2013-06-17 22:05:32 +00:00
|
|
|
Copying and merging directories
|
|
|
|
-------------------------------
|
|
|
|
|
2013-06-28 10:15:37 +00:00
|
|
|
Both merging and copying actions are done with the ``merge`` directive.
|
2014-01-24 12:05:24 +00:00
|
|
|
Whether the action does a merge or copy depends on the existence of the
|
2013-06-28 10:15:37 +00:00
|
|
|
destination directory. When merging into an existing directory, original files
|
2014-01-24 12:05:24 +00:00
|
|
|
with the same name as the ones present in the merged directory will be
|
|
|
|
overwritten. Take this into account when writing your script and order your
|
|
|
|
actions accordingly.
|
2013-06-17 22:05:32 +00:00
|
|
|
|
2013-06-28 10:15:37 +00:00
|
|
|
Example:
|
|
|
|
|
|
|
|
::
|
2013-07-11 16:15:32 +00:00
|
|
|
|
2013-06-28 10:15:37 +00:00
|
|
|
merge:
|
|
|
|
src: game-file-id
|
2014-02-09 11:29:27 +00:00
|
|
|
dst: $GAMEDIR/location
|
2013-06-28 10:15:37 +00:00
|
|
|
|
2013-06-17 22:05:32 +00:00
|
|
|
Extracting archives
|
|
|
|
-------------------
|
2013-05-26 16:43:42 +00:00
|
|
|
|
2013-06-28 10:15:37 +00:00
|
|
|
Extracting archives is done with the ``extract`` directive, the ``file``
|
2013-07-11 16:15:32 +00:00
|
|
|
argument is a ``file id``. If the archive should be extracted in some other
|
2013-06-28 10:15:37 +00:00
|
|
|
location than the ``$GAMEDIR``, you can specify a ``dst`` argument.
|
|
|
|
|
2014-02-09 11:29:27 +00:00
|
|
|
You can optionally specify the archive's type with the ``format`` option.
|
|
|
|
This is useful if the archive's file extension does not match what it should
|
|
|
|
be. Accepted values for ``format`` are: zip, tgz, gzip and bz2.
|
|
|
|
|
2013-07-11 16:15:32 +00:00
|
|
|
Example:
|
2013-06-28 10:15:37 +00:00
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
extract:
|
|
|
|
file: game-archive
|
2014-02-09 11:29:27 +00:00
|
|
|
dst: $GAMEDIR/datadir/
|
2013-06-28 10:15:37 +00:00
|
|
|
|
|
|
|
Making a file executable
|
|
|
|
------------------------
|
|
|
|
|
|
|
|
Marking the file as executable is done with the ``chmodx`` command. It is often
|
2014-01-24 12:05:24 +00:00
|
|
|
needed for games that ship in a zip file, which does not retain file permissions.
|
2013-06-28 10:15:37 +00:00
|
|
|
|
|
|
|
Example: ``chmodx: $GAMEDIR/game_binary``
|
|
|
|
|
2014-01-24 12:05:24 +00:00
|
|
|
Executing a file
|
|
|
|
----------------
|
|
|
|
|
|
|
|
Execute files with the ``execute`` directive. Use the ``args`` parameter to add
|
|
|
|
command arguments, and ``file`` to reference a ``file id``.
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
execute:
|
|
|
|
args: --argh
|
|
|
|
file: great-id
|
|
|
|
|
2013-07-11 16:15:32 +00:00
|
|
|
Running a task provided by a runner
|
|
|
|
-----------------------------------
|
|
|
|
|
2014-02-09 11:29:27 +00:00
|
|
|
Some actions are specific to some runners, you can call them with the ``task``
|
2013-07-11 16:15:32 +00:00
|
|
|
command. You must at least provide the ``name`` parameter which is the function
|
|
|
|
that will be called. Other parameters depend on the task being called.
|
|
|
|
|
|
|
|
Currently, the following tasks are implemented:
|
|
|
|
|
|
|
|
wine: ``wineexec`` Runs a windows executable. Parameters are ``executable``,
|
|
|
|
``args`` (optional arguments passed to the executable), ``prefix`` (optional
|
2014-01-24 22:05:15 +00:00
|
|
|
WINEPREFIX), ``workdir`` (optional working directory).
|
2013-07-11 16:15:32 +00:00
|
|
|
|
|
|
|
wine: ``winetricks`` Runs winetricks with the ``app`` argument. ``prefix`` is
|
|
|
|
an optional WINEPREFIX path.
|
|
|
|
|
2013-05-26 16:43:42 +00:00
|
|
|
|
2014-01-24 12:05:24 +00:00
|
|
|
Trying the installer locally
|
|
|
|
============================
|
|
|
|
|
|
|
|
If needed (i.e. you didn't download the installer first from the website), add
|
|
|
|
the ``runner`` and ``name`` directives. The value for ``runner`` must be the
|
|
|
|
slug name for the runner. (E.g. winesteam for Steam Windows.)
|
|
|
|
Save your script in a file and use the following command in a terminal:
|
|
|
|
``lutris -i /path/to/file``
|
|
|
|
|
|
|
|
|
|
|
|
Calling the online installer
|
|
|
|
============================
|
2013-05-26 16:43:42 +00:00
|
|
|
|
2014-01-24 12:05:24 +00:00
|
|
|
The installer can be called with the ``lutris:<game-slug>`` url scheme.
|