Difference between revisions of "Scripting - Chapter 5: Wine"

From PlayOnLinux
Jump to: navigation, search
(Page créée avec « == Who's that? == This is the engine behind PlayOnLinux. This software is developed by [https://www.winehq.org/ WineHQ], and permits applications that were created for Wi... »)
 
(Get rid of "start /unix" in the tutorial)
(Tag: visualeditor)
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
== Who's that? ==
 
== Who's that? ==
  
This is the engine behind PlayOnLinux. This software is developed by [https://www.winehq.org/ WineHQ], and permits applications that were created for Windows to run on Linux and Mac OS X.
+
'''Wine''' is a free implementation of the Windows API; that is to say, it allows you to use Linux or Mac OS X to run software designed for Microsoft Windows. It is developed by [https://www.winehq.org/ WineHQ]. This is the engine behind '''PlayOnLinux/PlayOnMac'''.
  
 
In this chapter, I will show you some important PlayOnLinux functions in regard to Wine, but not all of them. For the more technical functions, you should read the [[Scripting - Chapter 11: List of Functions|List of Functions]], which lists them all.
 
In this chapter, I will show you some important PlayOnLinux functions in regard to Wine, but not all of them. For the more technical functions, you should read the [[Scripting - Chapter 11: List of Functions|List of Functions]], which lists them all.
Line 19: Line 19:
 
The point being: It allows you to have a specific configuration per program, and the uninstallation of a program is simplified (you just have to remove a folder).
 
The point being: It allows you to have a specific configuration per program, and the uninstallation of a program is simplified (you just have to remove a folder).
  
== We'll now see some usual commands to manage Wine prefixes with PlayOnLinux. ==
+
== Typical commands to manage Wine prefixes with PlayOnLinux. ==
  
 
=== Select a prefix ===
 
=== Select a prefix ===
Line 57: Line 57:
 
'''Syntax:'''
 
'''Syntax:'''
 
<pre class="playonlinux code">
 
<pre class="playonlinux code">
POL_Wine start /unix "path/to/the/file.exe"
+
POL_Wine "path/to/the/file.exe"
 
</pre>
 
</pre>
  
 
'''Example:'''
 
'''Example:'''
 
<pre class="playonlinux code">
 
<pre class="playonlinux code">
POL_Wine start /unix "/home/user/file.exe"
+
POL_Wine "/home/user/file.exe"
 
</pre>
 
</pre>
  
 
<pre class="playonlinux code">
 
<pre class="playonlinux code">
POL_Wine start /unix "$APP_ANSWER"
+
POL_Wine "$APP_ANSWER"
 
</pre>
 
</pre>
  
Line 86: Line 86:
 
<pre class="playonlinux code">
 
<pre class="playonlinux code">
 
POL_SetupWindow_wait "Please wait" "Installation in progress"
 
POL_SetupWindow_wait "Please wait" "Installation in progress"
POL_Wine start /unix "path/to/some/file.exe"
+
POL_Wine "path/to/some/file.exe"
 
</pre>
 
</pre>
  

Latest revision as of 22:42, 19 March 2015

Who's that?

Wine is a free implementation of the Windows API; that is to say, it allows you to use Linux or Mac OS X to run software designed for Microsoft Windows. It is developed by WineHQ. This is the engine behind PlayOnLinux/PlayOnMac.

In this chapter, I will show you some important PlayOnLinux functions in regard to Wine, but not all of them. For the more technical functions, you should read the List of Functions, which lists them all.

The Prefixes (aka virtual disks)

PlayOnLinux manages Wine's prefixes. Nothing better than an illustration to explain this.

With Wine, the installation of a game looks like this:

wine_en.jpg

With PlayOnLinux, it can be summed up this way:

playonlinux_en.jpg

The point being: It allows you to have a specific configuration per program, and the uninstallation of a program is simplified (you just have to remove a folder).

Typical commands to manage Wine prefixes with PlayOnLinux.

Select a prefix

Syntax:

POL_Wine_SelectPrefix "PrefixName"

A prefix name should only contain alphanumerical characters (roughly meaning no spaces, no special chars). Avoid short cryptic prefix names like WoW; use something like WorldOfWarcraft.

Example:

POL_Wine_SelectPrefix "Steam"

Will select Steam's prefix (must be done even if the prefix doesn't exist yet).

Create a prefix (after having selected it)

Syntax:

POL_Wine_PrefixCreate

Example:

POL_Wine_PrefixCreate

ch05-01.en.png

Will either create or update a prefix. It is necessary before each installation.

Use Wine to run an .exe file

Syntax:

POL_Wine "path/to/the/file.exe"

Example:

POL_Wine "/home/user/file.exe"
POL_Wine "$APP_ANSWER"

The 2nd example show how to run an executable selected by the user through the command POL_SetupWindow_browse.

Display a "please wait" message

It's sometimes useful to display a "please wait" message while commands are running. This is particularly useful for the command POL_Wine that will last as long as the program it launched has not completed (hence, in the case of an installation, until the installation is over).

Syntax:

POL_SetupWindow_wait "Message" "Title"
# Commands

You can put as many commands as you want; The "please wait" message will stay around until another command affecting the window is used.

Example:

POL_SetupWindow_wait "Please wait" "Installation in progress"
POL_Wine "path/to/some/file.exe"

ch05-02.en.png

Use of a specific version of Wine

It is possible to assign some version of Wine to a game (independently of the version of Wine installed system-wide). This is particularly useful for large games or applications, whose performance may vary from version to version of Wine. This can also be used if some software has stopped working with recent versions of Wine.

To do this, you just have to add an argument to the function POL_Wine_PrefixCreate:

Syntax:

POL_Wine_PrefixCreate "Version of Wine"

Example:

POL_Wine_PrefixCreate "1.3.4"

Previous: Chapter 4: Conditions

Next: Chapter 6: The Filesystem