The forum

[script] F.E.A.R 2 Project Origin

Author Replies
Jump to the page: 1 - 2
NSLW Tuesday 7 July 2009 at 19:20
NSLW

Hello,
I wrote script which installs F.E.A.R. 2 Project Origin or adapts version installed through Steam. It also can patch the game after it's been installed.
Wine version : 1.1.25
Distribution : Fedora
Distribution Version : 11 (32 bit)
Graphics card : Nvidia, GeForce 9xxx
Drivers of the graphics card : 185.18.14
Comments :
I don't know what are disc labels If you've got originals then please contact me.

Icon for the game:





#!/bin/bash
# Date : (2009-07-06 12-00)
# Last revision : (2009-10-26 21-10)
# Wine version used : 1.1.25
# Distribution used to test : Fedora 11
# Author : NSLW
# Licence : Retail
# Depend : ImageMagick, icoutils
 
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
 
#fetching PROGRAMFILES environmental variable
PROGRAMFILES=`wine cmd /c echo "%ProgramFiles%"`
PROGRAMFILES=${PROGRAMFILES:3}
 
TYTUL="F.E.A.R. 2 Project Origin"
PREFIX="FEAR2"
STEAM="0"
 
Get_Latest_Wine_Version()
{
cd "$REPERTOIRE/tmp"
POL_SetupWindow_download "Downloading Wine versions list" "$TYTUL" "http://mulx.playonlinux.com/wine/linux-i386/LIST"
xyz=`cat "$REPERTOIRE/tmp/LIST" | sed -e 's/\\.//g' | cut -d';' -f2 | sort -n | tail -n1`
echo "$(echo $xyz | cut -c1-1).$(echo $xyz | cut -c2-2).$(echo $xyz | cut -c3-4)"
}
 
POL_SetupWindow_make_icon_for_shortcut()
{
LAUNCHERFILENAME="$REPERTOIRE/configurations/installed/$1"
EXEPATH=`cat "$LAUNCHERFILENAME" | tail -n 2 | head -n 1 | cut -d'"' -f2`
EXENAME=`cat "$LAUNCHERFILENAME" | tail -n 1 | cut -d'"' -f2`
 
wrestool "$EXEPATH/$EXENAME" -x -t14 > "$REPERTOIRE/tmp/icon.ico"
ICOBITDEPTH=`icotool -l "$REPERTOIRE/tmp/icon.ico" | grep '\\-\\-width=32' | cut -d' ' -f5 | cut -d'=' -f2 | sort -n |tail -n 1`
ICOINDEX=`icotool -l "$REPERTOIRE/tmp/icon.ico" | grep "\\-\\-width=32" | grep "\\-\\-bit-depth=$ICOBITDEPTH" | tail -n 1 | cut -d' ' -f2 | cut -d'=' -f2`
icotool -x --index=$ICOINDEX "$REPERTOIRE/tmp/icon.ico" -o "$REPERTOIRE/icones/32/$1"
}


wget http://upload.wikimedia.org/wikipedia/en/9/90/POF2picture.jpg --output-document="$REPERTOIRE/tmp/leftnotscaled.jpeg"
convert "$REPERTOIRE/tmp/leftnotscaled.jpeg" -scale 150x356\\! "$REPERTOIRE/tmp/left.jpeg"
POL_SetupWindow_Init "" "$REPERTOIRE/tmp/left.jpeg"

POL_SetupWindow_presentation "$TYTUL" "Monolith" "www.whatisfear.com" "NSLW" "$PREFIX" 

if [ ! -e "$REPERTOIRE/configurations/installed/Steam" ]; then
	POL_SetupWindow_message "Please install Steam before $TYTUL"
	POL_SetupWindow_Close
	exit
fi

#asking about Steam
POL_SetupWindow_menu "What do you want to do?" "Actions" "Install game from DVD~Adapt Steam version" "~"
if [ "$APP_ANSWER" == "Adapt Steam version" ]; then
	if [ ! -d "$REPERTOIRE/wineprefix/Steam/drive_c/$PROGRAMFILES/Steam/steamapps/common/fear2" ];then
		POL_SetupWindow_message "Please install $TYTUL in Steam first"
		POL_SetupWindow_Close
		exit
	else
	STEAM="1"
	fi
fi

select_prefix "$REPERTOIRE/wineprefix/$PREFIX"
 
LATESTVERSION=$(Get_Latest_Wine_Version)
CHOSENWINEVERSION="$LATESTVERSION"
POL_SetupWindow_install_wine "$LATESTVERSION"
Use_WineVersion "$CHOSENWINEVERSION"

POL_SetupWindow_prefixcreate
 
#downloading Visual C++ 2005 SP1
if [ ! -e "$HOME/.winetrickscache/vcredist_x86.exe" ]
then
mkdir "$HOME/.winetrickscache"
cd "$HOME/.winetrickscache"
POL_SetupWindow_download "PlayOnLinux is downloading Visual C++ 2005 SP1 runtime libraries" "Visual C++ 2005 SP1" " http://download.microsoft.com/download/e/1/c/e1c773de-73ba-494a-a5ba-f24906ecf088/vcredist_x86.exe"
fi
 
cd "$REPERTOIRE/ressources"
 
# checking if wmfadist.exe (3.9MB) is in ressources
if [ "`sha1sum < wmfadist.exe | sed 's/ .*//'`" != "333750aa2d2121ad3e332ada651add83170b7bf8" ]; then
POL_SetupWindow_wait_next_signal "PlayOnLinux is downloading Windows Media Format 9..." "$TYTUL"
wget http://www.acoustica.com/downloading.asp?p=1002
POL_SetupWindow_detect_exit
fi
 
#downloading winetricks
if [ "`sha1sum < winetricks | sed 's/ .*//'`" != "e71457524b2f9a0c81369745ea9018d9278565b2" ]; then
wget http://winezeug.googlecode.com/svn/trunk/winetricks --output-document=winetricks
fi
 
WINETRICKSDX=`cat winetricks | grep \\/directx | cut -d'_' -f2`
WINETRICKSDXLINK=`cat winetricks | grep \\/directx | cut -d'/' -f5,6,7,8`
 
#modyfing winetricks
cd "$WINEPREFIX/drive_c/windows/temp"
cat "$REPERTOIRE/ressources/winetricks" | sed -e 's/set_winver\\ win2k/set_winver\\ winxp/' > winetricks
 
#downloading DirectX
if [ ! -e "$HOME/.winetrickscache/directx_${WINETRICKSDX}_redist.exe" ]; then
mkdir "$HOME/.winetrickscache"
cd "$HOME/.winetrickscache"
POL_SetupWindow_download "Downloading DirectX 9.0c libraries" "$TITLE" "http://download.microsoft.com/download/$WINETRICKSDXLINK/directx_${WINETRICKSDX}_redist.exe"
fi
 
if [ "$STEAM" == "0" ]; then
select_prefix "$REPERTOIRE/wineprefix/Steam"
 
POL_SetupWindow_message "Please insert first F.E.A.R. 2 DVD" "$TYTUL"
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "Setup.exe"

#adding CD-ROM as drive d: e: to winecfg
CDROM2=${CDROM//"1"/"2"} #FEAR2 DISC 2
cd "$WINEPREFIX/dosdevices"
ln -s "$CDROM" d:
ln -s "$CDROM2" e:
 
cd "$WINEPREFIX/drive_c/windows/temp/"
echo "[HKEY_LOCAL_MACHINE\\\\Software\\\\Wine\\\\Drives]" > cdrom.reg
echo "\\"d:\\"=\\"cdrom\\"" >> cdrom.reg
echo "\\"e:\\"=\\"cdrom\\"" >> cdrom.reg
regedit cdrom.reg
sleep 5
 
#starting installation
#POL_SetupWindow_wait_next_signal "Installation in progress..." "$TYTUL"
cd "$CDROM"
wine "Setup.exe"
POL_SetupWindow_message "Please insert second DVD when installer asks and press Forward" "$TYTUL"
wine eject d:
POL_SetupWindow_message "Click \\"Next\\" when installation will finish." "$TYTUL"
#POL_SetupWindow_detect_exit
 
fi
select_prefix "$REPERTOIRE/wineprefix/$PREFIX"

cd "$WINEPREFIX/drive_c/windows/temp/"
#asking about memory size
POL_SetupWindow_menu_list "How much memory do your graphic card have got?" "$TYTUL" "32-64-128-256-384-512-768-890-1024-2048" "-" "256"
VMS="$APP_ANSWER"
 
echo "[HKEY_CURRENT_USER\\\\Software\\\\Wine\\\\Direct3D]" > vms.reg
echo "\\"VideoMemorySize\\"=\\"$VMS\\"" >> vms.reg
regedit vms.reg
 
#setting Multisampling to enabled
echo "[HKEY_CURRENT_USER\\\\Software\\\\Wine\\\\Direct3D]" > msa.reg
echo "\\"Multisampling\\"=\\"enabled\\"" >> msa.reg
regedit msa.reg
 
cd "$WINEPREFIX/drive_c/windows/temp"
#installing DirectX
POL_SetupWindow_wait_next_signal "Installing DirectX libraries..." "$TYTUL"
bash winetricks -q directx9
POL_SetupWindow_detect_exit
 
#installing Visual C++ 2005 SP1
POL_SetupWindow_wait_next_signal "Installing Visual C++ 2005 SP1 runtime libraries..." "$TYTUL"
bash winetricks -q vcrun2005sp1
POL_SetupWindow_detect_exit
 
cd "$REPERTOIRE/ressources"
POL_SetupWindow_wait_next_signal "Installing  Windows Media Format 9..." "$TYTUL"
wine wmfadist.exe /Q
POL_SetupWindow_detect_exit
 
#get the mouse working
Set_Managed "Off"
 
#cleaning temp
cd "$WINEPREFIX/drive_c/windows/temp/"
rm -rf *
 
#making shortcut
POL_SetupWindow_make_shortcut "$PREFIX" "$PROGRAMFILES/Steam/steamapps/common/fear2" "FEAR2.exe" "" "$TYTUL" "" ""
Set_WineVersion_Assign "$CHOSENWINEVERSION" "$TYTUL"

cd "$REPERTOIRE/configurations/installed"
mv -f "$TYTUL" "FEAR2"
cat "FEAR2" | sed -e "s/$PREFIX\\/drive\\_c/Steam\\/drive\\_c/" > "$TYTUL"
rm -f "FEAR2"
 
POL_SetupWindow_make_icon_for_shortcut "$TYTUL"
POL_SetupWindow_message "$TYTUL has been installed successfully" "$TYTUL"
 
POL_SetupWindow_message_image "Please note that this game has a copy protection system\\nand sadly, it prevents Wine from running the game.\\n\\nPlayOnLinux will not provide any help concerning any illegal\\nstuff." "Note about copy protection" "$PLAYONLINUX/themes/tango/warning.png"
 
POL_SetupWindow_Close
exit

Edited by NSLW

talsemgeest Saturday 25 July 2009 at 11:02
talsemgeestAnonymous

Hi, thanks for the script but I keep getting the error "Unable to find the version : 1.1.25"

Is there any way to fix or get past this?

I have tried on a fresh install of both Ubuntu9.04 32 and 64 bit, and on fedora 11 64 bit. I am guessing it has to do with the wine version, and I have tried installing different wine versions to no avail.

Edited by talsemgeest

NSLW Saturday 25 July 2009 at 21:48
NSLW

Please try now
talsemgeest Sunday 26 July 2009 at 0:49
talsemgeestAnonymous

Works beautifully, thanks. I am very grateful to you for this script.
NSLW Monday 27 July 2009 at 20:34
NSLW

Nice :)
Could you answer for following questions?
1) Do actors voices work?
2) Do you've got 2 DVD version?
Thanks in advance for your informations :)
Berillions Saturday 24 October 2009 at 18:38
Berillions

Hello NSLW,

- In your script, you install completly F.E.A.R 2 (Steam and game) if Steam is not installed.
- If F.E.A.R 2 is already install in Steam, you adapt the Steam Version.

But, how you install the game if Steam is installed and not the game? :)
Because, i have installed Steam with the Tinou's script for Counter-Strike 1.6.

I did a manual installation and I choose the Steam Prefix (Steam script) and i can install the game in this Prefix thanks to the Setup.exe in the CDROM.

You can add this option in your script no?

Berillions

NSLW Sunday 25 October 2009 at 9:05
NSLW

But, how you install the game if Steam is installed and not the game? :)

Quote from Berillions

You start your Steam installed earlier and install F.E.A.R2 in this Steam then you start my script which creates shortcuts for F.E.A.R 2 and prepares prefix which doesn't contain FEAR but it's its environment.


I did a manual installation and I choose the Steam Prefix (Steam script) and i can install the game in this Prefix thanks to the Setup.exe in the CDROM.

Quote from Berillions

Does then F.E.A.R 2 shows in your Steam window?
Berillions Sunday 25 October 2009 at 10:00
Berillions


You start your Steam installed earlier and install F.E.A.R2 in this Steam

Quote from NSLW


If i install F.E.A.R2 after to start Steam, Steam download the game entierly, it's very long if you are a low connection.

For me it's doesn't work. Steam doesn't download the game at the end of the preparation of files.

So with my method, it's quicker because I install the game thanks to the DVD. The game has a size of 12Go. But, before the installation, you must copy the 2DVD in a TEMP folder because i can't eject the first DVD when the installation ask me to insert the Second DVD. I have an error message told me that the first dvd is used.

Does then F.E.A.R 2 shows in your Steam window?

Quote from NSLW

I test and i edit my message.

Edited by Berillions


NSLW Monday 26 October 2009 at 8:34
NSLW

i can't eject the first DVD when the installation ask me to insert the Second DVD. I have an error message told me that the first dvd is used.

Quote from Berillions

Do that appears when installing via my modified POL script?


I did a manual installation and I choose the Steam Prefix (Steam script) and i can install the game in this Prefix thanks to the Setup.exe in the CDROM.

Quote from Berillions

Does DVD installation requires Steam or can it be installed without Steam and why do you installed it in Steam wineprefix and not in separate wineprefix?

BTW. If you've got legal copy of game then could you give here labels of your two DVDs?
Thanks in advance.
Berillions Monday 26 October 2009 at 11:21
Berillions


Do that appears when installing via my modified POL script?

Quote from NSLW

No, i have this message when i did a manual installation. i'm going to try by editing your script.


BTW. If you've got legal copy of game then could you give here labels of your two DVDs?

Quote from NSLW

Yes, i have a legal copy of game. How to get the labels for my two DVDs?

NSLW Monday 26 October 2009 at 11:34
NSLW

Yes, i have a legal copy of game. How to get the labels for my two DVDs?

Quote from Berillions

On Fedora it's the name under the DVD is mounted in /media directory. On others distro you may want to start K3B or Brasero and choose copy disc, then you'll have exact disc label.
Berillions Monday 26 October 2009 at 11:51
Berillions

Ok, in frugalware -current when i insert the DVD, it's mounted in /media directory.

/media/disk_1 for the first DVD
/media/disk_2 for the second DVD

I try to install the game in other prefix thanks to your script. When i launch Steam to prepare the installation files, wine wants to download and install gecko.
But after her installation, wine is stopped and the installation of Fear 2 not begin.... :^^:

Edited by Berillions


NSLW Monday 26 October 2009 at 12:45
NSLW

I try to install the game in other prefix thanks to your script. When i launch Steam to prepare the installation files, wine wants to download and install gecko.
But after her installation, wine is stopped and the installation of Fear 2 not begin.... :^^:

Quote from Berillions


My script does start Setup.exe and not Steam. Does starting Setup.exe causes Steam to start?
Berillions Monday 26 October 2009 at 13:03
Berillions

When you launch Setup.exe in the First DVD you must:
- To install Steam
- To connect on Steam with your login/password
- and only after, the F.E.A.R 2's installation begin.

NSLW Monday 26 October 2009 at 17:46
NSLW

When you launch Setup.exe in the First DVD you must:
- To install Steam
- To connect on Steam with your login/password
- and only after, the F.E.A.R 2's installation begin.

Quote from Berillions

That clarified me a lot of things and I modified my script according to your info, but I lack only one: F.E.A.R 2 downloaded from Steam is in
Program Files/Steam/steamapps/common/fear2
Does F.E.A.R 2 from DVD installs itself also in that path? If not then please give me the correct path. Thanks in advance.

BTW. Does Steam work good with latest Wine? I ask because I seen post saying it works and POL assigns very old version to it.

Edited by NSLW

Berillions Monday 26 October 2009 at 18:26
Berillions

1- If you install F.E.A.R.2 with the DVD, the game is also installed in Program Files/Steam/steamapps/common/fear2.

2- Steam work good with the latest version of Wine (1.1.31, i don't know the 1.1.32), for me.

NSLW Monday 26 October 2009 at 18:34
NSLW

So i think my script is finished. Now it waits till somebody test it. Thanks Berillions for your help :)
Berillions Monday 26 October 2009 at 18:38
Berillions

i will try your script with the install from DVD :)

Edit : It's very strange but the Steam's update is very very long...

Edited by Berillions


NSLW Monday 26 October 2009 at 18:57
NSLW

What does it update?
Berillions Monday 26 October 2009 at 19:02
Berillions

This update after to launch F.E.A.R.2 Setup :


Blocked at 12% for 10 minutes...

Edited by Berillions


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 dmcayonlinux.com