# Documentation

## polApp Files, v0.0.1

### Overview

A single ".polApp" file contains the whole program. You can only have one prefix per polApp file.
It contains :

- A version file
- A configuration file
- The wine prefix (which contains "drive_c", "dosdevices" and "*.reg")
- The lunch scripts (usually located in "configurations/installed"). They also contains the wine version to use.
- The 32x32 icons if needed (usually located in "icones/32"), one per lunch script

A polApp file is a c501tar archive, please read c501tar section.
Example tar ball content:

> version
> config
> prefix.tar.bz2
> installed
> |==> Notepad++
> |==> Notepad++ update
> \==> Notepad++ another exe
> icons_32x32
> |==> Notepad++
> \==> Notepad++ update

### c501tar

A c501tar file is a container for files.
I created it because I was unable to send pipe results directly to tar.
The first 4k of this file contains the archive header. The permissions are not managed by this format.
Header example:

> #C501tar_HEADER_v1.0.0#
> filename_1|position (in 512 bytes blocs)|file size (bytes)
> file2.tar.bz2|position (in 512 bytes blocs)|file size (bytes)
> filename_3|position (in 512 bytes blocs)|file size (bytes)
> #END_OF_HEADER#

The rest of the c501tar file contains the files content.

### The version file

Charset: utf-8
Name: "version"
It only contains "0.0.1", the current version.

### The configuration file

Charset: utf-8
Name: "config"
Structure: field=value

Example:

> name=Notepad++
> comment=A good text editor.
> prefixSize=5.6G
> prefixCompressionMethod=bz2

Field | Value
--- | ---
name | The application's name.
comment | A small description.
prefixSize | The humain readable prefix size (uncompressed).
prefixCompressionMethod | The prefix compression method. Only bz2 is avaible.

### The wine prefix

Name: prefix.tar.bz2
The wine prefix.

### Directory "installed"

It contains the PlayOnLinux lunch scripts. /home/$USER/.PlayOnLinux should be replaced with %PLAYONLINUX_HOME%.
Example:

> #!/bin/bash
> export WINEPREFIX="%PLAYONLINUX_HOME%/wineprefix/NotepadPlusPlus"
> export WINEDEBUG="-all"
> cd "%PLAYONLINUX_HOME%/wineprefix/NotepadPlusPlus/drive_c/Program Files/Notepad++"
> wine "notepad++.exe" $@

### Directory "icons_32x32" and "icons_full_size"

It contains the 32x32 icons and the full sized icons. They are named before the script name. If no icon exists for a script, the default icon will be used.
Format: png, jpg, xpm...