The forum

Script pour Syberia 2

Author Replies
syberia303 Sunday 27 December 2009 at 18:16
syberia303Anonymous

Bonjour,

Voilà un petit script pour faciliter l'installation de Syberia 2.


#!/bin/bash
#Vérifier que PlayOnLinux est bien exécuté avant
[ "$PLAYONLINUX" = "" ] && exit 0 
 
#Charger les librairies
source "$PLAYONLINUX/lib/sources"

wget http://upload.wikimedia.org/wikipedia/en/0/0d/Syberia2.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_Init "" "" 

#Presentation
POL_SetupWindow_presentation "Syberia II" "MC2" "http://www.syberia-series.com/fr/" "syberia303" "Syberia2"


if [ "$POL_LANG" == "fr" ]; then
LNG_WAIT_WARNING="Syberia II : la nouvelle Aventure de Benoit Sokal"
LNG_WAIT_START="L'installation va commencer..." 
LNG_WAIT_END="Appuyez sur "Suivant" UNIQUEMENT quand l'installation du jeu sera\\n
terminée sous peine de devoir recommencer l'installation."
LNG_WAIT_HF="Kate Walker est de retour pour de nouvelles aventures."

else
LNG_WAIT_WARNING="Syberia II: the new Adventure game conceived by Benoit Sokal"
LNG_WAIT_START="Installation is going to begin..." 
LNG_WAIT_END="Click on "Next" ONLY when the game installation is finished\\n
or you will have to install again the game."
LNG_WAIT_HF="Kate Walker is back for some new adventures."
fi 

POL_SetupWindow_message "$LNG_WAIT_WARNING"

POL_SetupWindow_message "$LNG_WAIT_START"

select_prefix "$HOME/.PlayOnLinux/wineprefix/Syberia2"
POL_SetupWindow_prefixcreate  

POL_SetupWindow_cdrom  
POL_SetupWindow_check_cdrom "Setup.exe"

#fetching PROGRAMFILES environmental variable
PROGRAMFILES=`wine cmd /c echo "%ProgramFiles%"`
PROGRAMFILES=${PROGRAMFILES:3} 

wine "$CDROM/Setup.exe"

POL_SetupWindow_message "$LNG_WAIT_END"

POL_SetupWindow_reboot 

POL_SetupWindow_make_shortcut "Syberia2" "$PROGRAMFILES/Microids/Syberia 2/" "Syberia2.exe" "$HOME/.local/share/icons/4886_syberia2.0.xpm" "Syberia 2"

POL_SetupWindow_message "$LNG_WAIT_HF" 

POL_SetupWindow_Close 
exit

Je vais essayer de mettre quelques screenshots pour illustrer.


++

Edit Berillions : Erreurs par-ci par-là qui ont été corrigées.


Merci pour les corrections.

Voici un lien vers les screenshots du jeu.

Pour info, le son fonctionne sans problème.

Edited by syberia303

syberia303 Thursday 7 January 2010 at 20:51
syberia303Anonymous

Ca serait sympa de laisser des commentaires ou des retours par rapport au script, si tout fonctionne ou ce qui cloche. Mercid'avance.

++
syberia303 Saturday 27 November 2010 at 12:54
syberia303Anonymous

Le script pourrait être ajouté dans les scripts officiels car je l'ai testé sur 3 configurations différentes:

1. Debian Lenny avec geforce 2 gts 32: le script a été fait sur cette machine.
2. Debian 50% testing / 50% sid après quelques bidouilles avec les drivers nvidia 190.53
et wine en version 1.0.1
3. Debian testing avec une ATI 4890 (fglrx 10.7 puis 10.9) et wine en version 1.0.1

Tout fonctionne parfaitement sauf que je n'ai pas été très loin dans le jeu car je préfèrerais quand même faire le premier avant la suite :p.

Si quelqu'un passe par ici et a des sauvegardes pour tester un peu plus loin...

La seule chose qui me chagrine, c'est qu'une fois le jeu installé, l'icône du jeu n'apparaît pas dans le menu!
SuperPlumus Saturday 27 November 2010 at 13:52
SuperPlumusAnonymous

Bonjour, merci pour le script.

Il faudrait corriger les choses suivantes dans le script :

Remplacer :
wget http://upload.wikimedia.org/wikipedia/en/0/0d/Syberia2.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_Init "" ""

Par :
POL_GetSetupImages "<ADRESSE_IMAGE_TOP>" "<ADRESSE_IMAGE_LEFT>" "$TITLE"
POL_SetupWindow_InitWithImages

Explications : Ces 2 nouvelles fonctions remplace tout le code ci-dessus, de plus il est préférable que les images se trouvent directement sur www.playonlinux.com, pour cela il faut mettre les images sur le forum, puis il faut qu'un admin les importes sur le site de PlayOnLinux au moment de la validation de ton script.
Note : Ce n'est pas grave si tu n'a pas l'image top.

Remplacer :
LNG_WAIT_END="Appuyez sur "Suivant" UNIQUEMENT quand l'installation du jeu sera\\nterminée sous peine de devoir recommencer l'installation."

Ainsi que :
LNG_WAIT_END="Click on "Next" ONLY when the game installation is finished\\nor you will have to install again the game."


Par :
LNG_WAIT_END="Appuyez sur \\"Suivant\\" UNIQUEMENT quand l'installation du jeu sera\\nterminée sous peine de devoir recommencer l'installation."

Et :
LNG_WAIT_END="Click on \\"Next\\" ONLY when the game installation is finished\\nor you will have to install again the game."

Explications : Ajout d'anti-slashs devant les guillemets.

Remplacer :
PROGRAMFILES=`wine cmd /c echo "%ProgramFiles%"`
PROGRAMFILES=${PROGRAMFILES:3}

Par :
POL_LoadVar_PROGRAMFILES

Explications : La nouvelle fonction remplace les 2 lignes ci-dessus.

Remplacer :
POL_SetupWindow_make_shortcut "Syberia2" "$PROGRAMFILES/Microids/Syberia 2/" "Syberia2.exe" "$HOME/.local/share/icons/4886_syberia2.0.xpm" "Syberia 2"

Par :
POL_SetupWindow_auto_shortcut "Syberia2" "Syberia2.exe" "Syberia 2" "syberia2.xpm"

Explications : Il faut récupérer l'icône et la mettre à disposition sur le forum avec les images top et left, afin que, lors de la validation de ton script, un admin puisse l'importer sur www.playonlinux.com

Je pense que c'est tout, et encore merci pour le script.

Je ne possède malheureusement pas le jeu, donc je pourrai pas le tester.

EDIT : Modification suite à la remarque de GNU_Raziel, merci à toi, j'ai encore un peu de peine à faire rentrer cette nouvelle fonction dans mes habitudes.

Edited by SuperPlumus

GNU_Raziel Saturday 27 November 2010 at 16:28
GNU_Raziel

Il ne faut plus utiliser POL_SetupWindow_make_shortcut mais POL_SetupWindow_auto_shortcut.

Une fois que ton script sera conformes aux standards POL, il sera ajouté au dépot officiel.
syberia303 Sunday 28 November 2010 at 18:19
syberia303Anonymous

[code language=playonlinux]#!/bin/bash
# date 2010-11-28
# Wine version used : 1.0.1 debian repository
# Distribution used to test : Debian Squeeze (Testing)
# Author : syberia303
#Vérifier que PlayOnLinux est bien exécuté avant
[ "$PLAYONLINUX" = "" ] && exit 0 
 
#Charger les librairies
source "$PLAYONLINUX/lib/sources"

TITLE="Syberia II"
 
POL_GetSetupImages "<ADRESSE_IMAGE_TOP>" "<ADRESSE_IMAGE_LEFT>" "$TITLE"
POL_SetupWindow_InitWithImages
 
#Presentation
POL_SetupWindow_presentation "Syberia II" "MC2" "http://www.syberia-series.com/fr/" "syberia303" "SyberiaII"
 
 
if [ "$POL_LANG" == "fr" ]; then
LNG_WAIT_WARNING="Syberia II : la nouvelle Aventure de Benoit Sokal"
LNG_WAIT_START="L'installation va commencer..." 
LNG_INSERT_MEDIA="Veuillez insérer le disque $TITLE dans votre lecteur si ce n'est pas déja fait.\\nPensez à le monter si rien ne passe lors du choix du point de montage."
LNG_WAIT_END="Appuyez sur \\"Suivant\\" UNIQUEMENT quand l'installation du jeu sera\\nterminée sous peine de devoir recommencer l'installation."
LNG_WAIT_HF="Kate Walker est de retour pour de nouvelles aventures."
else
LNG_WAIT_WARNING="Syberia II: the new Adventure game conceived by Benoit Sokal"
LNG_WAIT_START="Installation is going to begin..." 
LNG_INSERT_MEDIA="Please insert $TITLE media into your disk drive if not already done.\\nDon't forget to mount it if nothing happens when you're asked for the mounting point."
LNG_WAIT_END="Click on \\"Next\\" ONLY when the game installation is finished\\nor you will have to install again the game."
LNG_WAIT_HF="Kate Walker is back for some new adventures."
fi 
 
POL_SetupWindow_message "$LNG_WAIT_WARNING"
 
POL_SetupWindow_message "$LNG_WAIT_START"

POL_SetupWindow_message "$LNG_INSERT_MEDIA"
 
select_prefix "$HOME/.PlayOnLinux/wineprefix/SyberiaII"
POL_SetupWindow_prefixcreate  
 
POL_SetupWindow_cdrom  
POL_SetupWindow_check_cdrom "Setup.exe"
 
#fetching PROGRAMFILES environmental variable
POL_LoadVar_PROGRAMFILES
 
wine "$CDROM/Setup.exe"
 
POL_SetupWindow_message "$LNG_WAIT_END"
 
POL_SetupWindow_reboot 
 
POL_SetupWindow_auto_shortcut "SyberiaII" "Syberia2.exe" "Syberia II" "syberia2.xpm"
 
POL_SetupWindow_message "$LNG_WAIT_HF" 
 
POL_SetupWindow_Close 
exit


L'icône du jeu

L'image top

L'image left

Edited by syberia303

syberia303 Sunday 28 November 2010 at 18:25
syberia303Anonymous

[code language=playonlinux]#!/bin/bash
# date 2010-11-28
# Wine version used : 1.0.1 debian repository
# Distribution used to test : Debian Squeeze (Testing)
# Author : syberia303
#Vérifier que PlayOnLinux est bien exécuté avant
[ "$PLAYONLINUX" = "" ] && exit 0 
 
#Charger les librairies
source "$PLAYONLINUX/lib/sources"

TITLE="Syberia II"
 
POL_GetSetupImages "<ADRESSE_IMAGE_TOP>" "<ADRESSE_IMAGE_LEFT>" "$TITLE"
POL_SetupWindow_InitWithImages
 
#Presentation
POL_SetupWindow_presentation "Syberia II" "MC2" "http://www.syberia-series.com/fr/" "syberia303" "SyberiaII"
 
 
if [ "$POL_LANG" == "fr" ]; then
LNG_WAIT_WARNING="Syberia II : la nouvelle Aventure de Benoit Sokal"
LNG_WAIT_START="L'installation va commencer..." 
LNG_INSERT_MEDIA="Veuillez insérer le disque $TITLE dans votre lecteur si ce n'est pas déja fait.\\nPensez à le monter si rien ne passe lors du choix du point de montage."
LNG_WAIT_END="Appuyez sur \\"Suivant\\" UNIQUEMENT quand l'installation du jeu sera\\nterminée sous peine de devoir recommencer l'installation."
LNG_WAIT_HF="Kate Walker est de retour pour de nouvelles aventures."
else
LNG_WAIT_WARNING="Syberia II: the new Adventure game conceived by Benoit Sokal"
LNG_WAIT_START="Installation is going to begin..." 
LNG_INSERT_MEDIA="Please insert $TITLE media into your disk drive if not already done.\\nDon't forget to mount it if nothing happens when you're asked for the mounting point."
LNG_WAIT_END="Click on \\"Next\\" ONLY when the game installation is finished\\nor you will have to install again the game."
LNG_WAIT_HF="Kate Walker is back for some new adventures."
fi 
 
POL_SetupWindow_message "$LNG_WAIT_WARNING"
 
POL_SetupWindow_message "$LNG_WAIT_START"

POL_SetupWindow_message "$LNG_INSERT_MEDIA"
 
select_prefix "$HOME/.PlayOnLinux/wineprefix/SyberiaII"
POL_SetupWindow_prefixcreate  
 
POL_SetupWindow_cdrom  
POL_SetupWindow_check_cdrom "Setup.exe"
 
#fetching PROGRAMFILES environmental variable
POL_LoadVar_PROGRAMFILES
 
wine "$CDROM/Setup.exe"
 
POL_SetupWindow_message "$LNG_WAIT_END"
 
POL_SetupWindow_reboot 
 
POL_SetupWindow_auto_shortcut "SyberiaII" "Syberia2.exe" "Syberia II" "syberia2.xpm"
 
POL_SetupWindow_message "$LNG_WAIT_HF" 
 
POL_SetupWindow_Close 
exit


L'icône du jeu

L'image top

L'image left

Quote from syberia303


J'ai rajouté un petit peu de contenu mais j'ai testé et ça marche.
GNU_Raziel Sunday 28 November 2010 at 18:47
GNU_Raziel

syberia303 Sunday 28 November 2010 at 18:52
syberia303Anonymous

Je l'ai mis en validation avec la description. Merci pour votre aide. En espérant que ça fera plaisir à quelques joueurs!
GNU_Raziel Monday 29 November 2010 at 0:55
GNU_Raziel

Voila la version définitive corrigée et standardisée :
#!/bin/bash
# date 2010-11-28
# Wine version used : 1.0.1 debian repository
# Distribution used to test : Debian Squeeze (Testing)
# Author : syberia303

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

TITLE="Syberia II"
PREFIX="SyberiaII"
WORKING_WINE_VERSION="1.0.1"

if [ "$POL_LANG" == "fr" ]; then
LNG_WAIT_WARNING="Syberia II : la nouvelle Aventure de Benoit Sokal"
LNG_WAIT_START="L'installation va commencer..." 
LNG_INSERT_MEDIA="Veuillez insérer le disque $TITLE dans votre lecteur si ce n'est pas déja fait.\\nPensez à le monter si rien ne passe lors du choix du point de montage."
LNG_WAIT_END="Appuyez sur \\"Suivant\\" UNIQUEMENT quand l'installation du jeu sera\\nterminée sous peine de devoir recommencer l'installation."
LNG_WAIT_HF="Kate Walker est de retour pour de nouvelles aventures."
else
LNG_WAIT_WARNING="Syberia II: the new Adventure game conceived by Benoit Sokal"
LNG_WAIT_START="Installation is going to begin..." 
LNG_INSERT_MEDIA="Please insert $TITLE media into your disk drive if not already done.\\nDon't forget to mount it if nothing happens when you're asked for the mounting point."
LNG_WAIT_END="Click on \\"Next\\" ONLY when the game installation is finished\\nor you will have to install again the game."
LNG_WAIT_HF="Kate Walker is back for some new adventures."
fi 

#starting the script
rm "$REPERTOIRE/tmp/*.jpg"
POL_GetSetupImages "http://files.playonlinux.com/resources/setups/syberia2/top.jpg" "http://files.playonlinux.com/resources/setups/syberia2/left.jpg" "$TITLE"
POL_SetupWindow_InitWithImages
 
#Presentation
POL_SetupWindow_presentation "$TITLE" "MC2" "http://www.syberia-series.com/fr/" "syberia303" "$PREFIX"

POL_SetupWindow_message "$LNG_WAIT_WARNING"  "$TITLE"
 
POL_SetupWindow_message "$LNG_WAIT_START"  "$TITLE"
 
select_prefix "$REPERTOIRE/wineprefix/$PREFIX"

#downloading specific Wine
POL_SetupWindow_install_wine "$WORKING_WINE_VERSION"
Use_WineVersion "$WORKING_WINE_VERSION"
 
#fetching PROGRAMFILES environmental variable
POL_LoadVar_PROGRAMFILES

POL_SetupWindow_message "$LNG_INSERT_MEDIA"  "$TITLE"
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "Setup.exe"
wine start /unix "$CDROM/Setup.exe"
 
POL_SetupWindow_message "$LNG_WAIT_END" "$TITLE"

## PlayOnMac Section
[ "$PLAYONMAC" == "" ] || Set_Managed "Off"
## End Section
 
POL_SetupWindow_auto_shortcut "$PREFIX" "Syberia2.exe" "$TITLE" "$TITLE.png" ""
Set_WineVersion_Assign "$WORKING_WINE_VERSION" "$TITLE"
 
POL_SetupWindow_message "$LNG_WAIT_HF" "$TITLE"
POL_SetupWindow_Close 
exit


Merci pour ta contribution, pense juste, la prochaine fois, a fournir les fichiers images (top/left/miniature/icone) au bon format et à la bonne taille svp.

Icone : 32x32 ou supérieur, format png
Icone d'installation : 24x24, format png
Top : 64x64, format jpg
Left : 150x356, format jpg
Miniature : 200x150 format png

Edited by GNU_Raziel

syberia303 Sunday 5 December 2010 at 17:40
syberia303Anonymous

Désolé pour le travail que tu as fourni en plus. J'ai regardé dans la documentation mais apparemment elle est un peu ancienne et donc je n'ai pas trouvé les spécifications pour les images et les nouvelles commandes.