Half-Life 2

Informations

Creator Message
GNU_Raziel

Information

This installer has been approved by the team.

Informations

Platforms:
Downloads: 68967
Wine: 2.22

Feedbacks

Screenshots

Source code

#!/bin/bash
# Date : (2011-09-07 21-00)
# Last revision : see Changelog
# Wine version used : 1.3.23, 1.3.25, 1.3.37, 1.5.9
# Distribution used to test : Mint 11 x64
# Author : GNU_Raziel
# Licence : Retail
# Only For : http://www.playonlinux.com
#
#
# CHANGELOG
# GNU_Raziel (2011-09-07)
#   First script.
# GNU_Raziel (2012-07-21)
#   ?
# [Dadu042] (2019-07-31)
#   BUG: when installing from DVD, window 'Binary not found: steam.exe'.
#   Wine 1.5.9 -> 2.22 (to avoid Freetype and POl's GUI issues).


[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
 
TITLE="Half-Life 2"
PREFIX="hl2"
EDITOR="Valve"
GAME_URL="http://www.valvesoftware.com"
AUTHOR="GNU_Raziel"
WORKING_WINE_VERSION="2.22"
GAME_VMS="256"
STEAM_ID="220"
 
if [ "$POL_LANG" == "fr" ]; then
STEAM_ID="223"
elif [ "$POL_LANG" == "it" ]; then
STEAM_ID="224"
elif [ "$POL_LANG" == "de" ]; then
STEAM_ID="225"
elif [ "$POL_LANG" == "es" ]; then
STEAM_ID="226"
elif [ "$POL_LANG" == "ko" ]; then
STEAM_ID="229"
elif [ "$POL_LANG" == "ja" ]; then
STEAM_ID="231"
elif [ "$POL_LANG" == "ru" ]; then
STEAM_ID="232"
elif [ "$POL_LANG" == "th" ]; then
STEAM_ID="233"
elif [ "$POL_LANG" == "pt" ]; then
STEAM_ID="234"
fi
 
# Starting the script
POL_GetSetupImages "http://files.playonlinux.com/resources/setups/hl2/top.jpg" "http://files.playonlinux.com/resources/setups/hl2/left.jpg" "$TITLE"
POL_SetupWindow_Init
 
# Starting debugging API
POL_Debug_Init
 
POL_SetupWindow_presentation "$TITLE" "$EDITOR" "$GAME_URL" "$AUTHOR" "$PREFIX"
  
POL_SetupWindow_checkexist()
{        
        if [ -e "$POL_USER_ROOT/wineprefix/$1" ]; then
                STEAM=`find $WINEPREFIX -name "Steam.exe"`
                if [ "$STEAM" != "" ]; then
                        POL_SetupWindow_menu "$(eval_gettext 'Steam installation has been detected\nwould you like to install this game in the same virtual drive?')" "$TITLE" "$(eval_gettext 'Yes')~$(eval_gettext 'No')" "~"
                        STEAM_USE=$APP_ANSWER
                        if [ "$STEAM_USE" == "$(eval_gettext 'Yes')" ]; then
                                STEAM_USE="1"
                                PREFIX="Steam"
                        else
                                STEAM_USE="0"
                        fi
                fi
        else
                STEAM_USE="0"
        fi
}
  
POL_SetupWindow_checkexist "Steam"
  
# Setting prefix path
POL_Wine_SelectPrefix "$PREFIX"
 
if [ "$STEAM_USE" == "0" ]; then
        # Downloading wine if necessary and creating prefix
        POL_System_SetArch "x86"
        POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"
fi
 
# Choose between DVD and Digital Download version
POL_SetupWindow_InstallMethod "DVD,STEAM"
 
# Installing mandatory dependencies
if [ "$STEAM_USE" == "0" ]; then
        POL_Call POL_Install_steam
fi
 
# Mandatory pre-install fix for steam
POL_Call POL_Install_steam_flags "$STEAM_ID"
 
# Asking about memory size of graphic card
POL_SetupWindow_VMS $GAME_VMS
 
## Fix for this game
# Sound problem fix - pulseaudio related
[ "$POL_OS" = "Linux" ] && Set_SoundDriver "alsa"
[ "$POL_OS" = "Linux" ] && Set_SoundEmulDriver "Y"
## End Fix
 
# Shortcut done before install for steam version
POL_Shortcut "steam.exe" "$TITLE" "$TITLE.png" "steam://rungameid/$STEAM_ID"
POL_Shortcut "steam.exe" "Steam ($TITLE)" "" ""
 
# Begin game installation
if [ "$INSTALL_METHOD" == "DVD" ]; then
        # Asking for CDROM and checking if it's correct one
        POL_SetupWindow_message "$(eval_gettext 'Please select the setup file to run')" "$TITLE"
        POL_SetupWindow_cdrom
        POL_SetupWindow_check_cdrom "Setup.exe"
        POL_Wine start /unix "$CDROM/Setup.exe"
        POL_Wine_WaitExit "$TITLE"
else
        # Steam install
        POL_SetupWindow_message "$(eval_gettext 'When $TITLE download by Steam is finished,\nDo NOT click on Play.\n\nClose COMPLETELY the Steam interface, \nso that the installation script can continue')" "$TITLE"
        cd "$WINEPREFIX/drive_c/$PROGRAMFILES/Steam"
        POL_Wine start /unix "steam.exe" steam://install/$STEAM_ID
        POL_Wine_WaitExit "$TITLE"
fi
 
POL_SetupWindow_Close
exit 0

Contributions

Filters:

Contribute
Member Message
Dadu042 Wednesday 31 July 2019 at 12:00
Dadu042

Information

This update has been approved by the team.

Message

# [Dadu042] (2019-07-31)
#   BUG: when installing from DVD, window 'Binary not found: steam.exe'.
#   Wine 1.5.9 -> 2.22 (to avoid Freetype and POl's GUI issues).

Differences

@@ -1,25 +1,36 @@
 #!/bin/bash
 # Date : (2011-09-07 21-00)
-# Last revision : (2012-07-21 21:00)
+# Last revision : see Changelog
 # Wine version used : 1.3.23, 1.3.25, 1.3.37, 1.5.9
 # Distribution used to test : Mint 11 x64
 # Author : GNU_Raziel
 # Licence : Retail
 # Only For : http://www.playonlinux.com
+#
+#
+# CHANGELOG
+# GNU_Raziel (2011-09-07)
+#   First script.
+# GNU_Raziel (2012-07-21)
+#   ?
+# [Dadu042] (2019-07-31)
+#   BUG: when installing from DVD, window 'Binary not found: steam.exe'.
+#   Wine 1.5.9 -> 2.22 (to avoid Freetype and POl's GUI issues).
+
 
 [ "$PLAYONLINUX" = "" ] && exit 0
 source "$PLAYONLINUX/lib/sources"
-
-TITLE="Half-Life 2" 
+ 
+TITLE="Half-Life 2"
 PREFIX="hl2"
 EDITOR="Valve"
 GAME_URL="http://www.valvesoftware.com"
 AUTHOR="GNU_Raziel"
-WORKING_WINE_VERSION="1.5.9"
+WORKING_WINE_VERSION="2.22"
 GAME_VMS="256"
 STEAM_ID="220"
-
-if [ "$POL_LANG" == "fr" ]; then 
+ 
+if [ "$POL_LANG" == "fr" ]; then
 STEAM_ID="223"
 elif [ "$POL_LANG" == "it" ]; then
 STEAM_ID="224"
@@ -38,85 +49,85 @@
 elif [ "$POL_LANG" == "pt" ]; then
 STEAM_ID="234"
 fi
-
+ 
 # Starting the script
 POL_GetSetupImages "http://files.playonlinux.com/resources/setups/hl2/top.jpg" "http://files.playonlinux.com/resources/setups/hl2/left.jpg" "$TITLE"
 POL_SetupWindow_Init
-
+ 
 # Starting debugging API
 POL_Debug_Init
-
-POL_SetupWindow_presentation "$TITLE" "$EDITOR" "$GAME_URL" "$AUTHOR" "$PREFIX" 
  
+POL_SetupWindow_presentation "$TITLE" "$EDITOR" "$GAME_URL" "$AUTHOR" "$PREFIX"
+  
 POL_SetupWindow_checkexist()
-{	
-	if [ -e "$POL_USER_ROOT/wineprefix/$1" ]; then
-		STEAM=`find $WINEPREFIX -name "Steam.exe"`
-		if [ "$STEAM" != "" ]; then
-			POL_SetupWindow_menu "$(eval_gettext 'Steam installation has been detected\nwould you like to install this game in the same virtual drive?')" "$TITLE" "$(eval_gettext 'Yes')~$(eval_gettext 'No')" "~"
-			STEAM_USE=$APP_ANSWER
-			if [ "$STEAM_USE" == "$(eval_gettext 'Yes')" ]; then
-				STEAM_USE="1"
-				PREFIX="Steam"
-			else
-				STEAM_USE="0"
-			fi
-		fi
-	else
-		STEAM_USE="0"
-	fi
+{        
+        if [ -e "$POL_USER_ROOT/wineprefix/$1" ]; then
+                STEAM=`find $WINEPREFIX -name "Steam.exe"`
+                if [ "$STEAM" != "" ]; then
+                        POL_SetupWindow_menu "$(eval_gettext 'Steam installation has been detected\nwould you like to install this game in the same virtual drive?')" "$TITLE" "$(eval_gettext 'Yes')~$(eval_gettext 'No')" "~"
+                        STEAM_USE=$APP_ANSWER
+                        if [ "$STEAM_USE" == "$(eval_gettext 'Yes')" ]; then
+                                STEAM_USE="1"
+                                PREFIX="Steam"
+                        else
+                                STEAM_USE="0"
+                        fi
+                fi
+        else
+                STEAM_USE="0"
+        fi
 }
- 
+  
 POL_SetupWindow_checkexist "Steam"
- 
+  
 # Setting prefix path
 POL_Wine_SelectPrefix "$PREFIX"
-
+ 
 if [ "$STEAM_USE" == "0" ]; then
-	# Downloading wine if necessary and creating prefix
-	POL_System_SetArch "x86"
-	POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"
+        # Downloading wine if necessary and creating prefix
+        POL_System_SetArch "x86"
+        POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"
 fi
-
+ 
 # Choose between DVD and Digital Download version
 POL_SetupWindow_InstallMethod "DVD,STEAM"
-
+ 
 # Installing mandatory dependencies
 if [ "$STEAM_USE" == "0" ]; then
-	POL_Call POL_Install_steam
+        POL_Call POL_Install_steam
 fi
-
+ 
 # Mandatory pre-install fix for steam
 POL_Call POL_Install_steam_flags "$STEAM_ID"
-
+ 
 # Asking about memory size of graphic card
 POL_SetupWindow_VMS $GAME_VMS
-
+ 
 ## Fix for this game
 # Sound problem fix - pulseaudio related
 [ "$POL_OS" = "Linux" ] && Set_SoundDriver "alsa"
 [ "$POL_OS" = "Linux" ] && Set_SoundEmulDriver "Y"
 ## End Fix
-
+ 
 # Shortcut done before install for steam version
 POL_Shortcut "steam.exe" "$TITLE" "$TITLE.png" "steam://rungameid/$STEAM_ID"
 POL_Shortcut "steam.exe" "Steam ($TITLE)" "" ""
-
+ 
 # Begin game installation
 if [ "$INSTALL_METHOD" == "DVD" ]; then
-	# Asking for CDROM and checking if it's correct one
-	POL_SetupWindow_message "$(eval_gettext 'Please select the setup file to run')" "$TITLE"
-	POL_SetupWindow_cdrom
-	POL_SetupWindow_check_cdrom "Setup.exe"
-	POL_Wine start /unix "$CDROM/Setup.exe"
-	POL_Wine_WaitExit "$TITLE"
+        # Asking for CDROM and checking if it's correct one
+        POL_SetupWindow_message "$(eval_gettext 'Please select the setup file to run')" "$TITLE"
+        POL_SetupWindow_cdrom
+        POL_SetupWindow_check_cdrom "Setup.exe"
+        POL_Wine start /unix "$CDROM/Setup.exe"
+        POL_Wine_WaitExit "$TITLE"
 else
-	# Steam install
-	POL_SetupWindow_message "$(eval_gettext 'When $TITLE download by Steam is finished,\nDo NOT click on Play.\n\nClose COMPLETELY the Steam interface, \nso that the installation script can continue')" "$TITLE"
-	cd "$WINEPREFIX/drive_c/$PROGRAMFILES/Steam"
-	POL_Wine start /unix "steam.exe" steam://install/$STEAM_ID
-	POL_Wine_WaitExit "$TITLE"
+        # Steam install
+        POL_SetupWindow_message "$(eval_gettext 'When $TITLE download by Steam is finished,\nDo NOT click on Play.\n\nClose COMPLETELY the Steam interface, \nso that the installation script can continue')" "$TITLE"
+        cd "$WINEPREFIX/drive_c/$PROGRAMFILES/Steam"
+        POL_Wine start /unix "steam.exe" steam://install/$STEAM_ID
+        POL_Wine_WaitExit "$TITLE"
 fi
-
+ 
 POL_SetupWindow_Close
 exit 0
\ No newline at end of file

New source code

#!/bin/bash
# Date : (2011-09-07 21-00)
# Last revision : see Changelog
# Wine version used : 1.3.23, 1.3.25, 1.3.37, 1.5.9
# Distribution used to test : Mint 11 x64
# Author : GNU_Raziel
# Licence : Retail
# Only For : http://www.playonlinux.com
#
#
# CHANGELOG
# GNU_Raziel (2011-09-07)
#   First script.
# GNU_Raziel (2012-07-21)
#   ?
# [Dadu042] (2019-07-31)
#   BUG: when installing from DVD, window 'Binary not found: steam.exe'.
#   Wine 1.5.9 -> 2.22 (to avoid Freetype and POl's GUI issues).


[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
 
TITLE="Half-Life 2"
PREFIX="hl2"
EDITOR="Valve"
GAME_URL="http://www.valvesoftware.com"
AUTHOR="GNU_Raziel"
WORKING_WINE_VERSION="2.22"
GAME_VMS="256"
STEAM_ID="220"
 
if [ "$POL_LANG" == "fr" ]; then
STEAM_ID="223"
elif [ "$POL_LANG" == "it" ]; then
STEAM_ID="224"
elif [ "$POL_LANG" == "de" ]; then
STEAM_ID="225"
elif [ "$POL_LANG" == "es" ]; then
STEAM_ID="226"
elif [ "$POL_LANG" == "ko" ]; then
STEAM_ID="229"
elif [ "$POL_LANG" == "ja" ]; then
STEAM_ID="231"
elif [ "$POL_LANG" == "ru" ]; then
STEAM_ID="232"
elif [ "$POL_LANG" == "th" ]; then
STEAM_ID="233"
elif [ "$POL_LANG" == "pt" ]; then
STEAM_ID="234"
fi
 
# Starting the script
POL_GetSetupImages "http://files.playonlinux.com/resources/setups/hl2/top.jpg" "http://files.playonlinux.com/resources/setups/hl2/left.jpg" "$TITLE"
POL_SetupWindow_Init
 
# Starting debugging API
POL_Debug_Init
 
POL_SetupWindow_presentation "$TITLE" "$EDITOR" "$GAME_URL" "$AUTHOR" "$PREFIX"
  
POL_SetupWindow_checkexist()
{        
        if [ -e "$POL_USER_ROOT/wineprefix/$1" ]; then
                STEAM=`find $WINEPREFIX -name "Steam.exe"`
                if [ "$STEAM" != "" ]; then
                        POL_SetupWindow_menu "$(eval_gettext 'Steam installation has been detected\nwould you like to install this game in the same virtual drive?')" "$TITLE" "$(eval_gettext 'Yes')~$(eval_gettext 'No')" "~"
                        STEAM_USE=$APP_ANSWER
                        if [ "$STEAM_USE" == "$(eval_gettext 'Yes')" ]; then
                                STEAM_USE="1"
                                PREFIX="Steam"
                        else
                                STEAM_USE="0"
                        fi
                fi
        else
                STEAM_USE="0"
        fi
}
  
POL_SetupWindow_checkexist "Steam"
  
# Setting prefix path
POL_Wine_SelectPrefix "$PREFIX"
 
if [ "$STEAM_USE" == "0" ]; then
        # Downloading wine if necessary and creating prefix
        POL_System_SetArch "x86"
        POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"
fi
 
# Choose between DVD and Digital Download version
POL_SetupWindow_InstallMethod "DVD,STEAM"
 
# Installing mandatory dependencies
if [ "$STEAM_USE" == "0" ]; then
        POL_Call POL_Install_steam
fi
 
# Mandatory pre-install fix for steam
POL_Call POL_Install_steam_flags "$STEAM_ID"
 
# Asking about memory size of graphic card
POL_SetupWindow_VMS $GAME_VMS
 
## Fix for this game
# Sound problem fix - pulseaudio related
[ "$POL_OS" = "Linux" ] && Set_SoundDriver "alsa"
[ "$POL_OS" = "Linux" ] && Set_SoundEmulDriver "Y"
## End Fix
 
# Shortcut done before install for steam version
POL_Shortcut "steam.exe" "$TITLE" "$TITLE.png" "steam://rungameid/$STEAM_ID"
POL_Shortcut "steam.exe" "Steam ($TITLE)" "" ""
 
# Begin game installation
if [ "$INSTALL_METHOD" == "DVD" ]; then
        # Asking for CDROM and checking if it's correct one
        POL_SetupWindow_message "$(eval_gettext 'Please select the setup file to run')" "$TITLE"
        POL_SetupWindow_cdrom
        POL_SetupWindow_check_cdrom "Setup.exe"
        POL_Wine start /unix "$CDROM/Setup.exe"
        POL_Wine_WaitExit "$TITLE"
else
        # Steam install
        POL_SetupWindow_message "$(eval_gettext 'When $TITLE download by Steam is finished,\nDo NOT click on Play.\n\nClose COMPLETELY the Steam interface, \nso that the installation script can continue')" "$TITLE"
        cd "$WINEPREFIX/drive_c/$PROGRAMFILES/Steam"
        POL_Wine start /unix "steam.exe" steam://install/$STEAM_ID
        POL_Wine_WaitExit "$TITLE"
fi
 
POL_SetupWindow_Close
exit 0

Replies

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