POL_PCGamingWiki_Download

Informations

Creator Message
med_freeman

Information

This installer has been approved by the team.

Informations

Platforms:
Downloads: 6805
Wine: System

Feedbacks

Description

Download a file from http://pcgamingwiki.com in current folder
Parameters:
- 1: file relative url (i.e : 303-no-one-lives-forever-2-a-spy-in-harms-way-english-patch)

       since all files are under http://community.pcgamingwiki.com/files/download/     
- 2: result file name
- 3: download title

- 4: file md5 sum

Source code

local URL="$1"
local FILE="$2"
local NAME="$3"
local SERVER_MD5="$4"
POL_System_wget "http://community.pcgamingwiki.com/files/download/$URL" "$NAME" -O "$FILE"
local LOCAL_MD5="$(POL_MD5_file "$FILE")"
if [ "$LOCAL_MD5" = "$SERVER_MD5" ]
    then
        POL_Debug_Message "Download MD5 matches"
    else
        POL_SetupWindow_question "$URL\n\n$(eval_gettext 'Error ! Files mismatch\n\nLocal : $LOCAL_MD5\nServer : $SERVER_MD5')\n\n$(eval_gettext 'Do you want to retry?')"
        if [ "$APP_ANSWER" = "TRUE" ]; then
                POL_PCGamingWiki_Download "$URL" "$FILE" "$NAME" "$SERVER_MD5"
        else
                POL_Debug_Error "MD5 sum mismatch !"
        fi
    fi

Contributions

Filters:

Contribute
Member Message
med_freeman Friday 29 May 2015 at 17:56
med_freeman

Information

This update has been approved by the team.

Differences

@@ -0,0 +1,17 @@
+local URL="$1"
+local FILE="$2"
+local NAME="$3"
+local SERVER_MD5="$4"
+POL_System_wget "http://community.pcgamingwiki.com/files/download/$URL" "$NAME" -O "$FILE"
+local LOCAL_MD5="$(POL_MD5_file "$FILE")"
+if [ "$LOCAL_MD5" = "$SERVER_MD5" ]
+    then
+        POL_Debug_Message "Download MD5 matches"
+    else
+        POL_SetupWindow_question "$URL\n\n$(eval_gettext 'Error ! Files mismatch\n\nLocal : $LOCAL_MD5\nServer : $SERVER_MD5')\n\n$(eval_gettext 'Do you want to retry?')"
+        if [ "$APP_ANSWER" = "TRUE" ]; then
+                POL_PCGamingWiki_Download "$URL" "$FILE" "$NAME" "$SERVER_MD5"
+        else
+                POL_Debug_Error "MD5 sum mismatch !"
+        fi
+    fi
\ No newline at end of file

New source code

local URL="$1"
local FILE="$2"
local NAME="$3"
local SERVER_MD5="$4"
POL_System_wget "http://community.pcgamingwiki.com/files/download/$URL" "$NAME" -O "$FILE"
local LOCAL_MD5="$(POL_MD5_file "$FILE")"
if [ "$LOCAL_MD5" = "$SERVER_MD5" ]
    then
        POL_Debug_Message "Download MD5 matches"
    else
        POL_SetupWindow_question "$URL\n\n$(eval_gettext 'Error ! Files mismatch\n\nLocal : $LOCAL_MD5\nServer : $SERVER_MD5')\n\n$(eval_gettext 'Do you want to retry?')"
        if [ "$APP_ANSWER" = "TRUE" ]; then
                POL_PCGamingWiki_Download "$URL" "$FILE" "$NAME" "$SERVER_MD5"
        else
                POL_Debug_Error "MD5 sum mismatch !"
        fi
    fi

Replies