Bon, j'ai réalisé moi même le script, finalement, et un peu appris au passage !
#!/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
Par contre, maintenant, j'ai problème étrange : quand je lance ce script dans un terminal, l'usage du CPU est normal. Quand je le lance à partir de nautilus, le script utilise à fond un des coeurs.... Comment régler ce problème ?