The forum

[Script] Driftmoon

Author Replies
hmdai Sunday 25 November 2012 at 8:39
hmdai

Driftmoon is an indie RPG written by Instant Kingdom. It use an interesting "completely" top-down camera. Check the screenshot you will know what I mean :)


The script will download or install the demo into your system. If you are satisfied with the game, you could purchase through the game or their website. They will send a license code to your email and you can use it to unlock the game. The current game version is 0.903 and it will automatically install the update once it is available (Internet is required for this feature).

EDIT: 2012-11-25 Add link to icon and left image
EDIT: Thank you for the opinion of petch. I have updated the script a bit.

I have uploaded the icon and left image here:
icon: http://www.mediafire.com/view/?ydep9n6mlknmcy6
left image: http://www.mediafire.com/view/?bkx57xhxihgxzaf


#!/bin/bash
# Date : (2012-11-24 21:30)
# Last revision : (2012-11-24 21:30)
# Wine version used : 1.5.5
# Distribution used to test : OpenSuSE 12.2 64-bit
# Author : hmdai (Based on Deponia DC script by Kweepeer and PDF-XChange Viewer by Fredo)
# Script licence : GPL v.2
# Program licence : Retail
# Depend :

[ -z "$PLAYONLINUX" ] && exit 0
source "$PLAYONLINUX/lib/sources"

PREFIX="Driftmoon"
WORKING_WINE_VERSION="1.5.5"

TITLE="Driftmoon"
SHORTCUT_NAME="Driftmoon"

POL_GetSetupImages "" "http://files.playonlinux.com/resources/setups/$PREFIX/left.jpg" "$TITLE"

POL_SetupWindow_Init
#POL_SetupWindow_SetID 12345 ##TODO
POL_Debug_Init

POL_SetupWindow_presentation "$TITLE" "Instant Kingdom" "http://www.instantkingdom.com/driftmoon/" "hmdai" "$PREFIX"

POL_Wine_SelectPrefix "$PREFIX"
POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"

Set_OS winxp

POL_SetupWindow_VMS "128"
POL_SetupWindow_InstallMethod "LOCAL,DOWNLOAD"

if [ "$INSTALL_METHOD" = "DOWNLOAD" ]
then
   POL_System_TmpCreate "$TITLE"
   cd "$POL_System_TmpDir"
   POL_Download "http://www.instantkingdom.com/download/driftmoon.exe"
   INSTALLER="driftmoon.exe"
else
    POL_SetupWindow_browse "$(eval_gettext "Please select the setup file to run.")" "$TITLE"
    INSTALLER="$APP_ANSWER"
fi

# Installation in progress
POL_SetupWindow_WaitBefore "$TITLE"
POL_Debug_Message "Installing $TITLE from $INSTALLER."
POL_Wine "$INSTALLER"

# Doesn't hurt ;)
POL_Wine_reboot

POL_Shortcut "Driftmoon.exe" "$SHORTCUT_NAME" "" ""

# Clean up
POL_System_TmpDelete

POL_SetupWindow_Close

exit

Edited by hmdai

petch Sunday 25 November 2012 at 9:05
petch

- Bash uses = not == for string equality test. It's usually harmless to consider the right string as a pattern (makes no difference if it doesn't contain any pattern like ? or * characters, etc.), but just to let you know
- start /unix is probably useless and should be dropped (it's major side-effect: if the install script is aborted, say the user clicks on abort button or closes the install window, with start /unix it won't also stop the installation program)
- The POL_Wine_WaitExit should be redundant. Or maybe you found it required in your script because of another bad side-effect of start /unix: it can make the installation program continue in background. If you remove start /unix you'll probably notice that POL_Wine "$INSTALLER" is blocking (script will only continue when the installer is done), and the POL_SetupWindow_WaitExit unnecessary. Not always the case, but good default guess :)
hmdai Sunday 25 November 2012 at 9:47
hmdai

I used to right script for sh which requires == for string validation. Old habit never dies :-P

Thank you for your opinion. I have updated the script.
petch Sunday 25 November 2012 at 10:42
petch

Plain sh uses ==? Didn't know that, interesting.

The left gfx is a bit too short this time (326 pixels instead of 356).
Other than that your script looks good to go :)

Edited by petch

hmdai Sunday 25 November 2012 at 10:48
hmdai

Ah, my bad. I have mixed up the resolution of the image and create a wrong size. I have uploaded a correct one and updated the link.

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 dmca-notice@playonlinux.com