Hi!
I am a new Linux/Ubuntu user and before leaving definitively windows, I am experimenting with the inastallation of my games using PlayOnLinux.. My first try is with the game "Banished!" form Shining Rock Software. You can get the game either through a Steam or GoG download or directrly from Shining Rock. I have the GoG version.
My objective was to create a script to allow the game installation from either one of these three sources: Steam, Gog or locally after a manual download, but this is way over my current expertise!
Here what I have done so far, any help to finish it would be appreciated:
#!/bin/bash
# Date : (2014-08-17 21-00)
# Last revision : (2014-08-17 21-00)
# PlayOnLinux: 4.2.4
# Wine version used : 1.7.19
# Distribution used to test : Ubuntu 14.04 x64
# Author : LeLorrain
# Program License : Retail
# Script License: GPL
# Only For : http://www.playonmac.com
# CHANGELOG
# [LeLorrain] (2014-08-17 21-00)
# Initial incomplete submission
# ------------------------------------------------
# Verify that PlayOnLinux is installed
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
TITLE="Banished!"
# Versionm number from Shining Rock Software
VERSION="1.0.3"
PREFIX="Banished_TEST"
WORKING_WINE_VERSION="1.7.19"
GAME_VMS="256"
# GOG data
GOGID="BANISHED"
GOGVERSION="2.2.0.6"
# Steam flag (to be added later when known!!)
STEAM_FLAG="999999"
# Desktop setup
DESTOP="on"
WIDTH="1024"
HEIGHT="768"
# Setup the display graphics
#POL_GetSetupImages "http://files.playonlinux.com/resources/setups/$PREFIX/top.jpg" "http://files.playonlinux.com/resources/setups/$PREFIX/left.jpg" "$TITLE"
# Setup Windows environment
POL_SetupWindow_Init
# ?? (to be added later when known!!)
POL_SetupWindow_SetID 9999
# PoL Debugging
POL_Debug_Init
# Presentation
POL_SetupWindow_presentation "Banished!" "Shining Rock Software" "http:://http://www.shiningrocksoftware.com/game/" "LeLorrain" "$PREFIX"
# Setting prefix path
POL_Wine_SelectPrefix "$PREFIX"
# Downloading wine if necessary and creating prefix
POL_System_SetArch "x86"
POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"
# Set to windows/7 Sp1
POL_SetupWindow_Message "Seting up the environment to Windows/7 sp1" "$TITLE"
#Set_OS "win7" "sp1"
POL_SetupWindow_VMS "GAME_VMS"
Set_Desktop "$DESKTOP" "$WIDTH" "$HEIGHT"
# Choose between STEAM or GOG Digital Download or Local version
POL_SetupWindow_Message "Choose between STEAM or GOG Digital Download or Local version" "$TITLE"
POL_SetupWindow_InstallMethod "STEAM,DOWNLOAD,LOCAL"
POL_SetupWindow_Message "Installing mandatory dependencies" "$TITLE"
# Installing mandatory components
if [ "$INSTALL_METHOD" == "STEAM" ]; then
POL_Call POL_Install_steam
POL_Call POL_Install_vcrun2008
elif
POL_Call POL_Install_d3dx10
fi
POL_Call POL_Install_CoreFonts
if [ "$INSTALL_METHOD" = "STEAM" ]; then
POL_SetupWindow_message "$(eval_gettext 'Do not forget to close Steam when downloading\nis finished, so that $APPLICATION_TITLE can continue\nto install your game.')" "$TITLE"
cd "$WINEPREFIX/drive_c/$PROGRAMFILES/Steam"
POL_Wine start /unix "steam.exe" steam://install/$STEAM_FLAG
POL_Wine_WaitExit "$TITLE"
elif [ "$INSTALL_METHOD" = "DOWNLOAD" ]; then
# Set the setup in drive_c/windows/temp
POL_Config_Write GOGREPO "$WINEPREFIX/drive_c/windows/temp"
# Download online installer (to be verified!!)
POL_GOG_Download "$GOGID" "2c8a10ebd02f68fd71999ba4e60055ab"
POL_Wine_WaitBefore "$TITLE"
POL_SetupWindow_wait "Please wait" "Installation in progress"
POL_Wine "$GOGREPO/setup_banished_$GOGVERSION.exe"
POL_Wine_WaitExit "$TITLE"
else
# Asking then installing the game
POL_SetupWindow_browse "$(eval_gettext 'Please select the setup file to run:')" "$TITLE"
SETUP_EXE="$APP_ANSWER"
POL_SetupWindow_wait "Please wait" "Installation in progress"
POL_Wine start /unix "$SETUP_EXE"
POL_Wine_WaitExit "$TITLE"
fi
# Setup the program shortcut
POL_Shortcut "Application-x86.exe" "Banished! x86"
POL_SetupWindow_Close
exit 0
Edited by Tinou