In this chapter we will see how to install some software from a CD/DVD, or how to download it if it is available from the Internet.
PlayOnMac allows to easily install a software from a CD/DVD.
POL_SetupWindow_cdrom
POL_SetupWindow_cdrom

The path to the CD/DVD will be stored in the variable $CDROM (for example $CDROM value could be: /media/cdrom0).
POL_SetupWindow_check_cdrom "path/to/some/file/on/the/CD"
POL_SetupWindow_check_cdrom "Data/media1.dat"
Check if this file exists, otherwise run POL_SetupWindow_cdrom again.
Try to choose some file specific to the expected CD, not Setup.exe, autorun.inf, and the like.
With PlayOnMac you can easily download files from the Internet. This is specially useful for software that is available for free from the 'net.
POL_Download "URL" "MD5 digest of the file"
MD5 Digest, what is that?
The MD5 digest is some code that looks like b1bbd74395a34ff7fd069d3b6fe23016, that's unique for each file.
It's used to make sure that the downloaded file is not corrupted (as it sometimes happens, because of download errors).
To compute the MD5 digest of a file, use the following command in a console/terminal:
Terminal output:
md5 "/path/to/some/setup.exe"
The file downloaded will be written in the current working directory (as selected with the cd command). Most of the time, the right place for downloaded files is the temporary directory, created by the command POL_System_TmpCreate. To put files in the temporary directory, use the following command right before POL_Download:
cd "$POL_System_TmpDir"
cd "$POL_System_TmpDir" POL_Download "http://www.example.com/download/setup.exe" "b1bbd74395a34ff7fd069d3b6fe23016"
The file will be named after the name of the file on the server, so if the URL looks like, say: http://www.example.com/download/setup.exe, the downloaded file will be called setup.exe.
How to ask the user what installation method he wants to use?
Poof, here comes the function POL_SetupWindow_InstallMethod. This function will ask the user from what media he wants to install a program.
POL_SetupWindow_InstallMethod "Installation methods"
Many different installation methods exist, but let's start with the 4 most simple ones (and the most common).
Some existing methods:
LOCAL: The user will select a file from his computer.
DOWNLOAD: Download the installation file from the Internet.
CD: Install the program from a CD.
DVD: Install the program from a DVD.
The methods available to the user should be separated with commas.
The method selected by the user will be returned in the variable $INSTALL_METHOD. You can then use a combinaison of if, then, elif, then and fi to determine what method has been choosen, and act accordingly. Details will be given in the next chapter.
POL_SetupWindow_InstallMethod "LOCAL,DOWNLOAD"

Creating a launcher (or shortcut) in PlayOnMac is extremely easy, look:
POL_Shortcut "Executable.exe" "Name of the launcher"
POL_Shortcut "JediKnightII.exe" "Star Wars: Jedi Knight II"
You should not specify the whole path to the executable, PlayOnMac will find it automatically.