Red: Required argument.
Orange : Required argument if further arguments are present, but can be left empty ("").
Blue : Optional argument, but in some cases required.
Green : Optional argument.
#1: URL of top image.
#2: URL of left image.
#3: Name of the directory where to store the images (often $TITLE).
Download top and left images of the script from the PlayOnMac site.
Must be used before POL_SetupWindow_Init.
POL_GetSetupImages "http://files.playonlinux.com/resources/setups/AC2/top.jpg" "http://files.playonlinux.com/resources/setups/AC2/left.jpg" "$TITLE"
Opens the installation wizard window.
POL_SetupWindow_Init
Closes the installation wizard window.
POL_SetupWindow_Close
Note: All the functions below need the command POL_SetupWindow_Init to be executed beforehand.
#1: Software name (often $TITLE).
#2: Software publisher.
#3: Site of the publisher.
#4: Script author.
#5: Prefix name (usually $PREFIX).
Present the software.
POL_SetupWindow_presentation "$TITLE" "Mozilla" "http://www.mozilla.com" "SuperPlumus and NSLW" "$PREFIX"
#1: Software name (often $TITLE).
#2: Message.
Present the software with more freedom than POL_SetupWindow_presentation.
POL_SetupWindow_free_presentation "$TITLE" "Welcome to Mozilla Firefox installation wizard."
#1: Message.
#2: Title (often $TITLE).
Display a message.
POL_SetupWindow_message "Hello world!" "$TITLE"
#1: Program that must be present.
#2: Package that contains this program.
Check the availability of one or more programs required by the script.
Call check_one as many times as needed (once per program), then use POL_SetupWindow_missing.
check_one "p7zip" "p7zip" POL_SetupWindow_missing
#1: Message.
#2: Title (often $TITLE).
#3: File to display.
Display the content of a file.
POL_SetupWindow_file "Changelog" "$TITLE" "$POL_System_TmpDir/changelog.txt"
#1: Message.
#2: Title (often $TITLE).
#3: File to display.
Similar to the command POL_SetupWindow_file, but adds an "I agree" checkbox.
Useful for displaying licenses.
POL_SetupWindow_licence "Licence:" "$TITLE" "$POL_System_TmpDir/licence.txt"
#1: Message.
#2: Title (often $TITLE).
#1: Percentage.
#1: Current text.
Display a progression bar, from 0 to 100%.
POL_SetupWindow_pulsebar display the progression bar.
POL_SetupWindow_pulse changes the progression value, from 0 to 100%.
POL_SetupWindow_set_text modifies the current message (different from POL_SetupWindow_pulsebar message).
POL_SetupWindow_pulsebar "Installing patchs 1 to 5." "$TITLE" POL_SetupWindow_set_text "Installation of patch 1 in progress" POL_Wine start /unix "$POL_System_TmpDir/patch1.exe" POL_SetupWindow_pulse "20" # meaning 20% POL_SetupWindow_set_text "Installation of patch 2 in progress" POL_Wine start /unix "$POL_System_TmpDir/patch2.exe" POL_SetupWindow_pulse "40" POL_SetupWindow_set_text "Installation of patch 3 in progress" POL_Wine start /unix "$POL_System_TmpDir/patch3.exe" POL_SetupWindow_pulse "60" POL_SetupWindow_set_text "Installation of patch 4 in progress" POL_Wine start /unix "$POL_System_TmpDir/patch4.exe" POL_SetupWindow_pulse "80" POL_SetupWindow_set_text "Installation of patch 5 in progress" POL_Wine start /unix "$POL_System_TmpDir/patch5.exe" POL_SetupWindow_pulse "100"
#1: Message.
#2: Title (often $TITLE).
Display an indeterminate progress bar.
POL_SetupWindow_wait "Please wait" "$TITLE"
#1: Message.
#2: Title (often $TITLE).
#3: Default value.
Display some window asking the user to type in something.
What the user typed is returned in the $APP_ANSWER variable.
POL_SetupWindow_textbox "Votre pseudo :" "$TITLE"
#1: Message.
#2: Title (often $TITLE).
#3: Default value.
Similar to POL_SetupWindow_textbox, but typing happens on several lines.
What the user typed is returned in the $APP_ANSWER variable.
POL_SetupWindow_textbox_multiline "Enter a description for the program" "$TITLE"
#1: Message.
#2: Title (often $TITLE).
#3: Default file.
Ask the user to select a file.
The path of the file selected by the user is returned in the $APP_ANSWER variable.
POL_SetupWindow_browse "Please select the program." "$TITLE"
#1: Message.
#2: Title (often $TITLE).
Ask a question to the user (that can be answered by Yes or No).
Answer is returned in the $APP_ANSWER variable (TRUE for Yes, FALSE for No).
POL_SetupWindow_question "Message" "Titre"
#1: Message.
#2: Title (often $TITLE).
#2: Available choices.
#2: Separator character (often ~ or -).
Display a menu to the user, asking him to select one entry among the choices provided.
The choice selected by the user is returned in the $APP_ANSWER variable.
POL_SetupWindow_menu "What's your favorite color?" "$TITLE" "Red~Green~Blue" "~"
#1: Message.
#2: Title (often $TITLE).
#2: Available choices.
#2: Separator character (often ~ or -).
Similar to the command POL_SetupWindow_menu except that instead of returning the name of the selected choice (Red for example), it returns the position of the selected choice in the list, as a number (0 being the 1st choice).
The choice selected by the user is returned in the $APP_ANSWER variable.
POL_SetupWindow_menu_num "What's your favorite color?" "$TITLE" "Red~Green~Blue" "~"
$APP_ANSWER will contain 0 if the user selected Red, 1 for Green, or 2 for Blue.
#1: Message.
#2: Title (often $TITLE).
#2: Available choices.
#2: Separator character (often ~ or -).
#3: Default choice.
Similar to the command POL_SetupWindow_menu but displays a drop-down list.
The choice selected by the user is returned in the $APP_ANSWER variable.
POL_SetupWindow_menu_list "What's your favorite color?" "$TITLE" "Red~Green~Blue" "~"
#1: Message.
#2: Title (often $TITLE).
#2: Available choices.
#2: Separator character (often ~ or -).
Show a list of options and checkboxen to the user, asking him to select the option(s) he wants.
The option(s) selected by the user are returned in the $APP_ANSWER variable.
POL_SetupWindow_checkbox_list "What are your favorite colors?" "$TITLE" "Red~Green~Blue" "~" if [ "$(echo $APP_ANSWER | grep -o "Red")" != "" ] then # Red was selected fi if [ "$(echo $APP_ANSWER | grep -o "Green")" != "" ] then # Green was selected fi if [ "$(echo $APP_ANSWER | grep -o "Blue")" != "" ] then # Blue was selected fi
Ask the user to select him CD/DVD.
The path to the drive selected by the user is returned in the $CDROM variable.
POL_SetupWindow_cdrom
#1: File that must be present.
Check that the file specified exists on the CD/DVD. If it doesn't, execute POL_SetupWindow_cdrom again.
Should be used right after POL_SetupWindow_cdrom.
POL_SetupWindow_check_cdrom "Data/32_icon.ico"
#1: Comma separated list of installation methods available.
Ask the user want installation method he wants, among the available choices.
LOCAL, CD, DVD, DOWNLOAD, STEAM, STEAM_DEMO.
The choice selected by the user is returned in the $INSTALL_METHOD variable.
POL_SetupWindow_InstallMethod "LOCAL,CD,STEAM"
#1: Executable filename.
#2: Launcher name (often $TITLE).
#3: Name of the icon to download from PlayOnMac website.
#4: Executable arguments.
Create a launcher in PlayOnMac.
The command POL_Wine_SelectPrefix must have been used beforehand.
POL_Shortcut "firefox.exe" "$TITLE"
#1: Launcher name (often $TITLE).
#2: Command to add.
Allows to run an extra command each time a program will be about to start.
POL_Shortcut_InsertBeforeWine "Jedi Knight II" "export __GL_ExtensionStringVersion=17700"
#1: URL to open.
Opens an URL in the user's default Internet browser.
POL_Browser "http://www.playonlinux.com"
#1: Name of the temporary directory (often $PREFIX).
Creates the temporary directory dedicated to the script.
$POL_System_TmpDir will contain the path of the created temporary directory.
POL_System_TmpCreate "$PREFIX"
Removes the script's temporary directory.
POL_System_TmpDelete
#1: Supported architectures (see below).
Set the (Wine) architectures supported by the script.
auto: Use the version of Wine matching the system architecture (Wine x86 on x86 and Wine x64 on amd64)
x86: Use the x86 version of Wine for installation (useful if the program doesn't work well with the x64 version)
amd64: Use the x64 version of Wine for installation (if the system architecture is x86, the script stops).
POL_System_SetArch "auto"
#1: Function name.
#2, #3, etc.: Function arguments, if necessary (very few functions take arguments).
Download and execute a script from the Functions category (the list is available here).
For most functions, the commands POL_Wine_SelectPrefix and POL_Wine_PrefixCreate must have been used beforehand.
POL_Call POL_Install_vcrun6
#1: Prefix name (often $PREFIX).
Select the prefix that will be used by Wine (mandatory, even if the prefix hasn't been created yet).
POL_Wine_SelectPrefix "$PREFIX"
#1: Prefix name (often $PREFIX.
Check if a prefix exists (useful for game extensions and patches).
The function displays True if the prefix exists, and False otherwise.
if [ "$(POL_Wine_PrefixExists "$PREFIX")" = "False" ] then # The préfixe doesn't exist fi
#1: Wine version.
Creates or updates a prefix. It is possible to use a version of Wine different from the one installed system wide on user's computer, by specifying this version as first argument.
The command POL_Wine_SelectPrefix must have been used beforehand.
POL_Wine_PrefixCreate "1.3.4"
This command works exactly like the "wine" command, but uses the Wine versions management of PlayOnMac.
Note: Using start /unix can fix issues of access and installation paths with several CD/DVD.
The commands POL_Wine_SelectPrefix and POL_Wine_PrefixCreate must have been used beforehand.
POL_Wine "Setup.exe" POL_Wine start /unix "Setup.exe"
#1: Minimum amount of RAM required, in MB.
Ask the user how much (dedicated) RAM his videocard has.
The commands POL_Wine_SelectPrefix and POL_Wine_PrefixCreate must have been used beforehand.
POL_SetupWindow_VMS "128"
#1: Windows version to emulate.
#2: Service pack.
Modifies the Windows version emulated by Wine.
Default value: winxp (Windows XP).
Windows versions: win7, vista, win2003, winxp, win2k, winnt, winme, nt40, win98, win95, win31.
Services packs: sp1, sp2, sp3.
The commands POL_Wine_SelectPrefix and POL_Wine_PrefixCreate must have been used beforehand.
Set_OS "win2k"
#1: On/Off.
Set if the window manager will be allowed to manage Wine windows.
Default value: On.
The commands POL_Wine_SelectPrefix and POL_Wine_PrefixCreate must have been used beforehand.
Set_Managed "Off"
#1: alsa/oss/esd.
Set the audio driver Wine will use.
Note: This command does nothing under PlayOnMac, since it is useless in that environment.
The commands POL_Wine_SelectPrefix and POL_Wine_PrefixCreate must have been used beforehand.
Set_SoundDriver "alsa"
#1: Setting to create/modify.
#2: New setting value.
Creates or modifies a registry setting below key [HKEY_CURRENT_USER\Software\Wine\Direct3D].
See WineHQ's Wiki.
The commands POL_Wine_SelectPrefix and POL_Wine_PrefixCreate must have been used beforehand.
POL_Wine_Direct3D "UseGLSL" "disabled"
#1: Setting to create/modify.
#2: New setting value.
Creates or modifies a registry setting below key [HKEY_CURRENT_USER\Software\Wine\X11 Driver].
See WineHQ's Wiki.
The commands POL_Wine_SelectPrefix and POL_Wine_PrefixCreate must have been used beforehand.
POL_Wine_X11Drv "DXGrab" "Y"
#1: Setting to create/modify.
#2: New setting value.
Creates or modifies a registry setting below key [HKEY_CURRENT_USER\Software\Wine\DirectSound].
See WineHQ's Wiki.
The commands POL_Wine_SelectPrefix and POL_Wine_PrefixCreate must have been used beforehand.
POL_Wine_DirectSound "HardwareAcceleration" "Emulation"
#1: Setting to create/modify.
#2: New setting value.
Creates or modifies a registry setting below key [HKEY_CURRENT_USER\Software\Wine\DirectInput].
See WineHQ's Wiki.
The commands POL_Wine_SelectPrefix and POL_Wine_PrefixCreate must have been used beforehand.
POL_Wine_DirectInput "MouseWarpOverride" "force"
#1: Setting to read (the key is not required).
This function returns the value of a setting from the registry.
The commands POL_Wine_SelectPrefix and POL_Wine_PrefixCreate must have been used beforehand.
The function displays the value of the specified setting.
VALUE="$(POL_Wine_GetRegValue "MouseWarpOverride")"
#1: On/Off.
#2: Virtual desktop width (if it is enabled).
#3: Virtual desktop height (if it is enabled).
Sets the Wine virtual desktop settings.
The commands POL_Wine_SelectPrefix and POL_Wine_PrefixCreate must have been used beforehand.
Set_Desktop "On" "1024" "768"
#1: Virtual desktop name.
Set the title of the virtual desktop window (purely aesthetic effect).
The commands POL_Wine_SelectPrefix and POL_Wine_PrefixCreate must have been used beforehand.
Set_WineWindowTitle "$TITLE"
This command installs standard (but not installed by default) fonts into the prefix.
The commands POL_Wine_SelectPrefix and POL_Wine_PrefixCreate must have been used beforehand.
POL_Wine_InstallFonts
Set correct video driver (when Wine fails to do it properly).
The commands POL_Wine_SelectPrefix and POL_Wine_PrefixCreate must have been used beforehand.
POL_Wine_SetVideoDriver
#1: Mode of override.
#2, #3, #4, etc.: DLL names (without .dll suffix).
Set the override mode for one or more dynamic library(ies).
native, builtin, native,builtin, builtin,native, or empty value ("") to disable the DLL(s).
The commands POL_Wine_SelectPrefix and POL_Wine_PrefixCreate must have been used beforehand.
POL_Wine_OverrideDLL "native" "msvcrt" POL_Wine_OverrideDLL "" "msvcrt" # To disable the DLL
#1: Executable name.
#2: Mode of override.
#3, #4, #5, etc.: DLL names (without .dll suffix).
Set the override mode for one or more dynamic library(ies), but only for a specific program.
native, builtin, native,builtin, builtin,native, or empty value ("") to disable the DLL(s).
The commands POL_Wine_SelectPrefix and POL_Wine_PrefixCreate must have been used beforehand.
POL_Wine_OverrideDLL_App "firefox.exe" "native" "msvcrt" POL_Wine_OverrideDLL_App "firefox.exe" "" "msvcrt" # To disable the DLL
#1: Program name.
Wait for the completion of the program started with the POL_Wine command.
The commands POL_Wine_SelectPrefix and POL_Wine_PrefixCreate must have been used beforehand.
POL_Wine_WaitExit "$TITLE"
Emulate a Windows reboot.
The commands POL_Wine_SelectPrefix and POL_Wine_PrefixCreate must have been used beforehand.
POL_Wine_reboot
Start debugging system.
POL_Debug_Init
#1: Message.
Write a message to the installation log (not shown to the user).
The command POL_Debug_Init must have been used beforehand.
POL_Debug_Message "Modifying config.cfg file."
#1: Message.
Write a warning message to the installation log (not shown to the user).
The command POL_Debug_Init must have been used beforehand.
POL_Debug_Warning "File config.cfg did not exist, creating one."
#1: Message.
Write an error message to the installation log (The user receives the error message, but the script goes on).
The command POL_Debug_Init must have been used beforehand.
POL_Debug_Error "Error while modifying config.cfg file"
#1: Message.
Raises a fatal error (the script is immediately aborted).
The command POL_Debug_Init must have been used beforehand.
POL_Debug_Fatal "Error while modifying config.cfg file"