The forum

[script] Age of Empires 1

Author Replies
henu Sunday 23 May 2010 at 19:41
henuAnonymous

Here is my first POL-script. It installs Age of Empires 1 and patches it to 1.0c using the correct one of two language packs. I didn't read much of style instructions, so this script might have some ugly hacks. Sorry about them.

The game does not run very well. Sometimes loading of save games fails and texts at menus are completely black (on a dark background). I haven't found any ways to fix these problems, but at least now that I have this script, it might be easier in future.

#!/bin/bash

# Do PlayOnLinux initialization
[ "$PLAYONLINUX" = "" ] && exit
source "$PLAYONLINUX/lib/sources"

# Open main window
POL_SetupWindow_Init

# ================================
# Introduction
# ================================

POL_SetupWindow_presentation "Age of Empires 1" "Ensemble Studios" "http://www.ensemblestudios.com/" "Henrik Heino" "age_of_empires_1"


# ================================
# Wine prefix
# ================================

select_prefix "$HOME/.PlayOnLinux/wineprefix/AgeOfEmpires1/"
POL_SetupWindow_prefixcreate

# Also get some variables
C_DRIVE=$(winepath -u "C:")


# ================================
# CD check
# ================================

# TODO: Make this to be done automatically and check for more files!
#POL_SetupWindow_check_cdrom "/aoesetup.exe"
POL_SetupWindow_cdrom

echo 
echo Age of Empires 1 CD found from $CDROM
echo 


# ================================
# Installation
# ================================

wine $CDROM/aoesetup.exe

AOE_LOCATION="$PROGRAMFILES/Microsoft Games/Age of Empires"
# TODO: Verify that AOE was installed to correct directory!
echo "Age of Empires should have been installed to $AOE_LOCATION"


# ================================
# Patching
# ================================

# Select correct patch, based on language
POL_SetupWindow_menu "Which language pack are you using?" "Select your language" "English/German/French~Spanish/Italian/Portuguese" "~"

LANGUAGE_SEL=$APP_ANSWER
if [ $LANGUAGE_SEL = "English/German/French" ]then
	AOE_PATCH_URL="http://download.microsoft.com/download/aoe/Patch/1.0c/W9X/EN-US/AOEPATCH.exe"
else
	AOE_PATCH_URL="http://download.microsoft.com/download/aoe/Patch/1.0c/W9X/PT-BR/AOEPATCH.exe"
fi

echo "Selected URL for the patch is: $AOE_PATCH_URL"

cd "$C_DRIVE/$AOE_LOCATION"
POL_SetupWindow_download "Please wait while patch is being downloaded..." "Patching to 1.0c" "$AOE_PATCH_URL"

POL_SetupWindow_message "The patch has been downloaded. Now continue and follow instructions of patch!" "Patch the game to 1.0c"

wine AOEPATCH.exe


# ================================
# Shortcut creation
# ================================

POL_SetupWindow_make_shortcut "AgeOfEmpires1" "$AOE_LOCATION" "Empires.exe" "" "Age of Empires 1"


# ================================
# Cleaning
# ================================

# Close main window
POL_SetupWindow_Close

exit

Edited by henu