@@ -1,53 +1,72 @@
-#!/bin/bash
-# Date : (2018-05-05 14:00)
-# Last revision : (2018-05-05 14:00)
-# Wine version used : 3.7
-# Distribution used to test : Ubuntu 16.04
-# Author : Simoms
+#!/usr/bin/env playonlinux-bash
+# -*- mode: sh -*-
+# Date : (2009-06-07 15-40)
+# Last revision : (2019-08-17 11-52)
+# Wine version used : 3.21-staging
+# Distribution used to test : Fedora 13 & Debian 10 Buster x86_64
+# Author : Quentin PÂRIS et Alexandre BEAUGY
# Licence : Retail
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
+AUTHOR="Quentin PÂRIS et Alexandre BEAUGY"
+EDITOR="Blizzard Entertainment Inc."
+TITLE="Warcraft III - Reign of Chaos + The Frozen Throne (Battle.net Edition)"
PREFIX="WarcraftIII"
-WINEVERSION="3.7"
-TITLE="Warcraft III"
-EDITOR="Blizzard Entertainment"
-AUTHOR="Simoms"
+WORKING_WINE_VERSION="3.21-staging"
-# PlayOnLinux Setup
+# Initialisation
POL_SetupWindow_Init
POL_Debug_Init
-POL_SetupWindow_presentation "$TITLE" "$EDITOR" "$GAME_URL" "$AUTHOR" "$PREFIX"
+POL_System_SetArch "x86" # Force default value, in case it changes one day...
-# Get installer file
-if [ "$POL_SELECTED_FILE" ]; then
- INSTALLER="$POL_SELECTED_FILE"
-else
- POL_SetupWindow_browse "$(eval_gettext 'Please select the setup file to run')" "$TITLE"
- INSTALLER="$APP_ANSWER"
+# Presentation
+POL_SetupWindow_presentation "${TITLE}" "${EDITOR}" "${GAME_URL}" "${AUTHOR}" "${PREFIX}"
+
+#
+POL_System_TmpCreate "${PREFIX}"
+cd "${POL_System_TmpDir}"
+
+# Warcraft III now has a unique installer for both extensions (ROC+TFT)
+# with language selection at start
+# Automatic POL download:
+SetupIs="${POL_System_TmpDir}/Warcraft-III-Setup.exe"
+mv "${POL_System_TmpDir}/getInstallerForGame?os=win&locale=frFR&version=LIVE&gameProgram=WARCRAFT_3" "${SetupIs}"
+if [ x${SetupIs} = x ] ; then
+ # Or, manual download from:
+ # (your blizzard.com) User Account > Games > Downloads > Classical Games
+ # > Warcraft® III: The Frozen Throne®
+ POL_SetupWindow_browse "$(eval_gettext 'Please select the setup file to run')" "${TITLE}" "Warcraft-III-Setup.exe"
+ SetupIs="${APP_ANSWER}"
fi
+[ x${SetupIs} = x ] && exit 0
-[ "$INSTALLER" = "" ] && exit 0
+# Disable Mono installing dialogue
+export WINEDLLOVERRIDES="mscoree,mshtml="
-# Create prefix
-POL_Wine_SelectPrefix "$PREFIX"
-POL_Wine_PrefixCreate "$WINEVERSION"
-
-# Install game
-POL_Wine_WaitBefore "$TITLE"
-POL_Wine "$INSTALLER"
-POL_Wine_WaitExit "$TITLE"
+# Select prefix
+POL_Wine_SelectPrefix "${PREFIX}"
+POL_Wine_PrefixCreate "${WORKING_WINE_VERSION}"
+
+# Disable Mono installing dialogue
+POL_Wine_OverrideDLL "disabled" "mscoree"
+POL_Wine_OverrideDLL "disabled" "mshtml"
+
+# Install
+[ "${POL_OS}" = "Mac" ] && Set_Managed Off
+Set_OS "winxp" "sp3" # Force default value, in case it changes one day...
+POL_Wine_WaitBefore "${TITLE}"
+POL_Wine "${SetupIs}"
+POL_Wine_WaitExit "${TITLE}"
-# Ask about GPU memory size
POL_SetupWindow_VMS
+POL_System_TmpDelete
-# Create shortcuts
-POL_Shortcut "$TITLE.exe" "$TITLE"
-POL_Shortcut "$TITLE Launcher.exe" "$TITLE Launcher"
-POL_Shortcut "World Editor.exe" "$TITLE - World Editor"
-POL_Shortcut_QuietDebug "$TITLE"
+POL_Shortcut "$PROGRAMFILES/Warcraft III/x86/Warcraft III.exe" "${TITLE}" "" "-d3d9"
+POL_Shortcut_QuietDebug "${TITLE}"
POL_SetupWindow_Close
exit 0
\ No newline at end of file