El Foro

Red Faction 1

Installer and patching

Autor Respuestas
lahtis Thursday 21 February 2013 at 0:41
lahtisAnonymous

I have big problem for patching the game for the downloader.

Patching latest 1.20 patch
Orginal patch is a found http://ubuntuone.com/0X7xY9HU099mXDP1VWyWx7
Im also shared the setup.exe file http://ubuntuone.com/7SrgDOZ2kHoku9BTFhWgHV
with md5sum is 9a48a4a599f29119d19fbce5a80a9ef7
but i can not this download working. it downloading file but says not found.

The installation program may be the fact that it does not recognize all of the files. which may be required. orginal setup files are setup.exe patchw32.dll patchinfo.str and PATCH.RTP  how can i put this all into that download program. if im put all files tar-package. How to unpacking files in program. Is there POL_unzip script???

RedFactionPatch120.tar.gz
http://ubuntuone.com/4ZL4Hugqm7qSZybothTp0Q
md5sum: 5c4d4499d24549709211e8c7b8448867

if im using a playonlinux terminal and install patch. its working.

[code]
#!/bin/bash
# Date : (2013-02-21 01-15)
# Last revision : (2013-02-21 01-15)
# Wine version used : 1.5.24
# Distribution used to test : Ubuntu 12.10
# Author : lahtis
# Script licence : GPL v.2
# Program : Retail 2-cd version
# Red Faction installer and patcher.

[ -z "$PLAYONLINUX" = "" ] && exit
source "$PLAYONLINUX/lib/sources"

PREFIX="RedFaction"
WORKING_WINE_VERSION="1.5.24"
TITLE="Red Faction"
EDITOR="Volition / THQ"            
GAME_URL="http://community.redfaction.com"
AUTHOR="lahtis"

# Initialization 
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
 
# Presentation
POL_SetupWindow_presentation "$TITLE" "$EDITOR" "$GAME_URL" "$AUTHOR" "$PREFIX"

# Create Prefix
POL_Wine_SelectPrefix "$PREFIX"
POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"
Set_OS winxp
POL_SetupWindow_VMS "256"
POL_System_TmpCreate "$PREFIX" 

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

# Asking about memory size of graphic card
POL_SetupWindow_VMS $GAME_VMS

# Select virtual desktop mode on
Set_Desktop On 1024 768
 
POL_SetupWindow_browse "Please select the installation setup.exe file to CD-ROM." "$TITLE installation"
POL_SetupWindow_wait "Installation in progress." "$TITLE installation"
POL_Wine start /unix "$APP_ANSWER"
POL_Wine_WaitExit "$TITLE"
 
# Patching latest 1.20 patch
# patch is a found http://ubuntuone.com/0X7xY9HU099mXDP1VWyWx7
# it is self-extracting file for LOCAL
# im also shared the setup.exe file http://ubuntuone.com/7SrgDOZ2kHoku9BTFhWgHV
# with md5sum is 9a48a4a599f29119d19fbce5a80a9ef7
# but i can not this download working.


POL_System_TmpCreate "RFPatchTmp"

POL_SetupWindow_InstallMethod "DOWNLOAD,LOCAL"
if [ "$INSTALL_METHOD" == "LOCAL" ]; then
        POL_SetupWindow_browse "$(eval_gettext 'Select patch to execute')" "$TITLE" ""
        POL_Wine start /unix "$APP_ANSWER"
        POL_Wine_WaitExit
else
    cd "$POL_System_TmpDir"
    POL_Download "http://ubuntuone.com/7SrgDOZ2kHoku9BTFhWgHV" "9a48a4a599f29119d19fbce5a80a9ef7"
    POL_SetupWindow_wait "Wait while the Red Faction 1.20 patch is downloading...\\nThis operation can take time, depending of your connexion." "$TITLE installation"
        POL_Wine start /unix "setup.exe"
        POL_Wine_WaitExit "$TITLE"
fi

POL_System_TmpDelete 
POL_Shortcut "RedFaction.exe" "$TITLE" "$TITLE.png"

POL_SetupWindow_message "$(eval_gettext '$TITLE has been successfully installed.\\n\\nIf the game crashes at startup, open a terminal and type:\\necho 0|sudo tee /proc/sys/kernel/yama/ptrace_scope')"
 
POL_SetupWindow_Close
 
exit 0
[/code]

Using Ubuntu 16.04 LTS and latest Playonlinux.
My scripts: https://github.com/lahtis/playonlinux
petch Thursday 21 February 2013 at 1:19
petch
Developer

    POL_Download "http://ubuntuone.com/7SrgDOZ2kHoku9BTFhWgHV" "9a48a4a599f29119d19fbce5a80a9ef7"

Your problem is probably that it will create a local file called 7SrgDOZ2kHoku9BTFhWgHV in the current directory, so you may want to add a
mv 7SrgDOZ2kHoku9BTFhWgHV RedFactionPatch120.tar.gz

right after the download. The next POL_SetupWindow_wait statement is useless though, it happens too late, and if placed before POL_Download the message will probably only show a faction of second before being overwritten by POL_Download own messages (to check - but anyway it's redundant with POL_Download progress bar).

To answer your question, there's POL_System_unzip, POL_System_7z, POL_System_tar, POL_System_cabextract and POL_System_unrar, but right now they don't provide much functionality over the plain tool (just some error handling: if the tool reports an error, the script is stopped).
There's also POL_System_ExtractSingleFile, that expects a 7-zip archive and uncompresses only a single file, but displays a nice progress bar.

Other than that:
- again, start /unix is most often useless
- == does fnmatch()-like matching in Bash, strictly speaking if you want to check strings equality you should use = (you don't notice the difference until the right argument contains joker characters).
- a good practice in writing install scripts is to delay creating the virtual drive ("prefix") as much as possible to lower the probability to leave unused half-initialized virtual drives around if the script is interrupted (by an issue or otherwise). It requires to reorder a bit the script:

* presentation
* questions to the user (installation mode, file path in case of local mode)
* download in a temp directory (in case of download mode)
* virtual drive creation
* installation of dependencies
* installation of the program
* shortcuts creation

Editado por: petch

lahtis Thursday 21 February 2013 at 16:52
lahtisAnonymous

Thanks for answer. I try make a better script. Now im testing only patch script. Its faster.

Using Ubuntu 16.04 LTS and latest Playonlinux.
My scripts: https://github.com/lahtis/playonlinux
petch Thursday 21 February 2013 at 17:47
petch
Developer

You're welcome, I just hope it helps :)
lahtis Thursday 21 February 2013 at 23:25
lahtisAnonymous

Only patching Red Faction 1 1.20 version. This patcher also go to Red Faction I installer script.


#!/bin/bash
# Date : (2013-02-22 00-08)
# Last revision : (2013-02-22 00-08)
# Author : lahtis
# Script licence : GPL v.2
# Red Faction I 1.20 patch
# Only For : http://www.playonlinux.com

[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"

TITLE="Red Faction"
PREFIX="RedFaction"
PVERSION="1.20"

# Starting the script
POL_GetSetupImages "http://files.playonlinux.com/resources/setups/RedFaction1/top.jpg" "http://files.playonlinux.com/resources/setups/RedFaction1/left.jpg" "$TITLE"
POL_SetupWindow_Init

# Starting debugging API
POL_Debug_Init

POL_SetupWindow_free_presentation "$TITLE" "$(eval_gettext 'Welcome in the patch $PVERSION installer for $TITLE')"

POL_SetupWindow_checkexist()
{
if [ ! -e "$POL_USER_ROOT/wineprefix/$1" ]; then
POL_SetupWindow_message "$(eval_gettext 'Game is not installed')" "$TITLE"
POL_SetupWindow_Close
exit 0
fi
}

POL_SetupWindow_checkexist "$PREFIX"

# Setting prefix path
POL_Wine_SelectPrefix "$PREFIX"

# Create tmp directory for downloaded files
POL_System_TmpCreate "RF1PatchTmp"

# Asking about patch local or not
POL_SetupWindow_InstallMethod "DOWNLOAD,LOCAL"
if [ "$INSTALL_METHOD" == "LOCAL" ]; then
POL_SetupWindow_browse "$(eval_gettext 'Select patch to execute')" "$TITLE" ""
POL_Wine start /unix "$APP_ANSWER"
POL_Wine_WaitExit "$TITLE"
else

     # Moving tmp directory
cd "$POL_USER_ROOT/tmp/RF1PatchTmp"

     # Download patch
POL_Download "http://ubuntuone.com/5ptskYTFkuw6rAMARlIcjn" "6ba17ce7462a59fee85f4f69b2651fe6"

     # Move file to correct filename
mv 5ptskYTFkuw6rAMARlIcjn RedFactionPatch.zip

     # Unzip file     
     unzip "RedFactionPatch.zip"

     # Select setup file
     ARCHIVE="$POL_USER_ROOT/tmp/RF1PatchTmp/setup.exe"

     # Install file && check install errors
     POL_Wine "$ARCHIVE" || POL_Debug_Fatal "$(eval_gettext 'Error while installing patch.')"

     # Wait is patch is installed
     POL_Wine_WaitExit "$TITLE"
fi

# Delete tmp directory
POL_System_TmpDelete

# Create shortcut for editor
POL_Shortcut "RF.exe" "Red Faction editor" "$TITLE.png"

# Show last message and close script
POL_SetupWindow_message "$(eval_gettext '$TITLE $PVERSION patch has been successfully installed.')"
POL_SetupWindow_Close
exit 0


And Red Faction installer and 1.20 patch

#!/bin/bash
# Date : (2013-02-22 00-08)
# Last revision : (2013-02-22 00-08)
# Wine version used : 1.5.24
# Distribution used to test : Ubuntu 12.10, Nvidia Geforce 9800 GT 512MB using
# nvidia-experimental-310 driver, Intel® Core™2 Duo CPU E4400 @ 2.00GHz×2, Memory 1,9 GiB
# Author : lahtis <lahtis@gmail.com>
# Script licence : GPL v.2
# Program licence : Retail
# Red Faction installer and 1.20 patching.

[ -z "$PLAYONLINUX" = "" ] && exit
source "$PLAYONLINUX/lib/sources"

PREFIX="RedFaction"
WORKING_WINE_VERSION="1.5.24"
TITLE="Red Faction"
EDITOR="Volition / THQ"            
GAME_URL="http://community.redfaction.com"
AUTHOR="lahtis"

# Initialization 
POL_GetSetupImages "http://files.playonlinux.com/resources/setups//RedFaction1/top.jpg" "http://files.playonlinux.com/resources/setups//RedFaction1/left.jpg" "$TITLE"

POL_SetupWindow_Init
POL_Debug_Init
 
# Presentation
POL_SetupWindow_presentation "$TITLE" "$EDITOR" "$GAME_URL" "$AUTHOR" "$PREFIX"

# Create Prefix
POL_Wine_SelectPrefix "$PREFIX"
POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"
Set_OS winxp
POL_SetupWindow_VMS "256"
POL_System_TmpCreate "$PREFIX" 

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

# Asking about memory size of graphic card
POL_SetupWindow_VMS $GAME_VMS

# Select virtual desktop mode on
Set_Desktop On 1024 768
 
POL_SetupWindow_browse "Please select the installation setup.exe file to CD-ROM." "$TITLE installation"
POL_SetupWindow_wait "Installation in progress." "$TITLE installation"
POL_Wine start /unix "$APP_ANSWER"
POL_Wine_WaitExit "$TITLE"
 
# Patching latest 1.20 patch

# Create tmp directory for downloaded files
POL_System_TmpCreate "RF1PatchTmp"

POL_SetupWindow_InstallMethod "DOWNLOAD,LOCAL"
if [ "$INSTALL_METHOD" == "LOCAL" ]; then
        POL_SetupWindow_browse "$(eval_gettext 'Select patch to execute')" "$TITLE" ""
        POL_Wine start /unix "$APP_ANSWER"
        POL_Wine_WaitExit
else
    # Moving tmp directory
        cd "$POL_USER_ROOT/tmp/RF1PatchTmp"

    # Download patch
        POL_Download "http://ubuntuone.com/5ptskYTFkuw6rAMARlIcjn" "6ba17ce7462a59fee85f4f69b2651fe6"

    # Move file to correct filename
        mv 5ptskYTFkuw6rAMARlIcjn RedFactionPatch.zip

    # Unzip file   
        unzip "RedFactionPatch.zip"

    # Select setup file
        ARCHIVE="$POL_USER_ROOT/tmp/RF1PatchTmp/setup.exe"

    # Install file && check install errors
    POL_Wine "$ARCHIVE" || POL_Debug_Fatal "$(eval_gettext 'Error while installing patch.')"

    # Wait is patch is installed
    POL_Wine_WaitExit "$TITLE"   
fi

POL_System_TmpDelete 
POL_Shortcut "RedFaction.exe" "$TITLE" "$TITLE.png"

# Create shortcut for editor
POL_Shortcut "RF.exe" "Red Faction editor" "$TITLE.png"

POL_SetupWindow_message "$(eval_gettext '$TITLE and patch has been successfully installed.\\n\\nIf the game crashes at startup, open a terminal and type:\\necho 0|sudo tee /proc/sys/kernel/yama/ptrace_scope')"
 
POL_SetupWindow_Close
 
exit 0

Editado por: lahtis


Using Ubuntu 16.04 LTS and latest Playonlinux.
My scripts: https://github.com/lahtis/playonlinux