HOWTO: Create an application pack

An ApplicationPack is simply an archive of some files which tell wine-doors how to install the application, like a recipe. The application pack can include all of the supporting material for installing the application eg. Registry entries, execution scripts, install scripts, icon files, desktop entries, it can even include the application installer itself.

Requirements

  • Unique name, based on version/revision.
  • pack.xml file

Example

Creating an application pack for a game that Just works(tm) with wine is pretty easy. I'm going to use the game Call of Duty as an example. I'm going to call my ApplicationPack cod-1.4 so I'll create a folder for that application pack

mkdir cod-1.4

Next I need to create a basic pack.xml file which is simply a bit of XML (similar to HTML)

cod-1.4/pack.xml

<?xml version="1.0" encoding="ISO-8859-2" standalone="no"?>
<!DOCTYPE ApplicationPack SYSTEM "http://www.wine-doors.org/dtd/applicationpack.dtd">
<ApplicationPack version="0.1">
  <name>Call of Duty</name>
  <shortname>cod</shortname>
  <major_version>1.4</major_version>
  <version>1.4</version>
  <ms-license>no</ms-license>
  <description>WWII First person shooter. Game of the year 2003</description>
  <vendor>Infinity</vendor>
  <desktop>resources/cod.desktop</desktop>
  <icon>resources/cod.png</icon>
  <homepage>http://www.callofduty.com</homepage>
  <category>Games</category>
  <menu>Games</menu>
  <winecompat version="0.9.30" appdb_rank="Platinum" />
  <winevariant>winehq</winevariant>
  <installersize>N/A</installersize>
  <installedsize>2Gb</installedsize>
  <votes>5</votes>
  <install>resources/install.ahk</install>
  <run>scripts/cod.sh</run>
</ApplicationPack>

and I'll create the desktop file too

cod-1.4/resources/cod.desktop

[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=Call of Duty
Comment=WWII First person shooter
Terminal=false
Type=Application
GenericName[en_US]=WWII First person shooter
Categories=Games

I'll add the icon file and now if I archive this up I have an application pack

tar -cvzf cod-1.4.wdi cod-1.4

This will not overwrite the cod-1.4.wdi file if it allready exist (maybe this is your second try). In this case do a

rm cod-1.4.wdi

and then create the archive.

Installing the application pack

To try out your newly created application pack do

bin/wine-doors --install cod-1.4.wdi

Troubleshooting a faulty application pack

If you get XML parse errors, where wine-doors complains about invalid tokens, open the pack.xml in firefox (or any other browser I suppose), it will show up any malformed tags

If you have changed the application pack, but you get the same errors, delete all instances of the application pack from the wine-doors cache like so

 rm ~/.wine-doors/apppacks/cod-1.4.wdi
 rm -r ~/.wine-doors/apppacks/cod-1.4

remember also to delete the cod-1.4.wdi from the directory where you are creating the application pack, before you create the *.wdi archive (the tar command)

Before you give up, try the mailing list for some help.

Optional extras

ApplicationPacks? can of course store a lot more information than simply how to find the installer and some text describing it. You can bundle all kinds of things into them...

  • registry files <winereg>resources/myregistryhacks.reg</winereg>
  • scripts <install>scripts/install.sh</install> or <install>scripts/install.ahk</install> for AutoHotKey scripts
  • icon files <icon>resources/myicon.png</icon>
  • desktop files <desktop>resources/mydesktop.desktop</desktop

Multi-CD hack

Call of duty requires this mutli-cd hack

Run D:\Setup.exe
WinWaitActive Insert CD
RunWait resources/eject.exe D:
WinWaitClose Insert CD
WinWaitActive Insert CD
RunWait resources/eject.exe D:

using the resource utility eject.exe

Notes on registry files

Wine-doors does not have a *=native,builtin override if your application requires a native dll file, then please specify this in the supporting registry files like so

[HKEY_CURRENT_USER\Software\Wine\AppDefaults\myapp.exe\DllOverrides]
"shdocvw"="native,builtin"
"shlwapi"="native,builtin"

Registry files are installed when they are found.

Notes on scripts

Scripts are executed from the root of the ApplicationPack, in other words from the folder containing pack.xml, you can therefore reference any resource file you like from the scripts easily. If it is a AutoHotKey script it must end with a *.ahk extension. If it is a unix shell script it must end with a *.sh extension.

Notes on icon and desktop files

The desktop file should always exclude the Icon and Exec lines in the file, these are automatically added on install of the application to reflect where the application is installed to. A typical wine-doors FDO.Desktop file looks like this;

[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=Call of Duty
Comment=WWII First person shooter
Terminal=false
Type=Application
GenericName[en_US]=WWII First person shooter
Categories=Games

Notes on packlist entries

  • <default_version>version</default_version> points to a valid <pack major-version="version"></pack>
  • <pack major-version="version"></pack> matches in pack.xml with <major_version></major_version>
  • <wdi ... version="version"></wdi> matches in pack.xml with <version>version</version>

Notes on install paths

  • The installer can be executed from a relative path resources/installer.exe
  • The installer can be executed from;
    • D:\\Setup.exe which can be an exact drive letter or a substitute for cd
    • d:/Setup.exe
    • CDROM:/Setup.exe

which will search any mounted filesystem including loop back file systems of iso9660 or similar type.

  • The installer can be browsed for when identification fails