Theme Hospital

Informations

Creator Message
Quentin PÂRIS
Admin

Information

This installer has been approved by the team.

Informations

Platforms:
Downloads: 20013
Wine: 1.4-dos_support_0.5

Feedbacks

Source code

#!/bin/bash

# CHANGELOG
# [SuperPlumus] (2011-12-02 20-58)
#   Conversion v3 -> v4
# [Quentin PÂRIS] (2012-04-28 22-39)
#   Using dosbox instead of wine
# [Quentin PÂRIS] (2012-04-28 23-05)
#   Auto-closing dosbox
# [Quentin PÂRIS] (2012-04-29 17-41)
#   Fix CD-ROM Problems
# [Quentin PÂRIS] (2012-08-08 11-02)
#   Check PlayOnLinux version
# [SuperPlumus] (2013-12-08 18-53)
#   Update gettext messages

# Date : (2010-01-19 18-00)
# Last revision : (2013-12-08 18-53)
# Wine version used :
# Distribution used to test : N/A
# Author : Quentin PÂRIS

[ "$PLAYONLINUX" = "" ] && exit
source "$PLAYONLINUX/lib/sources"

TITLE="Theme Hospital"
PREFIX="ThemeHospital"
WORKING_WINE_VERSION="1.4-dos_support_0.5"
export WINEDEBUG="-all"

POL_SetupWindow_Init
POL_Debug_Init

POL_SetupWindow_presentation "$TITLE" "Bullfrog Productions" "" "Wanama" "$PREFIX"

POL_RequiredVersion 4.0.18 || POL_Debug_Fatal "This program requires $APPLICATION_TITLE 4.0.18"


POL_Wine_SelectPrefix "$PREFIX"
POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"

POL_SetupWindow_InstallMethod "CD"

if [ "$INSTALL_METHOD" = "CD" ]; then
    POL_SetupWindow_message "$(eval_gettext 'Please insert the game media into your disk drive.')" "$TITLE"
    POL_SetupWindow_cdrom
    POL_SetupWindow_check_cdrom "autoset.exe"
    POL_SetupWindow_wait "$(eval_gettext 'Please wait...')" "$TITLE"

    POL_Call POL_Install_DosboxDrive

    cd "$CDROM/DOSSETUP"
    POL_Wine_WaitBefore "$TITLE"
    POL_Wine "SETUP.EXE"
fi
if [ "$INSTALL_METHOD" = "LOCAL" ]
then
    cd "$HOME"
    POL_SetupWindow_browse "$(eval_gettext 'Please select the setup file to run')" "$TITLE"
    POL_Wine_WaitBefore "$TITLE"
    POL_Wine start /unix "$APP_ANSWER"
    POL_Wine_WaitExit "$TITLE"
fi

POL_Shortcut "HOSPITAL.EXE" "$TITLE"

POL_SetupWindow_Close
exit 0

Contributions

Filters:

Contribute
Member Message
gargamel Sunday 8 September 2019 at 10:28
gargamel

Warning

This update has not been approved yet by the team.
Use it at your own risk

Message

ChangeLog

  • Added MIDI playback capability
    (require "timidity" GNU/Linux package to be installed)
  • Added capability to install the latest full Theme Hospital patch (THPatch.rar), from both Blustuff and DragonsLover:
    (Require "unrar" GNU/Linux package to be installed)
  • Enhanced install process
  • Upgraded to latest wine-2.x version
    (Because wine-1.x does not work anymore on modern GNU/Linux distributions, due to missing obsolete dependencies)

What works?

  • Nearly everything ;o)

What should be improved?

  • Game runs really fast. Apparently due to old games not designed for multi-core CPU (more info...). As I'm not able to override "wine" launch commandline in POL_Wine, with "taskset -c 1 wine", I'm currently unable to fix that "issue".

Differences

@@ -1,4 +1,5 @@
-#!/bin/bash
+#!/usr/bin/env playonlinux-bash
+# -*- mode: sh -*-
 
 # CHANGELOG
 # [SuperPlumus] (2011-12-02 20-58)
@@ -13,56 +14,105 @@
 #   Check PlayOnLinux version
 # [SuperPlumus] (2013-12-08 18-53)
 #   Update gettext messages
-
+# [Alexandre BEAUGY] (2019-09-08 08-17)
+#   Upgraded wine version
+#   Fixed install process
+#   Added MIDI playback capability
+ 
 # Date : (2010-01-19 18-00)
-# Last revision : (2013-12-08 18-53)
-# Wine version used :
-# Distribution used to test : N/A
-# Author : Quentin PÂRIS
+# Last revision : (2019-09-08 08-17)
+# Wine version used : 2.22
+# Distribution used to test : Debian 10 Buster x86_64
+# Game Version : N/A.
+# Author : SuperPlumus, Quentin PÂRIS et Alexandre BEAUGY
+# Licence : GPLv3
+# PlayOnLinux: 4.3.4
 
-[ "$PLAYONLINUX" = "" ] && exit
-source "$PLAYONLINUX/lib/sources"
+[ "${PLAYONLINUX}" = "" ] && exit 0
+source "${PLAYONLINUX}/lib/sources"
 
+AUTHOR="SuperPlumus, Quentin PÂRIS et Alexandre BEAUGY"
+EDITOR="Bullfrog Productions, Ltd."
 TITLE="Theme Hospital"
 PREFIX="ThemeHospital"
-WORKING_WINE_VERSION="1.4-dos_support_0.5"
-export WINEDEBUG="-all"
+WORKING_WINE_VERSION="2.22"
+DEFAULT_CDROM="/media/cdrom"
+DEFAULT_SETUP="SETUP.EXE"
+DEFAULT_PATCH="THPatch.rar"
 
+# Initialisation
 POL_SetupWindow_Init
 POL_Debug_Init
+POL_System_SetArch "x86" # Force default value, in case it changes one day...
 
-POL_SetupWindow_presentation "$TITLE" "Bullfrog Productions" "" "Wanama" "$PREFIX"
-
-POL_RequiredVersion 4.0.18 || POL_Debug_Fatal "This program requires $APPLICATION_TITLE 4.0.18"
-
-
-POL_Wine_SelectPrefix "$PREFIX"
-POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"
-
-POL_SetupWindow_InstallMethod "CD"
+# Presentation
+POL_SetupWindow_presentation "${TITLE}" "${EDITOR}" "${GAME_URL}" "${AUTHOR}" "${PREFIX}"
 
-if [ "$INSTALL_METHOD" = "CD" ]; then
-    POL_SetupWindow_message "$(eval_gettext 'Please insert the game media into your disk drive.')" "$TITLE"
-    POL_SetupWindow_cdrom
-    POL_SetupWindow_check_cdrom "autoset.exe"
-    POL_SetupWindow_wait "$(eval_gettext 'Please wait...')" "$TITLE"
+# Create prefix
+POL_Wine_SelectPrefix "${PREFIX}"
+POL_Wine_PrefixCreate "${WORKING_WINE_VERSION}"
+
+# Select installer's location: LOCAL or CD 
+setup_file="${POL_SELECTED_FILE}"
+if [ x${setup_file} = x ] ; then
+  POL_SetupWindow_InstallMethod "LOCAL,CD"
+  case "$INSTALL_METHOD" in
+    "CD" )
+      POL_RequiredVersion "4.0.0" || POL_Debug_Fatal "Sorry, $APPLICATION_TITLE 4.0+ is required to install $TITLE from CD-ROM"
+      setup_file=${DEFAULT_CDROM}/${DEFAULT_SETUP}
+      if [ ! -f ${setup_file} ] ; then
+	POL_SetupWindow_message "$(eval_gettext 'Please insert the game media into your disk drive.')" "$TITLE"
+	POL_SetupWindow_cdrom
+	POL_SetupWindow_check_cdrom "${DEFAULT_SETUP}"
+	setup_file="$CDROM_SETUP"
+      fi
+      ;;
+    "LOCAL" )
+      POL_SetupWindow_browse "$(eval_gettext 'Please select the setup file to run')" "$TITLE"
+      setup_file="$APP_ANSWER"
+      ;;
+  esac
+fi
 
-    POL_Call POL_Install_DosboxDrive
+[ "${setup_file}" = "" ] && exit 2
 
-    cd "$CDROM/DOSSETUP"
-    POL_Wine_WaitBefore "$TITLE"
-    POL_Wine "SETUP.EXE"
-fi
-if [ "$INSTALL_METHOD" = "LOCAL" ]
-then
-    cd "$HOME"
-    POL_SetupWindow_browse "$(eval_gettext 'Please select the setup file to run')" "$TITLE"
-    POL_Wine_WaitBefore "$TITLE"
-    POL_Wine start /unix "$APP_ANSWER"
-    POL_Wine_WaitExit "$TITLE"
-fi
+# Configuration
+Set_OS "win98"
+Set_Desktop "On" "640" "480"
+
+# Game's initial install
+POL_Wine_WaitBefore "${TITLE}"
+POL_Wine "${setup_file}"
+POL_Wine_WaitExit "${TITLE}"
+
+POL_SetupWindow_VMS "256"
+
+# Select (latest) patch to install
+POL_SetupWindow_browse "$(eval_gettext 'Please select the (latest) patch file to run')" "${TITLE}" "${DEFAULT_PATCH}"
+setup_file="${APP_ANSWER}"
+
+# Game's (latest) patch install
+pushd "${WINEPREFIX}/drive_c/Program Files/Bullfrog/"
+cp ${setup_file} .
+mkdir THPatch
+pushd THPatch >/dev/null
+unrar x ../THPatch.rar
+file_list=( $(find . -type f) )
+popd >/dev/null
+pushd Hospital >/dev/null
+tar cvf ../THUnpatch.tar ${file_list[*]}
+popd >/dev/null
+cp -arv THPatch/* Hospital/.
+rm -rf THPatch
+popd >/dev/null
 
+# Create Shortcut
 POL_Shortcut "HOSPITAL.EXE" "$TITLE"
 
+# Fix shortcut to allow game play MIDI musics
+# [source: https://doc.ubuntu-fr.org/tutoriel/wine_et_midi#creation_d_un_script_pour_lancer_un_programme_avec_timidity]
+sed -i -e '/source "$PLAYONLINUX/a timidity -iA -B2,8 -Os -EFreverb=0&' "${POL_USER_ROOT}/shortcuts/$TITLE"
+echo "killall timidity" >>"${POL_USER_ROOT}/shortcuts/$TITLE"
+
 POL_SetupWindow_Close
-exit 0
\ No newline at end of file
+exit 0

New source code

#!/usr/bin/env playonlinux-bash
# -*- mode: sh -*-

# CHANGELOG
# [SuperPlumus] (2011-12-02 20-58)
#   Conversion v3 -> v4
# [Quentin PÂRIS] (2012-04-28 22-39)
#   Using dosbox instead of wine
# [Quentin PÂRIS] (2012-04-28 23-05)
#   Auto-closing dosbox
# [Quentin PÂRIS] (2012-04-29 17-41)
#   Fix CD-ROM Problems
# [Quentin PÂRIS] (2012-08-08 11-02)
#   Check PlayOnLinux version
# [SuperPlumus] (2013-12-08 18-53)
#   Update gettext messages
# [Alexandre BEAUGY] (2019-09-08 08-17)
#   Upgraded wine version
#   Fixed install process
#   Added MIDI playback capability
 
# Date : (2010-01-19 18-00)
# Last revision : (2019-09-08 08-17)
# Wine version used : 2.22
# Distribution used to test : Debian 10 Buster x86_64
# Game Version : N/A.
# Author : SuperPlumus, Quentin PÂRIS et Alexandre BEAUGY
# Licence : GPLv3
# PlayOnLinux: 4.3.4

[ "${PLAYONLINUX}" = "" ] && exit 0
source "${PLAYONLINUX}/lib/sources"

AUTHOR="SuperPlumus, Quentin PÂRIS et Alexandre BEAUGY"
EDITOR="Bullfrog Productions, Ltd."
TITLE="Theme Hospital"
PREFIX="ThemeHospital"
WORKING_WINE_VERSION="2.22"
DEFAULT_CDROM="/media/cdrom"
DEFAULT_SETUP="SETUP.EXE"
DEFAULT_PATCH="THPatch.rar"

# Initialisation
POL_SetupWindow_Init
POL_Debug_Init
POL_System_SetArch "x86" # Force default value, in case it changes one day...

# Presentation
POL_SetupWindow_presentation "${TITLE}" "${EDITOR}" "${GAME_URL}" "${AUTHOR}" "${PREFIX}"

# Create prefix
POL_Wine_SelectPrefix "${PREFIX}"
POL_Wine_PrefixCreate "${WORKING_WINE_VERSION}"

# Select installer's location: LOCAL or CD 
setup_file="${POL_SELECTED_FILE}"
if [ x${setup_file} = x ] ; then
  POL_SetupWindow_InstallMethod "LOCAL,CD"
  case "$INSTALL_METHOD" in
    "CD" )
      POL_RequiredVersion "4.0.0" || POL_Debug_Fatal "Sorry, $APPLICATION_TITLE 4.0+ is required to install $TITLE from CD-ROM"
      setup_file=${DEFAULT_CDROM}/${DEFAULT_SETUP}
      if [ ! -f ${setup_file} ] ; then
        POL_SetupWindow_message "$(eval_gettext 'Please insert the game media into your disk drive.')" "$TITLE"
        POL_SetupWindow_cdrom
        POL_SetupWindow_check_cdrom "${DEFAULT_SETUP}"
        setup_file="$CDROM_SETUP"
      fi
      ;;
    "LOCAL" )
      POL_SetupWindow_browse "$(eval_gettext 'Please select the setup file to run')" "$TITLE"
      setup_file="$APP_ANSWER"
      ;;
  esac
fi

[ "${setup_file}" = "" ] && exit 2

# Configuration
Set_OS "win98"
Set_Desktop "On" "640" "480"

# Game's initial install
POL_Wine_WaitBefore "${TITLE}"
POL_Wine "${setup_file}"
POL_Wine_WaitExit "${TITLE}"

POL_SetupWindow_VMS "256"

# Select (latest) patch to install
POL_SetupWindow_browse "$(eval_gettext 'Please select the (latest) patch file to run')" "${TITLE}" "${DEFAULT_PATCH}"
setup_file="${APP_ANSWER}"

# Game's (latest) patch install
pushd "${WINEPREFIX}/drive_c/Program Files/Bullfrog/"
cp ${setup_file} .
mkdir THPatch
pushd THPatch >/dev/null
unrar x ../THPatch.rar
file_list=( $(find . -type f) )
popd >/dev/null
pushd Hospital >/dev/null
tar cvf ../THUnpatch.tar ${file_list[*]}
popd >/dev/null
cp -arv THPatch/* Hospital/.
rm -rf THPatch
popd >/dev/null

# Create Shortcut
POL_Shortcut "HOSPITAL.EXE" "$TITLE"

# Fix shortcut to allow game play MIDI musics
# [source: https://doc.ubuntu-fr.org/tutoriel/wine_et_midi#creation_d_un_script_pour_lancer_un_programme_avec_timidity]
sed -i -e '/source "$PLAYONLINUX/a timidity -iA -B2,8 -Os -EFreverb=0&' "${POL_USER_ROOT}/shortcuts/$TITLE"
echo "killall timidity" >>"${POL_USER_ROOT}/shortcuts/$TITLE"

POL_SetupWindow_Close
exit 0

Replies

Anonymous
Tuesday 10 September 2019 at 6:44
sory not recomend use rar

use p7zip is included on playonlinux and playonmac

Edited by gargamel