Das Forum

[script] GOG.com - Xenonauts

Autor Antworten
Okto Thursday 16 April 2015 at 20:23
OktoAnonymous

#!/bin/bash
# Date : (2015-04-16 19-02)
# Wine version used : 1.7.34
# Distribution used to test : OpenSUSE 13.2
# Author : Benjamin Hardy
 
[ -z "$PLAYONLINUX" ] && exit 0
source "$PLAYONLINUX/lib/sources"

TITLE="GOG.com - Xenonauts"
GOGID="xenonauts"
PREFIX="Xenonauts"
#Installer crashed when using 1.6.2, but ran well with 1.7.34
WINE_VERSION="1.7.34"
SHORTCUT_NAME="Xenonauts"

POL_SetupWindow_Init
POL_Debug_Init

POL_SetupWindow_presentation "$TITLE" "Goldhawk Interactive" "http://www.gog.com/gamecard/$GOGID" "Benjamin Hardy" "$PREFIX"

POL_SetupWindow_message "$(eval_gettext 'This installer requires the patch provided by gog.com. Please ensure it has been downloaded to a local drive before continuing.')" "$TITLE"

POL_Call POL_GoG_setup "$GOGID" "682443fa62f222891ee528900866b254"

POL_Wine_SelectPrefix "$PREFIX"
POL_Wine_PrefixCreate "$WINE_VERSION"

POL_Call POL_GoG_install

POL_SetupWindow_browse "$(eval_gettext 'Please select the patch file.')" "$TITLE"
POL_Wine_WaitBefore "$(eval_gettext 'Please wait, patch installation in progress.')" "$TITLE"
POL_Wine "$APP_ANSWER"

POL_SetupWindow_VMS "512"

POL_Wine_reboot

POL_Shortcut "Xenonauts.exe" "$SHORTCUT_NAME" "" "" "Game;StrategyGame"
POL_Shortcut_Document "$SHORTCUT_NAME" "$WINEPREFIX/drive_c/GameManual.pdf"

POL_SetupWindow_Close

exit 0

 

I've been trying out this script, and fortunately all seems to work well now with the newer version of WINE. I'm wondering specifically about the patch installation part however, because that could be made optional? I can see both good and bad aspects to keeping it mandatory or making it optional, so I'm undecided what's best at the moment? Aside from that, any other thoughts or ideas are also very welcome.

Ronin DUSETTE Friday 17 April 2015 at 6:42
Ronin DUSETTE

You could just make WINE_VERSION into WINEVERSION. That is more standard (which is a good thing).

What is the patch for? You should be able to automate the patch install if it is actually required. 


Please:
Post debug logs & full computer specs in first post
No private messages for general help, use the forums
Read the wiki, Report broken scripts
Okto Friday 17 April 2015 at 17:33
OktoAnonymous

Hi Ronin,

I'll change it to WINEVERSION.

As for the patch, from what I can find, it includes fixes for some things that cause crashes, and some gameplay improvements.

I'm very interested in how installing the patch might be automated? One possible difficulty however is that obtaining the patch requires the user to log in to their GOG account and download it. I'm not sure if that can be automated in any way? Also, the patch versions for GOG games can change over time, so having the user select it themselves may make the script more future-proof than an automated method?

Ronin DUSETTE Friday 17 April 2015 at 18:36
Ronin DUSETTE

Ah. If they have to log in, I doubt it would be able to work. Petch might know, though.

As for automating things like that, you can just use simple Bash stuff, as well as POL_Download to do that, and check the MD5 sum to make sure that it is downloaded. Since it is a patch that might be used repeatedly, you could probably use POL_Download_Resource, which would cache the file. Then you just use the POL API walk the user through installation like usual. Besides the scripting docs in das wiki, looking at some actual scripts will show you different ways of doing stuff like that. :) 

Hope that helps a bit. 


Please:
Post debug logs & full computer specs in first post
No private messages for general help, use the forums
Read the wiki, Report broken scripts
petch Friday 17 April 2015 at 19:50
petch

POL_GoG_download has been broken for well over a year (maybe two), debugging web authentication is not really my forte, any fix welcome...

 

Okto Friday 17 April 2015 at 21:26
OktoAnonymous

Thank you, that does help. I've seen a few examples before, and found quite a few now I've looked for them. I want to try something like this in a script, but unfortunately can't do it this time as the file can't be accessed without first logging in to a gog account.