The forum

[Script] GOG.com Seven Kingdoms - Ancient Adversaries

Needs manual work after calling the script

Author Replies
markus_s Saturday 7 December 2013 at 20:57
markus_sAnonymous

Hi,

I am working on a script for the GOG-Version of Seven Kingdoms - Ancient Adversaries. Unfortunately, the games only seems to work on Linux if the exe provided on 7kfans.com is used (e.g. http://sourceforge.net/projects/skfans/files/Seven%20Kingdoms%20AA/Executables/7kaa-patch-2.13.2.zip/download). Note that the game is under GPL and thus it is legal to use this exe. Is it possible to streamline this in the installation script, i.e., after the normal installation automatically download the exe-file, unzip it and copy it in the folder, where the games was installed?

In the following is my script so far (basically copy/paste from another GOG-script, but aside from the issue descriped above it works)

#!/bin/bash
# Date : (2013-12-07 10-47)
# Wine version used : 1.4.1
# Distribution used to test : Ubuntu 12.04.2
# Author : markus_s
# Script licence : GPL v.2
# Program licence : Retail
# Depend :
 
[ -z "$PLAYONLINUX" ] && exit 0
source "$PLAYONLINUX/lib/sources"
 
GOGID="seven_kingdoms_ancient_adversaries"
PREFIX="SevenKingdoms_gog"
WORKING_WINE_VERSION="1.4.1"
 
TITLE="GOG.com - Seven Kingdoms Ancient Adversaries"
SHORTCUT_NAME="Seven Kingdoms"
 
POL_GetSetupImages "" "" "$TITLE"
 
POL_SetupWindow_Init
POL_SetupWindow_SetID 1228
POL_Debug_Init
 
POL_SetupWindow_presentation "$TITLE" "Enlight Software / Enlight Software" "http://www.gog.com/gamecard/$GOGID" "markus_s" "$PREFIX"
 
POL_Call POL_GoG_setup "$GOGID" "a8578d2554cbcea4cf2e2f06f2dab771"
 
POL_Wine_SelectPrefix "$PREFIX"
POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"
  
#fake sdbinst.exe(this is from HoMM3 script made by petch)
#installer otherwise gives error message regarding sdbinst.exe
POL_Call POL_Install_nop "$WINEPREFIX/drive_c/windows/system32/sdbinst.exe"
 
POL_Call POL_GoG_install
 
# GoG work!
Set_OS winxp
 
POL_SetupWindow_VMS "16"
 
# Doesn't hurt ;)
POL_Wine_reboot
 
POL_Shortcut "7k.exe" "$SHORTCUT_NAME" "" "" "Game;StrategyGame;"
POL_Shortcut_QuietDebug "$SHORTCUT_NAME"
 
POL_Shortcut_Document "$SHORTCUT_NAME" "$GOGROOT/Seven Kingdoms - Ancient Adversaries/manual.pdf"
 
POL_SetupWindow_Close
 
exit 0


22x22: http://imgur.com/5VaHyma,dvjSCM6#1
44x44: http://imgur.com/5VaHyma,dvjSCM6#0
Are there some generic images available for top and front? (since I am not really talented in doing graphical stuff)
Regarding the screenshot, I have not figured out yet how to make one.
petch Saturday 7 December 2013 at 21:31
petch

Hi, and welcome aboard! ;)
To download and install the replacement executable, you'll probably something like
cd "$POL_USER_ROOT/tmp"
POL_Download 'http://sourceforge.net/projects/skfans/files/Seven%20Kingdoms%20AA/Executables/7kaa-patch-2.13.2.zip/download' 'ea603670d78e8dacea65f1b309c41d73'
mv download 7kaa-patch-2.13.2.zip
POL_System_ExtractSingleFile 7kaa-patch-2.13.2.zip 7kaa-patch/7kaa.exe "$GOGROOT/Seven Kingdoms - Ancient Adversaries/7kaa.exe


If you don't provide setup pictures the default ones will be displayed.

Hope it helps!
Pierre.
markus_s Saturday 7 December 2013 at 23:02
markus_sAnonymous

Thank you for the code-snippet, it worked perfectly.
The working script is now as follows.

#!/bin/bash
# Date : (2013-12-07 10-47)
# Wine version used : 1.4.1
# Distribution used to test : Ubuntu 12.04.2
# Author : markus_s
# Script licence : GPL v.2
# Program licence : Retail
# Depend :
 
[ -z "$PLAYONLINUX" ] && exit 0
source "$PLAYONLINUX/lib/sources"
 
GOGID="seven_kingdoms_ancient_adversaries"
PREFIX="SevenKingdoms_gog"
WORKING_WINE_VERSION="1.4.1"
 
TITLE="GOG.com - Seven Kingdoms Ancient Adversaries"
SHORTCUT_NAME="Seven Kingdoms"
 
POL_GetSetupImages "" "" "$TITLE"
 
POL_SetupWindow_Init
POL_SetupWindow_SetID 1228
POL_Debug_Init
 
POL_SetupWindow_presentation "$TITLE" "Enlight Software / Enlight Software" "http://www.gog.com/gamecard/$GOGID" "markus_s" "$PREFIX"
 
POL_Call POL_GoG_setup "$GOGID" "a8578d2554cbcea4cf2e2f06f2dab771"
 
POL_Wine_SelectPrefix "$PREFIX"
POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"
  
#fake sdbinst.exe(this is from HoMM3 script made by petch)
#installer otherwise gives error message regarding sdbinst.exe
POL_Call POL_Install_nop "$WINEPREFIX/drive_c/windows/system32/sdbinst.exe"
 
POL_Call POL_GoG_install
 
# GoG work!
Set_OS winxp
 
POL_SetupWindow_VMS "16"

# suggested on winehq
POL_Wine_Direct3D "DirectDrawRenderer" "opengl"
 
# Doesn't hurt ;)
POL_Wine_reboot
 
POL_Shortcut "7k.exe" "$SHORTCUT_NAME" "" "" "Game;StrategyGame;"
POL_Shortcut_QuietDebug "$SHORTCUT_NAME"
 
POL_Shortcut_Document "$SHORTCUT_NAME" "$GOGROOT/Seven Kingdoms - Ancient Adversaries/manual.pdf"

cd "$POL_USER_ROOT/tmp"
POL_Download 'http://sourceforge.net/projects/skfans/files/Seven%20Kingdoms%20AA/Executables/7kaa-patch-2.13.2.zip/download' 'ea603670d78e8dacea65f1b309c41d73'
mv download 7kaa-patch-2.13.2.zip
POL_System_ExtractSingleFile 7kaa-patch-2.13.2.zip 7kaa-patch/7kaa.exe "$GOGROOT/Seven Kingdoms - Ancient Adversaries/7k.exe"

POL_SetupWindow_Close

exit 0


I still did not find out how to make screenshots :(
markus_s Sunday 8 December 2013 at 10:06
markus_sAnonymous

Nevermind, here are the screenshots:
http://imgur.com/kufWFSr
http://imgur.com/2ApkxII
http://imgur.com/Tsu3G9t

Is the script ready to be submitted?
petch Sunday 8 December 2013 at 16:28
petch

Hi,


POL_SetupWindow_SetID 1228

This has to match the script number in the repository; The script number is displayed in the URL at the moment of submitting it, don't forget to update it then.

(It doesn't do much, just add an (i) icon in the installer window, leading to the web page of the script. If it's wrong it will lead to the wrong script)


# suggested on winehq
POL_Wine_Direct3D "DirectDrawRenderer" "opengl"

I doubt it does anything useful, opengl renderer has been the default for a while now. The suggestion is 3.5 years old...

It also feels a bit strange to create the shortcut before the executable has been replaced, creating the shortcut is usually what is done last in scripts
For example if the script is interrupted before the end it could look like the installation succeed, yet the user experiment problems because (s)he doesn't use the right executable, and support may need some time before realizing what's going on. (For this reason I also wouldn't overwrite the executable, but write the new one alongside the original one. If they're both of similar size that'll waste 500kB of disk. That would be 5% of my first harddrive, but who cares those days)
Unless there's some reason, like the GPL executable doesn't contain the same icon?

Edited by petch

markus_s Tuesday 17 December 2013 at 18:56
markus_sAnonymous

Thank you for the hints, I've changed it and submitted the script for validation (as well as my script for Praetorians).
petch Tuesday 17 December 2013 at 20:04
petch

Script validated, with 2 screenshots (the last URL didn't work)

This site allows content generated by members, and we promptly remove any content that infringes copyright according to our Terms of Service. To report copyright infringement, please send a notice to dmcayonlinux.com