Wurm Clock

Informations

Creator Message
lahtis

Information

This installer has been approved by the team.

Informations

Platforms:
Downloads: 5808
Wine: 1.7.47

Feedbacks

Description

WurmClock can be used as an offline tool, i. e. when not playing Wurm Online, to keep an eye on the in-game time. It will show you at a glance if it is currently day or night before you log into the game.

The clock is updated frequently (every 10 seconds) and will usually show the current in-game time with an accuracy of ± 2 Wurm minutes. However, each time the Wurm servers are shut down due to maintenance, Wurm time will stop and be frozen until the servers are running again. WurmClock will, however, try to re-synchronize with the in-game clock as soon as possible.

Source code

#!/bin/bash
# Date : (2015-07-12 20:03)
# Last revision : (2015-07-22 17:35)
# Distribution used to test : Ubuntu 14.04
# Author : lahtis
# Licence : GPLv3
# Small Wurm Clock destop installer application (WURM Online game)
# PlayOnLinux: 4.2.8

[ -z "$PLAYONLINUX" ] && exit 0
source "$PLAYONLINUX/lib/sources"
 
TITLE="Wurm Clock"
PREFIX="WurmClock"
WORKING_WINE_VERSION="1.7.47"
EDITOR="Yaga, Hakim"
GAME_URL="http://forum.wurmonline.com/index.php?/topic/61451-wurmclock-desktop-app-showing-current-wurm-time-and-date/"
AUTHOR="lahtis"

POL_GetSetupImages "http://files.playonlinux.com/resources/setups/$PREFIX/top.jpg" "http://files.playonlinux.com/resources/setups/$PREFIX/left.jpg" "$TITLE"
POL_SetupWindow_Init
POL_Debug_Init
 
POL_SetupWindow_presentation "$TITLE" "$EDITOR" "$GAME_URL" "$AUTHOR" "$PREFIX"
 
POL_Wine_SelectPrefix "$PREFIX"
POL_System_SetArch "x86"
POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"

# create WurmClock folder in the $PROGRAMFILES
mkdir "$WINEPREFIX/drive_c/$PROGRAMFILES/WurmClock/"

# Fix pulseaudio issue
which pulseaudio && Set_OS "winxp"

# Do you have downloaded the zip file?
POL_SetupWindow_question "$(eval_gettext 'Do you have downloaded the zip file?')" "$TITLE"
if [ "$APP_ANSWER" = "FALSE" ]
then
        #POL_Browser "https://www.dropbox.com/s/afpg9u7p4rcw0vc/WurmClock202.ZIP"
        POL_Browser "http://forum.wurmonline.com/index.php?/topic/61451-wurmclock-desktop-app-showing-current-wurm-time-and-date/"
fi

# unzip zip file, zip-file has not installer. Zip-file only carry the exe-file and pdf-guides.
POL_SetupWindow_browse "$(eval_gettext 'Please select the downloaded zip file.')" "$TITLE"

cd "$WINEPREFIX/drive_c/$PROGRAMFILES/WurmClock/"
POL_System_unzip "$APP_ANSWER" 

POL_Shortcut "WurmClock.exe" "$TITLE"

POL_SetupWindow_Close
exit 0

Contributions

Filters:

Contribute
Member Message
lahtis Wednesday 22 July 2015 at 20:46
lahtis

Information

This update has been approved by the team.

Differences

@@ -0,0 +1,53 @@
+#!/bin/bash
+# Date : (2015-07-12 20:03)
+# Last revision : (2015-07-22 17:35)
+# Distribution used to test : Ubuntu 14.04
+# Author : lahtis
+# Licence : GPLv3
+# Small Wurm Clock destop installer application (WURM Online game)
+# PlayOnLinux: 4.2.8
+
+[ -z "$PLAYONLINUX" ] && exit 0
+source "$PLAYONLINUX/lib/sources"
+ 
+TITLE="Wurm Clock"
+PREFIX="WurmClock"
+WORKING_WINE_VERSION="1.7.47"
+EDITOR="Yaga, Hakim"
+GAME_URL="http://forum.wurmonline.com/index.php?/topic/61451-wurmclock-desktop-app-showing-current-wurm-time-and-date/"
+AUTHOR="lahtis"
+
+POL_GetSetupImages "http://files.playonlinux.com/resources/setups/$PREFIX/top.jpg" "http://files.playonlinux.com/resources/setups/$PREFIX/left.jpg" "$TITLE"
+POL_SetupWindow_Init
+POL_Debug_Init
+ 
+POL_SetupWindow_presentation "$TITLE" "$EDITOR" "$GAME_URL" "$AUTHOR" "$PREFIX"
+ 
+POL_Wine_SelectPrefix "$PREFIX"
+POL_System_SetArch "x86"
+POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"
+
+# create WurmClock folder in the $PROGRAMFILES
+mkdir "$WINEPREFIX/drive_c/$PROGRAMFILES/WurmClock/"
+
+# Fix pulseaudio issue
+which pulseaudio && Set_OS "winxp"
+
+# Do you have downloaded the zip file?
+POL_SetupWindow_question "$(eval_gettext 'Do you have downloaded the zip file?')" "$TITLE"
+if [ "$APP_ANSWER" = "FALSE" ]
+then
+	#POL_Browser "https://www.dropbox.com/s/afpg9u7p4rcw0vc/WurmClock202.ZIP"
+	POL_Browser "http://forum.wurmonline.com/index.php?/topic/61451-wurmclock-desktop-app-showing-current-wurm-time-and-date/"
+fi
+
+# unzip zip file, zip-file has not installer. Zip-file only carry the exe-file and pdf-guides.
+POL_SetupWindow_browse "$(eval_gettext 'Please select the downloaded zip file.')" "$TITLE"
+
+cd "$WINEPREFIX/drive_c/$PROGRAMFILES/WurmClock/"
+POL_System_unzip "$APP_ANSWER" 
+
+POL_Shortcut "WurmClock.exe" "$TITLE"
+
+POL_SetupWindow_Close
+exit 0

New source code

#!/bin/bash
# Date : (2015-07-12 20:03)
# Last revision : (2015-07-22 17:35)
# Distribution used to test : Ubuntu 14.04
# Author : lahtis
# Licence : GPLv3
# Small Wurm Clock destop installer application (WURM Online game)
# PlayOnLinux: 4.2.8

[ -z "$PLAYONLINUX" ] && exit 0
source "$PLAYONLINUX/lib/sources"
 
TITLE="Wurm Clock"
PREFIX="WurmClock"
WORKING_WINE_VERSION="1.7.47"
EDITOR="Yaga, Hakim"
GAME_URL="http://forum.wurmonline.com/index.php?/topic/61451-wurmclock-desktop-app-showing-current-wurm-time-and-date/"
AUTHOR="lahtis"

POL_GetSetupImages "http://files.playonlinux.com/resources/setups/$PREFIX/top.jpg" "http://files.playonlinux.com/resources/setups/$PREFIX/left.jpg" "$TITLE"
POL_SetupWindow_Init
POL_Debug_Init
 
POL_SetupWindow_presentation "$TITLE" "$EDITOR" "$GAME_URL" "$AUTHOR" "$PREFIX"
 
POL_Wine_SelectPrefix "$PREFIX"
POL_System_SetArch "x86"
POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"

# create WurmClock folder in the $PROGRAMFILES
mkdir "$WINEPREFIX/drive_c/$PROGRAMFILES/WurmClock/"

# Fix pulseaudio issue
which pulseaudio && Set_OS "winxp"

# Do you have downloaded the zip file?
POL_SetupWindow_question "$(eval_gettext 'Do you have downloaded the zip file?')" "$TITLE"
if [ "$APP_ANSWER" = "FALSE" ]
then
        #POL_Browser "https://www.dropbox.com/s/afpg9u7p4rcw0vc/WurmClock202.ZIP"
        POL_Browser "http://forum.wurmonline.com/index.php?/topic/61451-wurmclock-desktop-app-showing-current-wurm-time-and-date/"
fi

# unzip zip file, zip-file has not installer. Zip-file only carry the exe-file and pdf-guides.
POL_SetupWindow_browse "$(eval_gettext 'Please select the downloaded zip file.')" "$TITLE"

cd "$WINEPREFIX/drive_c/$PROGRAMFILES/WurmClock/"
POL_System_unzip "$APP_ANSWER" 

POL_Shortcut "WurmClock.exe" "$TITLE"

POL_SetupWindow_Close
exit 0

Replies

Wednesday 22 July 2015 at 20:57
For some reason you removed the ending exit 0 ?
Wednesday 22 July 2015 at 21:03
If you want to check your scripts with automated tests, I can suggest:
- http://www.shellcheck.net/ for some general Bash scripting, it detects lots of common mistakes (and also not so well known mistakes that even unix veterans may not know about - very useful)
- clone https://github.com/PlayOnLinux/PlayOnLinux_Tools and use script_checker.sh from PlayOnLinux_ScriptChecker subdirectory; That one checks for common issues with PlayOnLinux scripting specifically
Wednesday 22 July 2015 at 21:21
I just documented those checkers in the Wiki, they're great tools to know about
Wednesday 22 July 2015 at 21:22
(re-added exit 0)
Friday 24 July 2015 at 16:04
Thanks for good tips.

Edited by petch

lahtis Wednesday 22 July 2015 at 19:46
lahtis

Warning

This update has not been approved yet by the team.
Use it at your own risk

Message

Tested source code. It is working.

Could it be somewhere on the page descriptions of error messages. For example, if an error

POL_System_unzip failed with error 1 or error

POL_System_unzip failed with error 11 (I recall means that tmp file has not empty, there are same files).

No need to wonder why this is not working. None of these has not been any mention of the wiki.

Differences

@@ -0,0 +1,55 @@
+#!/bin/bash
+# Date : (2015-07-12 20:03)
+# Last revision : (2015-07-22 17:35)
+# Distribution used to test : Ubuntu 14.04
+# Author : lahtis
+# Licence : GPLv3
+# Small Wurm Clock destop installer application (WURM Online game)
+# PlayOnLinux: 4.2.8
+
+[ -z "$PLAYONLINUX" ] && exit 0
+source "$PLAYONLINUX/lib/sources"
+ 
+TITLE="Wurm Clock"
+PREFIX="WurmClock"
+WORKING_WINE_VERSION="1.7.47"
+EDITOR="Yaga, Hakim"
+GAME_URL="http://forum.wurmonline.com/index.php?/topic/61451-wurmclock-desktop-app-showing-current-wurm-time-and-date/"
+AUTHOR="lahtis"
+
+POL_GetSetupImages "http://files.playonlinux.com/resources/setups/$PREFIX/top.jpg" "http://files.playonlinux.com/resources/setups/$PREFIX/left.jpg" "$TITLE"
+POL_SetupWindow_Init
+POL_Debug_Init
+ 
+POL_SetupWindow_presentation "$TITLE" "$EDITOR" "$GAME_URL" "$AUTHOR" "$PREFIX"
+ 
+POL_Wine_SelectPrefix "$PREFIX"
+POL_System_SetArch "x86"
+POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"
+
+# create WurmClock folder in the $PROGRAMFILES
+mkdir "$WINEPREFIX/drive_c/$PROGRAMFILES/WurmClock/"
+
+# Fix pulseaudio issue
+which pulseaudio && Set_OS "winxp"
+
+# Do you have downloaded the zip file?
+POL_SetupWindow_question "Do you have downloaded the zip file?" "Download?"
+if [ "$APP_ANSWER" = "FALSE" ]
+then
+	POL_Browser "https://www.dropbox.com/s/afpg9u7p4rcw0vc/WurmClock202.ZIP"
+	# POL_Browser "http://forum.wurmonline.com/index.php?/topic/61451-wurmclock-desktop-app-showing-current-wurm-time-and-date/"
+fi
+
+# unzip zip file, zip-file has not installer. Zip-file only carry the exe-file and pdf-guides.
+POL_SetupWindow_browse "Please select the downloaded zip file." $TITLE
+
+cd "$WINEPREFIX/drive_c/$PROGRAMFILES/WurmClock/"
+POL_System_unzip "$APP_ANSWER" 
+
+POL_Shortcut "WurmClock.exe" "$TITLE"
+POL_Shortcut_Document "Wurm Clock help" "WurmClock.pdf"
+
+POL_SetupWindow_Close
+ 
+exit 0

New source code

#!/bin/bash
# Date : (2015-07-12 20:03)
# Last revision : (2015-07-22 17:35)
# Distribution used to test : Ubuntu 14.04
# Author : lahtis
# Licence : GPLv3
# Small Wurm Clock destop installer application (WURM Online game)
# PlayOnLinux: 4.2.8

[ -z "$PLAYONLINUX" ] && exit 0
source "$PLAYONLINUX/lib/sources"
 
TITLE="Wurm Clock"
PREFIX="WurmClock"
WORKING_WINE_VERSION="1.7.47"
EDITOR="Yaga, Hakim"
GAME_URL="http://forum.wurmonline.com/index.php?/topic/61451-wurmclock-desktop-app-showing-current-wurm-time-and-date/"
AUTHOR="lahtis"

POL_GetSetupImages "http://files.playonlinux.com/resources/setups/$PREFIX/top.jpg" "http://files.playonlinux.com/resources/setups/$PREFIX/left.jpg" "$TITLE"
POL_SetupWindow_Init
POL_Debug_Init
 
POL_SetupWindow_presentation "$TITLE" "$EDITOR" "$GAME_URL" "$AUTHOR" "$PREFIX"
 
POL_Wine_SelectPrefix "$PREFIX"
POL_System_SetArch "x86"
POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"

# create WurmClock folder in the $PROGRAMFILES
mkdir "$WINEPREFIX/drive_c/$PROGRAMFILES/WurmClock/"

# Fix pulseaudio issue
which pulseaudio && Set_OS "winxp"

# Do you have downloaded the zip file?
POL_SetupWindow_question "Do you have downloaded the zip file?" "Download?"
if [ "$APP_ANSWER" = "FALSE" ]
then
        POL_Browser "https://www.dropbox.com/s/afpg9u7p4rcw0vc/WurmClock202.ZIP"
        # POL_Browser "http://forum.wurmonline.com/index.php?/topic/61451-wurmclock-desktop-app-showing-current-wurm-time-and-date/"
fi

# unzip zip file, zip-file has not installer. Zip-file only carry the exe-file and pdf-guides.
POL_SetupWindow_browse "Please select the downloaded zip file." $TITLE

cd "$WINEPREFIX/drive_c/$PROGRAMFILES/WurmClock/"
POL_System_unzip "$APP_ANSWER" 

POL_Shortcut "WurmClock.exe" "$TITLE"
POL_Shortcut_Document "Wurm Clock help" "WurmClock.pdf"

POL_SetupWindow_Close
 
exit 0

Replies

Wednesday 22 July 2015 at 19:57
man unzip
Wednesday 22 July 2015 at 20:04
Ok, now my review:
POL_SetupWindow_question "Do you have downloaded the zip file?" "Download?"
All user-oriented messages must support localization support:
http://wiki.playonlinux.com/index.php/Scripting_-_Chapter_10:_Script_Translation
Also, the dialog box will have no mention of the installer name, so it could be a bit confusing
POL_Browser "https://www.dropbox.com/s/afpg9u7p4rcw0vc/WurmClock202.ZIP"
We do not validate scripts using dropbox URLs, they're too volatile; Why not use the editor URL anyway?
POL_SetupWindow_browse "Please select the downloaded zip file." $TITLE
Localization support again. Also, I suspect you should use double quotes around $TITLE, that contains a space
POL_Shortcut_Document "Wurm Clock help" "WurmClock.pdf"
First argument of POL_Shortcut_Document is the name of the shortcut to attach the documentation to.
http://wiki.playonlinux.com/index.php/Scripting_-_Chapter_11:_List_of_Functions#POL_Shortcut_Document_.284.0.15.2B.29
lahtis Wednesday 22 July 2015 at 16:47
lahtis

Warning

This update has not been approved yet by the team.
Use it at your own risk

Message

New fixed source code.

Differences

@@ -0,0 +1,57 @@
+#!/bin/bash
+# Date : (2015-07-12 20:03)
+# Last revision : (2015-07-22 17:35)
+# Distribution used to test : Ubuntu 14.04
+# Author : lahtis
+# Licence : GPLv3
+# Small Wurm Clock destop installer application (WURM Online game)
+# PlayOnLinux: 4.2.8
+
+[ -z "$PLAYONLINUX" ] && exit 0
+source "$PLAYONLINUX/lib/sources"
+ 
+TITLE="Wurm Clock"
+PREFIX="WurmClock"
+WORKING_WINE_VERSION="1.7.47"
+EDITOR="Yaga, Hakim"
+GAME_URL="http://forum.wurmonline.com/index.php?/topic/61451-wurmclock-desktop-app-showing-current-wurm-time-and-date/"
+AUTHOR="lahtis"
+
+POL_GetSetupImages "http://files.playonlinux.com/resources/setups/$PREFIX/top.jpg" "http://files.playonlinux.com/resources/setups/$PREFIX/left.jpg" "$TITLE"
+POL_SetupWindow_Init
+POL_Debug_Init
+ 
+POL_SetupWindow_presentation "$TITLE" "$EDITOR" "$GAME_URL" "$AUTHOR" "$PREFIX"
+ 
+POL_Wine_SelectPrefix "$PREFIX"
+POL_System_SetArch "x86"
+POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"
+
+# create WurmClock folder in the $PROGRAMFILES
+mkdir "$WINEPREFIX/drive_c/$PROGRAMFILES/WurmClock/"
+
+# Fix pulseaudio issue
+which pulseaudio && Set_OS "winxp"
+
+# Do you have downloaded the zip file?
+POL_SetupWindow_question "Do you have downloaded the zip file?" "Download?"
+if [ "$APP_ANSWER" = "FALSE" ]
+then
+	POL_Browser "https://www.dropbox.com/s/afpg9u7p4rcw0vc/WurmClock202.ZIP"
+	# POL_Browser "http://forum.wurmonline.com/index.php?/topic/61451-wurmclock-desktop-app-showing-current-wurm-time-and-date/"
+fi
+
+# unzip zip file, zip-file has not installer. Zip-file only carry the exe-file and pdf-guides.
+POL_SetupWindow_browse "Please select the downloaded zip file." $TITLE
+
+localInstallerPath=$APP_ANSWER
+cp localInstallerPath ./
+cd "$WINEPREFIX/drive_c/$PROGRAMFILES/WurmClock/"
+POL_System_unzip "$APP_ANSWER" 
+
+POL_Shortcut "WurmClock.exe" "$TITLE"
+POL_Shortcut_Document "Wurm Clock help" "WurmClock.pdf"
+
+POL_SetupWindow_Close
+ 
+exit 0

New source code

#!/bin/bash
# Date : (2015-07-12 20:03)
# Last revision : (2015-07-22 17:35)
# Distribution used to test : Ubuntu 14.04
# Author : lahtis
# Licence : GPLv3
# Small Wurm Clock destop installer application (WURM Online game)
# PlayOnLinux: 4.2.8

[ -z "$PLAYONLINUX" ] && exit 0
source "$PLAYONLINUX/lib/sources"
 
TITLE="Wurm Clock"
PREFIX="WurmClock"
WORKING_WINE_VERSION="1.7.47"
EDITOR="Yaga, Hakim"
GAME_URL="http://forum.wurmonline.com/index.php?/topic/61451-wurmclock-desktop-app-showing-current-wurm-time-and-date/"
AUTHOR="lahtis"

POL_GetSetupImages "http://files.playonlinux.com/resources/setups/$PREFIX/top.jpg" "http://files.playonlinux.com/resources/setups/$PREFIX/left.jpg" "$TITLE"
POL_SetupWindow_Init
POL_Debug_Init
 
POL_SetupWindow_presentation "$TITLE" "$EDITOR" "$GAME_URL" "$AUTHOR" "$PREFIX"
 
POL_Wine_SelectPrefix "$PREFIX"
POL_System_SetArch "x86"
POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"

# create WurmClock folder in the $PROGRAMFILES
mkdir "$WINEPREFIX/drive_c/$PROGRAMFILES/WurmClock/"

# Fix pulseaudio issue
which pulseaudio && Set_OS "winxp"

# Do you have downloaded the zip file?
POL_SetupWindow_question "Do you have downloaded the zip file?" "Download?"
if [ "$APP_ANSWER" = "FALSE" ]
then
        POL_Browser "https://www.dropbox.com/s/afpg9u7p4rcw0vc/WurmClock202.ZIP"
        # POL_Browser "http://forum.wurmonline.com/index.php?/topic/61451-wurmclock-desktop-app-showing-current-wurm-time-and-date/"
fi

# unzip zip file, zip-file has not installer. Zip-file only carry the exe-file and pdf-guides.
POL_SetupWindow_browse "Please select the downloaded zip file." $TITLE

localInstallerPath=$APP_ANSWER
cp localInstallerPath ./
cd "$WINEPREFIX/drive_c/$PROGRAMFILES/WurmClock/"
POL_System_unzip "$APP_ANSWER" 

POL_Shortcut "WurmClock.exe" "$TITLE"
POL_Shortcut_Document "Wurm Clock help" "WurmClock.pdf"

POL_SetupWindow_Close
 
exit 0

Replies

Wednesday 22 July 2015 at 19:12
localInstallerPath=$APP_ANSWER
cp localInstallerPath ./
Test your scripts before submitting them
lahtis Wednesday 15 July 2015 at 16:32
lahtis

Warning

This update has not been approved yet by the team.
Use it at your own risk

Message

except files moving not working.

Differences

@@ -0,0 +1,68 @@
+#!/bin/bash
+# Date : (2015-07-12 20-03)
+# Last revision : (2015-07-12 20-03)
+# Distribution used to test : Ubuntu 14.04
+# Author : lahtis
+# Licence : GPLv3
+# Small Wurm Clock destop installer application (WURM Online game)
+# PlayOnLinux: 4.2.8
+ 
+
+ 
+[ -z "$PLAYONLINUX" ] && exit 0
+source "$PLAYONLINUX/lib/sources"
+ 
+TITLE="Wurm Clock"
+PREFIX="WurmClock"
+WORKING_WINE_VERSION="1.7.32"
+EDITOR="Yaga, Hakim"
+GAME_URL="http://forum.wurmonline.com/index.php?/topic/61451-wurmclock-desktop-app-showing-current-wurm-time-and-date/"
+AUTHOR="lahtis"
+
+POL_GetSetupImages "http://files.playonlinux.com/resources/setups/$PREFIX/top.jpg" "http://files.playonlinux.com/resources/setups/$PREFIX/left.jpg" "$TITLE"
+POL_SetupWindow_Init
+POL_Debug_Init
+ 
+POL_SetupWindow_presentation "$TITLE" "$EDITOR" "$GAME_URL" "$AUTHOR" "$PREFIX"
+ 
+POL_Wine_SelectPrefix "$PREFIX"
+POL_System_SetArch "x86"
+POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"
+
+# create WurmClock folder in the $PROGRAMFILES
+mkdir "$WINEPREFIX/drive_c/$PROGRAMFILES/WurmClock/"
+
+# Create tmp directory for downloaded files 
+POL_System_TmpCreate "$PREFIX"
+
+# Fix pulseaudio issue
+which pulseaudio && Set_OS "winxp"
+
+# Do you have downloaded the zip file?
+POL_SetupWindow_question "Do you have downloaded the zip file?" "Download?"
+if [ "$APP_ANSWER" = "FALSE" ]
+then
+	POL_Browser "https://www.dropbox.com/s/afpg9u7p4rcw0vc/WurmClock202.ZIP"
+	# POL_Browser "http://forum.wurmonline.com/index.php?/topic/61451-wurmclock-desktop-app-showing-current-wurm-time-and-date/"
+fi
+
+# unzip zip file, zip-file has not installer. Zip-file only carry the exe-file and pdf-guides.
+POL_SetupWindow_browse "Please select the downloaded zip file." $TITLE
+localInstallerPath=$APP_ANSWER
+POL_System_TmpCreate $PREFIX
+cd $POL_System_TmpDir
+cp localInstallerPath ./
+     
+POL_System_unzip "$APP_ANSWER" 
+
+# move all files created folder, Files MOving not working.
+mv "$POL_System_TmpDir/$PREFIX/WurmClock.exe $WINEPREFIX/drive_c/$PROGRAMFILES/WurmClock/WurmClock.exe"
+mv "$POL_System_TmpDir/$PREFIX/WurmClock.pdf $WINEPREFIX/drive_c/$PROGRAMFILES/WurmClock/WurmClock.pdf"
+
+POL_Shortcut "$TITLE" "WurmClock.exe" 
+POL_Shortcut_Document "$TITLE - help" "WurmClock.pdf"
+
+#POL_System_TmpDelete 
+POL_SetupWindow_Close
+ 
+exit 0
\ No newline at end of file

New source code

#!/bin/bash
# Date : (2015-07-12 20-03)
# Last revision : (2015-07-12 20-03)
# Distribution used to test : Ubuntu 14.04
# Author : lahtis
# Licence : GPLv3
# Small Wurm Clock destop installer application (WURM Online game)
# PlayOnLinux: 4.2.8
 

 
[ -z "$PLAYONLINUX" ] && exit 0
source "$PLAYONLINUX/lib/sources"
 
TITLE="Wurm Clock"
PREFIX="WurmClock"
WORKING_WINE_VERSION="1.7.32"
EDITOR="Yaga, Hakim"
GAME_URL="http://forum.wurmonline.com/index.php?/topic/61451-wurmclock-desktop-app-showing-current-wurm-time-and-date/"
AUTHOR="lahtis"

POL_GetSetupImages "http://files.playonlinux.com/resources/setups/$PREFIX/top.jpg" "http://files.playonlinux.com/resources/setups/$PREFIX/left.jpg" "$TITLE"
POL_SetupWindow_Init
POL_Debug_Init
 
POL_SetupWindow_presentation "$TITLE" "$EDITOR" "$GAME_URL" "$AUTHOR" "$PREFIX"
 
POL_Wine_SelectPrefix "$PREFIX"
POL_System_SetArch "x86"
POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"

# create WurmClock folder in the $PROGRAMFILES
mkdir "$WINEPREFIX/drive_c/$PROGRAMFILES/WurmClock/"

# Create tmp directory for downloaded files 
POL_System_TmpCreate "$PREFIX"

# Fix pulseaudio issue
which pulseaudio && Set_OS "winxp"

# Do you have downloaded the zip file?
POL_SetupWindow_question "Do you have downloaded the zip file?" "Download?"
if [ "$APP_ANSWER" = "FALSE" ]
then
        POL_Browser "https://www.dropbox.com/s/afpg9u7p4rcw0vc/WurmClock202.ZIP"
        # POL_Browser "http://forum.wurmonline.com/index.php?/topic/61451-wurmclock-desktop-app-showing-current-wurm-time-and-date/"
fi

# unzip zip file, zip-file has not installer. Zip-file only carry the exe-file and pdf-guides.
POL_SetupWindow_browse "Please select the downloaded zip file." $TITLE
localInstallerPath=$APP_ANSWER
POL_System_TmpCreate $PREFIX
cd $POL_System_TmpDir
cp localInstallerPath ./
     
POL_System_unzip "$APP_ANSWER" 

# move all files created folder, Files MOving not working.
mv "$POL_System_TmpDir/$PREFIX/WurmClock.exe $WINEPREFIX/drive_c/$PROGRAMFILES/WurmClock/WurmClock.exe"
mv "$POL_System_TmpDir/$PREFIX/WurmClock.pdf $WINEPREFIX/drive_c/$PROGRAMFILES/WurmClock/WurmClock.pdf"

POL_Shortcut "$TITLE" "WurmClock.exe" 
POL_Shortcut_Document "$TITLE - help" "WurmClock.pdf"

#POL_System_TmpDelete 
POL_SetupWindow_Close
 
exit 0

Replies

lahtis Sunday 12 July 2015 at 19:11
lahtis

Warning

This update has not been approved yet by the team.
Use it at your own risk

Message

Sourcecode :)

Differences

@@ -0,0 +1,65 @@
+#!/bin/bash
+# Date : (2015-07-12 20-03)
+# Last revision : (2015-07-12 20-03)
+# Distribution used to test : Ubuntu 14.04
+# Author : lahtis
+# Licence : GPLv3
+# Small Wurm Clock destop installer application (WURM Online game)
+# PlayOnLinux: 4.2.8
+ 
+
+ 
+[ -z "$PLAYONLINUX" ] && exit 0
+source "$PLAYONLINUX/lib/sources"
+ 
+TITLE="Wurm Clock"
+PREFIX="WurmClock"
+WORKING_WINE_VERSION="1.7.32"
+EDITOR="Yaga, Hakim"
+GAME_URL="http://forum.wurmonline.com/index.php?/topic/61451-wurmclock-desktop-app-showing-current-wurm-time-and-date/"
+AUTHOR="lahtis"
+
+ 
+ 
+POL_GetSetupImages "http://files.playonlinux.com/resources/setups/$PREFIX/top.jpg" "http://files.playonlinux.com/resources/setups/$PREFIX/left.jpg" "$TITLE"
+POL_SetupWindow_Init
+POL_Debug_Init
+ 
+POL_SetupWindow_presentation "$TITLE" "$EDITOR" "$GAME_URL" "$AUTHOR" "$PREFIX"
+ 
+POL_Wine_SelectPrefix "$PREFIX"
+POL_System_SetArch "x86"
+POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"
+ 
+POL_System_TmpCreate "$PREFIX"
+ 
+# Fix pulseaudio issue
+which pulseaudio && Set_OS "winxp"
+
+# open browser and download zip file.
+POL_Browser "http://forum.wurmonline.com/index.php?/topic/61451-wurmclock-desktop-app-showing-current-wurm-time-and-date/"
+
+# Create tmp directory for downloaded files
+POL_System_TmpCreate "$PREFIX"
+
+# select zip file
+POL_SetupWindow_browse "Please select the zip file." "$TITLE"
+
+# unzip zip file
+cd "$POL_System_TmpDir/$PREFIX" 
+unzip "$APP_ANSWER" 
+POL_SetupWindow_wait "$(eval_gettext 'Please wait while we extract $TITLE game data.')" "$TITLE"
+
+# create folder 
+mkdir "$WINEPREFIX/drive_c/Program Files/WurmClock/"
+
+# move correct folder
+mv "$POL_System_TmpDir/WurmClock.exe" "$WINEPREFIX/drive_c/Program Files/WurmClock/WurmClock.exe"
+mv "$POL_System_TmpDir/WurmClock.pdf" "$WINEPREFIX/drive_c/Program Files/WurmClock/WurmClock.pdf"
+
+POL_Shortcut 'WurmClock.exe' "$TITLE"
+
+POL_System_TmpDelete 
+POL_SetupWindow_Close
+ 
+exit 0
\ No newline at end of file

New source code

#!/bin/bash
# Date : (2015-07-12 20-03)
# Last revision : (2015-07-12 20-03)
# Distribution used to test : Ubuntu 14.04
# Author : lahtis
# Licence : GPLv3
# Small Wurm Clock destop installer application (WURM Online game)
# PlayOnLinux: 4.2.8
 

 
[ -z "$PLAYONLINUX" ] && exit 0
source "$PLAYONLINUX/lib/sources"
 
TITLE="Wurm Clock"
PREFIX="WurmClock"
WORKING_WINE_VERSION="1.7.32"
EDITOR="Yaga, Hakim"
GAME_URL="http://forum.wurmonline.com/index.php?/topic/61451-wurmclock-desktop-app-showing-current-wurm-time-and-date/"
AUTHOR="lahtis"

 
 
POL_GetSetupImages "http://files.playonlinux.com/resources/setups/$PREFIX/top.jpg" "http://files.playonlinux.com/resources/setups/$PREFIX/left.jpg" "$TITLE"
POL_SetupWindow_Init
POL_Debug_Init
 
POL_SetupWindow_presentation "$TITLE" "$EDITOR" "$GAME_URL" "$AUTHOR" "$PREFIX"
 
POL_Wine_SelectPrefix "$PREFIX"
POL_System_SetArch "x86"
POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"
 
POL_System_TmpCreate "$PREFIX"
 
# Fix pulseaudio issue
which pulseaudio && Set_OS "winxp"

# open browser and download zip file.
POL_Browser "http://forum.wurmonline.com/index.php?/topic/61451-wurmclock-desktop-app-showing-current-wurm-time-and-date/"

# Create tmp directory for downloaded files
POL_System_TmpCreate "$PREFIX"

# select zip file
POL_SetupWindow_browse "Please select the zip file." "$TITLE"

# unzip zip file
cd "$POL_System_TmpDir/$PREFIX" 
unzip "$APP_ANSWER" 
POL_SetupWindow_wait "$(eval_gettext 'Please wait while we extract $TITLE game data.')" "$TITLE"

# create folder 
mkdir "$WINEPREFIX/drive_c/Program Files/WurmClock/"

# move correct folder
mv "$POL_System_TmpDir/WurmClock.exe" "$WINEPREFIX/drive_c/Program Files/WurmClock/WurmClock.exe"
mv "$POL_System_TmpDir/WurmClock.pdf" "$WINEPREFIX/drive_c/Program Files/WurmClock/WurmClock.pdf"

POL_Shortcut 'WurmClock.exe' "$TITLE"

POL_System_TmpDelete 
POL_SetupWindow_Close
 
exit 0

Replies

Monday 13 July 2015 at 18:36
Hi lahtis,
My script review:
POL_Browser "http://forum.wurmonline.com/index.php?/topic/61451-wurmclock-desktop-app-showing-current-wurm-time-and-date/"
In general in script we asked the user before running POL_Browser, in case (s)he already has the program archive
POL_System_TmpCreate "$PREFIX"
done twice
POL_SetupWindow_browse "Please select the zip file." "$TITLE"
All user-oriented messages must support localization mechanisms (http://wiki.playonlinux.com/index.php/Scripting_-_Chapter_10:_Script_Translation)
unzip "$APP_ANSWER"
You could use POL_System_unzip instead; The added benefit is that if unarchiving fails (for whatever reason) the user will be notified
POL_SetupWindow_wait "$(eval_gettext 'Please wait while we extract $TITLE game data.')" "$TITLE"
At that point the files are already unarchived, so I don't see the point of this message. At best it should happen before unzip, and better yet POL_System_unzip could display a custom wait message while unarchiving
mkdir "$WINEPREFIX/drive_c/Program Files/WurmClock/"
Don't hardcode /Program Files/, Wine localizes this path, just like Windows does; use $PROGRAMFILES instead
mv "$POL_System_TmpDir/WurmClock.exe" "$WINEPREFIX/drive_c/Program Files/WurmClock/WurmClock.exe"
What about unarchiving in the final directory instead?
Wednesday 15 July 2015 at 13:25
The file is compressed because the installation program does not in the package. Only carry out the exe file and pdf guides.
Wednesday 15 July 2015 at 13:29
Im fix the errors this script. Thanks good review.