Ultima 1+2+3 Edition

Auteur Réponses
sgalland Samedi 14 Avril 2012 à 21:27

Hello, I have been trying to figure out how to get Ultima 1+2+3 to work with Wine and I finally broke down and wrote a POL Script. I hope you enjoy it.

PS. I was unable to get the icon parameter to work. If someone can give me an example of how to set it I would be very happy to modify the script.


# Date : (2012-04-10 23:39)
# Last revision : (2012-04-10 23:39)
# Wine version used : 1.3.36
# Distribution used to test : Ubuntu 11.10
# Author : Sean Galland
# Script licence : GPL 2
# Program licence : Closed Source
# Depend : None
[ -z "$PLAYONLINUX" ] && exit 0
source "$PLAYONLINUX/lib/sources"


TITLE="Ultima 1+2+3 ("


POL_SetupWindow_presentation "$TITLE" "Origin Systems" "$URL" "Sean Galland" "$PREFIX"

if [ -z "$POL_SELECTED_FILE" ]; then
POL_SetupWindow_question "$(eval_gettext 'Do you want to download $TITLE from')" "$TITLE"
[ "$APP_ANSWER" = "TRUE" ] && POL_Browser "$URL"

POL_Wine_SelectPrefix "$PREFIX"

if [ -n "$POL_SELECTED_FILE" ]; then
cd $HOME
POL_SetupWindow_browse "$(eval_gettext 'Please select the setup file to run.')" "$TITLE" "$INSTALLBIN"

POL_SetupWindow_wait "$(eval_gettext 'Please wait while $TITLE is installed.')" "$TITLE"
POL_Wine start /unix "$ARCHIVE" || POL_Debug_Fatal "$(eval_gettext 'Error while installing archive')"
POL_Wine_WaitExit "$TITLE"

Set_OS winxp
POL_SetupWindow_VMS "16"

POL_SetupWindow_make_shortcut "$PREFIX" "$PROGRAMFILES/ Trilogy/Ultima1/" "C:/$PROGRAMFILES/ Trilogy/DOSBOX/DOSBox.exe" "" "Ultima 1" "" "-conf dosboxULTIMA1.conf -noconsole"
POL_SetupWindow_make_shortcut "$PREFIX" "$PROGRAMFILES/ Trilogy/Ultima2/" "C:/$PROGRAMFILES/ Trilogy/DOSBOX/DOSBox.exe" "" "Ultima 2" "" "-conf dosboxULTIMA2.conf -noconsole"
POL_SetupWindow_make_shortcut "$PREFIX" "$PROGRAMFILES/ Trilogy/Ultima3/" "C:/$PROGRAMFILES/ Trilogy/DOSBOX/DOSBox.exe" "" "Ultima 3" "" "-conf dosboxULTIMA3.conf -noconsole"


Edité par sgalland

petch Samedi 14 Avril 2012 à 22:38

To answer your question, POL_SetupWindow_make_shortcut, beside being obsoleted by POL_Shortcut, could only take an icon from PlayOnLinux web server, so you need some access to the server to store icons.

You should use POL_Shortcut instead, eventually later overwriting the icons generated (~/.PlayOnLinux/icones/32/shortcutname and ~/.PlayOnLinux/icones/full_size/shortcutname) with a 32x32 icon for the former, a square icon for the latter, using cp or convert (or another method).
Since 4.0.17 there's a way to take icons from GOG's gfw_high.ico (see for an example). All this may change, there's room for improvements in the area of icons handling.

Note that start /unix is almost always useless and will prevent POL from automatically stopping the installer if the user aborts the script, so it's better to remove it.

Beside that, we've been working on several features lately that could help you improve your script:

- GOG integration, now scripts can download the games from by themselves. The POL_GoG_setup function takes a game identifier (the end of game's page URL) and the MD5 hash of the different parts of the installer, and will by itself either accept local files, or initiate a download. It returns with $POL_GoG_location containing the path of the install binary, so all you need is to execute it. The script mentioned above can also be used as an example of this feature. You can follow the "Last changes" link on the page to see what I needed to adapt in the script.

- DOSBox integration, it's brand new so it's still a bit rough on the edges, but it already works well, using native DOSBox (and this is the mandatory method for scripts for DOS games to enter the official repository). Basically all you need to do is to use a Wine version with DOSBox support (say, 1.4-dos_support)! Worse case, if the [autoexec] section of GOG's dosbox.conf file does more than change directories, start the game and exit, you may have to write an autoexec.bat batch file at the root of the drive_c virtual disk with the extra statements. If you want an example of this, you can check

As you can see, things have been moving fast around GOG's integration! I hope that's not too overwhelming...
Feel free to ask for explanations if something is not clear, as this is all undocumented for now...

Last but not least, I'm very pleased to see people interested in writing PlayOnLinux scripts for GOG games!

Regards, Pierre.

Edité par petch

sgalland Mardi 24 Avril 2012 à 6:46

Thanks for the feedback. I will implement those changes.
sgalland Mardi 8 Mai 2012 à 16:33

How exactly do you use POL_GoG_setup? I tried using:

POL_GoG_setup "ultima_1_2_3" "397c41df72e3f15a65132d942a69a1db"

and nothing happens. I tried using POL_SetupWindow_Init prior to POL_Gog_setup and a window shows up but it is emtpy. I assume I am doing something wrong.
Quentin PÂRIS Mardi 8 Mai 2012 à 16:45
Quentin PÂRIS

POL_Call POL_GoG_setup "ultima_1_2_3" "397c41df72e3f15a65132d942a69a1db"
sgalland Vendredi 11 Mai 2012 à 8:59

Sorry for another questions - I am trying to use POL_Shortcut so I can specify the configuration file for DOSBox. It doesn't seem to be able to find the file:

POL_Shortcut "DOSBox.exe" "Ultima 1" "~/.PlayOnLinux/wineprefix/ULTIMATRILOGY_GOG/drive_c/Program Files/ Trilogy/Ultima1/gfw_high.ico" "-conf $WINEPREFIX/drive_c/$PROGRAMFILES/ Trilogy/Ultima1/dosboxULTIMA1.conf" #"-conf C:/$PROGRAMFILES/ Trilogy/Ultima1/dosboxULTIMA1.conf"

I have tried both formats, first using the path in the comment and the path that is in the last parameter of the function call. I am just not sure what format to use to specify the path to the DOSBox configuration file.

petch Vendredi 11 Mai 2012 à 10:43

Ok, since it evolved since my last message on the topic, I'll give a try at a

DOSBox support HOWTO

* First, you must use some "Wine version" with dos support for your virtual disk, latest is currently 1.4-dos_support_0.4;

* DOSBox will get default settings from this support. To override some, you'll need a $WINEPREFIX/playonlinux_dos.cfg file; Lines must have the format:
See DOSBox 0.74 documentation for valid section and setting names; For example

Remark 1: this file will be sourced, so be sure to single quote values that could be interpreted by Bash;
Remark 2: there's a new set of functions POL_Config_DosPrefixRead / POL_Config_DosPrefixWrite / POL_Config_DosPrefixDelete to manage those files, but they only exist since POL 4.0.18, so if you use them you'll also need to add POL_RequiredVersion "4.0.18" just after POL_SetupWindow_Init.

* The C: drive will be mapped to the virtual disk root, and by default the support will try to map the same drives as the Wine environment. If you don't want the latter, just C: mapping, you can add the pseudo-setting manual_mount=true

* If there's an autoexec.bat file at the root of your virtual disk, it will be interpreted at the beginning of each DOSBox session in this virtual disk. It's the recommended place to put mount and imgmount statements.

* That should be enough to create working shortcuts on exe files in this virtual disk; The support can tell apart MS-DOS from Windows executables and start DOSBox when necessary.

* You should also be able to create shortcuts on MS-DOS batch (bat) files if they start with an @ECHO OFF line so they're recognized as such (by the "file" command actually). You'll also probably want an EXIT statement at the end of batch files so the DOSBox window closes itself after program exit (unless debug mode is enabled for the shortcut).

* If you have specific needs, like starting MS-DOS com files, or set shortcut-specific initializations, you can create extra batch files and make shortcut out of them.

That's mostly all there is to it. The fact that C: drive is always mapped to the root of the virtual disk sometimes requires some arrangements during installation, like moving some files around back into the root directory of the virtual disk.
The Linux-to-DOSBox path translation ("shortizing") in the support is not perfect; Another reason for further arrangements are subdirectories with similar prefix side-by-side, you may also have to give them standard MS-DOS names (8+3 characters) to work around this problem.

Edité par petch

petch Vendredi 11 Mai 2012 à 11:52

I know Quentin has done some DOSBox scripts, like (I don't know the full list):

- Indiana Jones and the Fate of Atlantis
- Prince Of Persia - Original
- Theme Hospital
- Warcraft II: Beyond the Dark Portal
- Warcraft II: Tides of Darkness

and mines:

- Good Old Games - Betrayal at Krondor Pack
- Good Old Games - Earthworm Jim
- The Elder Scrolls: Arena
- The Elder Scrolls: Daggerfall
- Good Old Games - Gabriel Knight 1: Sins of the Fathers
- Good Old Games - Little Big Adventure
- Good Old Games - Might and Magic 6-Pack
- Good Old Games - Realms of the Haunting
- Good Old Games - Redneck Rampage Collection
- Good Old Games - Screamer (in testing category, the game is not very stable)
- Good Old Games - Simcity 2000 Special Edition
- Good Old Games - Starflight 1 and 2
- Good Old Games - Stonekeep
- Good Old Games - The Last Express
- Good Old Games - Theme Hospital

Hope this gives you some examples for dos support usage...
petch Lundi 18 Juin 2012 à 19:34

Latest version is 1.4-dos_support_0.5, with some fixes for Arch Linux (I think this is all?)
petch Mardi 29 Janvier 2013 à 18:51

Latest version is 1.4-dos_support_0.6, that fixes some missing configuration keys, and has better Unix to DOS path translation (gives exact result more often; can still be wrong if several paths resolve to the same shortname).

Edité par petch

petch Mardi 29 Janvier 2013 à 19:19

New scripts using native DOSBox support:
- - Alien Breed and Tower Assault
- - Alone in the Dark 1, 2 and 3
- - Bioforge
- - Crusader: No Remorse
- - Crusader: No Regret
- - Darklands
- - Dragonsphere
- - Duke Nukem 3D Atomic Edition
- - Gabriel Knight 2: The Beast Within
- - Gabriel Knight 3: Blood of the Sacred, Blood of the Damned
- - Lands of Lore 1 & 2
- - Little Big Adventure 2
- - Master of Magic
- - Master of Orion 1 & 2
- - Normality
- - One Unit Whole Blood
- - Pirates Pack
- - Populous 2
- - Realms of Arkania 1, 2 and 3
- - Screamer 2
- - Space Quest 4, 5, 6
- - Spycraft: the Great Game
- - Syndicate
- - Tex Murphy: The Pandora Directive
- - Tex Murphy: Under a Killing Moon
- - The Incredible Machine Mega Pack
- - Torin's Passage
- - Tyrian 2000
- - Ultima 4
- - Ultima Underworld 1 & 2
- - Ultima Worlds of Adventure 2: Martian Dreams
- - Wing Commander 1 & 2
- - Worlds of Ultima: The Savage Empire
petch Mercredi 2 Avril 2014 à 23:49

Latest version is 1.6.2-dos_support_0.6, which is basically the same DOSBox support but grafted on top of Wine 1.6.2 instead of 1.4, which may be necessary if they're issues with installation using Wine 1.4.x.