Hi,
As we all know, FreeSpace 2 still needs the original VP files in order to work.
That's why everyone who hasn't bought the game while it was in retail shops has now to buy it from Good Old Games...
Thats not a big deal for Microsoft Windows users, but Linux users have to use Wine to install the game, and then move these VPs to their FreeSpace 2 root/data folder. It's a hassle for some of the new players who are not used to the way fs2_open handles its files (the process can include some renaming).
I brought together a small bash script with a Zenity GUI to help with this part : it takes the good old games FS2 installer, gets the right files and put them in the right place.
This bash script has 2 dependencies : zenity and innoextract . Both are absolutely needed (zenity should be already installed on Ubuntu, innoextract has to be installed).
Hopefully, wxLauncher will soon include a part that does the same thing, except way cleaner, but maybe that can help to streamline the install process on Linux for the moment.
For now, sed is eating a bit too much CPU, so i'm searching for a lighter way to make a good progress bar...
Here's the code :
#!/bin/sh
#Script by Hellzed, use it, modify it, share it as you want.
#This script should check if we are running as superuser... Not implemented yet.
#What this script does : extract base VP files from the Good Old Games Installer, drop the useless stuff, and put the VPs into /data to complete a base fs2_open install.
zenity --question --width=450 --title="FreeSpace 2 Base Files Extractor" --text="This program will extract base files from the Good Old Games FreeSpace 2 installer for Microsoft Windows and place them into your FreeSpace 2 Open root folder.\n\nFreeSpace 2 Open may not work properly without these files.\n\nBefore starting the extraction process, please check that you have already bought and downloaded the FreeSpace 2 installer for Microsoft Windows from GoodOldGames.com .\n\nWARNING: Run this program as a superuser if FreeSpace 2 is installed as root.\n\nClick \"Yes\" to proceed with the extraction."
if [ $? = "0" ]
then
#User input : where is the GOG.com FS2 installer ? Plus a bunch of checks
GOG_INSTALLER=`zenity --file-selection --title="Select the Good Old Games installer"`
case $? in
0)
echo "\"$GOG_INSTALLER\" is selected.";;
1)
echo "No file selected.";;
-1)
echo "Uneexpected error.";;
esac
#User input : where is FS2 installed ? Plus a bunch of checks
FS2_DIRECTORY=`zenity --file-selection --directory --title="Select FreeSpace 2 game root folder"`
case $? in
0)
echo "\"$FS2_DIRECTORY\" is selected.";;
1)
echo "No file selected.";;
-1)
echo "Unexpected error.";;
esac
#We work in the FS2 install folder
cd $FS2_DIRECTORY
#/data folder is created
mkdir $FS2_DIRECTORY"/data"
#We need somewhere to put the mess included in the GOG installer, as the backend of this script (innoextract) is not able to extract individual files
mkdir $FS2_DIRECTORY"/tmp_"$$
cd $FS2_DIRECTORY"/tmp_"$$
#Important things going on here. innoextract is absolutely needed to crack open the GOG installer. It's in the Ubuntu repository, i don't know about other distros. I should include a check to verify if it's installed. Or even have innoextract as a dependency if somehow it gets packaged.
innoextract -L -q --progress=true -e $GOG_INSTALLER | sed -n -u -E 's/(^|.*[^0-9])([0-9]{1,3})(\.[0-9])%.*/\2\n# Extracting files... \2\%/p' | zenity --progress --width=450 --title="FreeSpace 2 Base Files Extractor"
if [ $? -gt 0 ]
then
#Extraction failure
echo "ERROR! Extraction process aborted."
zenity --error --width=300 --title="FreeSpace 2 Base Files Extractor" --text="Extraction process aborted."
else
#If the extraction is successful, we move the VP files to the data folder.
mv $FS2_DIRECTORY"/tmp_"$$"/app/"*".vp" $FS2_DIRECTORY"/data/"
#we could also keep the MVE movies. I guess everyone uses the OGG ones now. Not sure. This part could also include md5sum checks, just to be sure...
zenity --info --width=450 --title="FreeSpace 2 Base Files Extractor" --text="Extraction process complete.\n\nYou may now run the original FreeSpace 2 game using an appropriate launcher, or acquire mods for an even better experience.\nMore information at www.hard-light.net ."
fi
#Anyway we remove useless
rm -Rf $FS2_DIRECTORY"/tmp_"$$
else
echo "Extraction aborted. Nothing to do"
fi
EDIT : this thing really needs some testing, so if you have the GOG FS2 installer on your linux computer, you know what to do !