Create a script for PlayOnLinux - Chapter 5: Wine

Who's that guy?

This is the PlayOnLinux's engine. This piece of software, developed by WineHQ allows you to run under Linux softwares designed for Windows

In this chapter, I will show you some important functions of PlayOnLinux related to Wine, but not all. For the more technical functions, I invite you to read the MulX's documentation.

A prefix's matter

PlayOnLinux manages Wine's prefixes. To explain it, nothing is better than a good scheme.

Under Wine, a game's installation looks like that:

Under PlayOnLinux, we could rather sum it up like that:

The interest: it allows to have a specific configuration of Wine for each games, and a game's uninstallation is extremly simple (you just have to remove a folder)

Managing the prefixes with PlayOnLinux

Two commands:

select_prefix

A prefix can contains only alpha-numeric characters

Selects the prefix. Any command beginning with "wine" or "regedit" will act in this prefix

select_prefix "$HOME/.PlayOnLinux/wineprefix/Steam/"

Will select the Steam's prefix

polprefixcreate

polprefixcreate

Allows to create the prefix or to update it. Necessary before each installation

Asking for the CD-ROM

Only one command: Ask_For_cdrom. The result is stocked in the $CDROM variable

Ask_For_cdrom

Verifying the CD-ROM presence

Checks if the file exists, else, runs Ask_For_cdrom

Check_cdrom "/path/to/a/file/of/the/CD"

Using Wine to run a .exe

Runs a .exe file in the selected prefix

Examples:

wine $CDROM/setup.exe wine d:\\setup.exe wine /home/plouf/my_file.exe

Creating a launcher in PlayOnLinux

The syntax is the following:

creer_lanceur "Name_of_the_prefix" "Directory" "Executable" "" "Launcher's name"

Example:

creer_lanceur "JediKnightII" "Program Files/LucarsArt" "JediKnightII.exe" "" "Star Wars : Jedi Knight II"

Assigning a Wine's version to a launcher

If your game doesn't work with the last Wine's version, this function will can be useful

Set_WineVersion_Assign "Launcher's name" "Wine's version"

It has to be ran after creer_lanceur