Forums

Exécution de script bloquée

Et ce n'est pas le then Tinou... ^^

Auteur Réponses
DjLeChuck Samedi 13 Mars 2010 à 23:01
DjLeChuckAnonymous

Bonsoir à toutes et à tous,

Je suis en train de réaliser des scripts d'installation pour Tales of Monkey Island mais suis confronté à un soucis.
Durant l'exécution, le script se bloque. À la fin du script j'ai ceci :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
wine "$ANSWER"
POL_SetupWindow_detect_exit
POL_SetupWindow_message "$MSG_FINISH_MI"
 
# Si le client est fr, on propose d installer le patch FR réalisé par http://www.monkeyisland.fr
if [ "$POL_LANG" == "fr" ]  POL_SetupWindow_question "Voulez-vous installer le patch FR réalisé par la team de http://www.monkeyisland.fr ?" "Patch FR"
    if["$APP_ANSWER" == 0]
        POL_SetupWindow_wait_next_signal "Installation du patch FR en cours..." "Installation"
        cd $REPERTOIRE/tmp
        rm *.ttarch
        wget $LIEN_SITE/0.ttarch
        mv 0.ttarch "$REPERTOIRE/wineprefix/$PREFIX_MI/drive_c/Program Files/Telltale Games/Tales of Monkey Island/Rise of the Pirate God/Pack/"
         
        POL_SetupWindow_detect_exit
        POL_SetupWindow_message "Installation du patch FR terminée."
    fi
fi
 
POL_SetupWindow_make_shortcut "TalesMonkeyIsland" "Program Files/Telltale Games/Tales of Monkey Island/Rise of the Pirate God/" "MonkeyIsland105.exe" "" "Tales of Monkey Island - Rise of the God Pirate"
 
Set_WineVersion_Assign "1.1.29" "Tales of Monkey Island - Rise of the God Pirate"

L'exécution se bloque à l'arrivée sur la condition. Le script reste bloqué.
Si je commenta le if et le fi, le code à l'intérieur s'exécute puis se bloque au message indiquant la fin de l'installation du patch FR.

D'où vient se problème, ai-je fais quelque chose de travers ?

Edité par DjLeChuck

Quentin PÂRIS Samedi 13 Mars 2010 à 23:07
Quentin PÂRISAnonymous

T'as oublié les then

La syntaxe c'est

if [ condition ]
then
blablabla
fi
DjLeChuck Samedi 13 Mars 2010 à 23:09
DjLeChuckAnonymous

... *boulet inside*

Merci Tinou, j'aurais jamais cherché ici pour moi l'erreur venait d'ailleurs (like E.T.).

Shame on me quand même, c'est tout bête cette erreur. ><

EDIT :
Ah non problème non réglé.
J'ai toujours le même problème. :/

Edité par DjLeChuck

Quentin PÂRIS Samedi 13 Mars 2010 à 23:26
Quentin PÂRISAnonymous

Montre ton code du début à la fin du script
DjLeChuck Samedi 13 Mars 2010 à 23:27
DjLeChuckAnonymous

Oui bien sur, le voici :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/bin/bash
if [ "$PLAYONLINUX" = "" then
    exit 0
fi
source "$PLAYONLINUX/lib/sources"
 
# Mise en place des chaînes de texte
PREFIX_MI="TalesMonkeyIsland"
if [ "$POL_LANG" == "fr" ]
then
    MSG_CLIENT_MI="Veuillez indiquer où se trouve le fichier d'installation ToMI_RiseOfThePirateGod_Setup.exe"
    MSG_INFO_WINE="Wine version 1.1.29 va être installé."
    MSG_DL_WINE="Téléchargement de Wine 1.1.29 en cours, veuillez patienter..."
    TITRE_DL_WINE="Téléchargement de Wine"
    MSG_FINISH_WINE="Installation de Wine terminée."
    MSG_INSTALL_MI="Installation de Tales of Monkey Island - Rise of the Pirate God en cours..."
    TITLE_INSTALL_MI="Installation en cours"
    MSG_INFO_MI="Durant l'installation, décochez la vérification de DirectX."
    MSG_FINISH_MI="Installation de  Tales of Monkey Island - Rise of the Pirate God terminée."
else
    MSG_CLIENT_MI="Please indicate where is the installation file ToMI_RiseOfThePirateGod_Setup.exe"
    MSG_INFO_WINE="Wine version 1.1.29 will be installed."
    MSG_DL_WINE="Downloading of Wine 1.1.29. Please wait..."
    TITRE_DL_WINE="Downloading of Wine"
    MSG_FINISH_WINE="Wine installation finished."
    MSG_INSTALL_MI="Installation of Tales of Monkey Island - Rise of the Pirate God..."
    TITLE_INSTALL_MI="Installation"
    MSG_INFO_MI="During the installation, uncheck the DirectX verification."
    MSG_FINISH_MI="Installation of  Tales of Monkey Island - Rise of the Pirate God finished."
fi
 
# Récupération des images
cd $REPERTOIRE/tmp
rm *.xpm
rm *.ttarch
wget $LIEN_SITE/icone.xpm
 
POL_SetupWindow_Init
POL_SetupWindow_presentation "Tales of Monkey Island - Rise of the God Pirate" "Telltale Games" "http://www.telltalegames.com" "DjLeChuck" "$PREFIX_MI"
 
select_prefixe "$REPERTOIRE/wineprefix/$PREFIX_MI"
POL_SetupWindow_prefixcreate
 
Set_OS "winxp"
 
# Installation de Wine 1.1.29
POL_SetupWindow_message "$MSG_INFO_WINE" "Information" 1 3
POL_SetupWindow_wait_next_signal "$MSG_DL_WINE" "$TITRE_DL_WINE"
POL_SetupWindow_install_wine "1.1.29"
POL_SetupWindow_detect_exit
POL_SetupWindow_message "$MSG_FINISH_WINE"
 
# Installation du jeu
POL_SetupWindow_browse "$MSG_CLIENT_MI" ""
ANSWER="$APP_ANSWER"
POL_SetupWindow_message "$MSG_INFO_MI"
POL_SetupWindow_wait_next_signal "$MSG_INSTALL_MI" "$TITLE_INSTALL_MI" 3 3
wine "$ANSWER"
POL_SetupWindow_detect_exit
POL_SetupWindow_message "$MSG_FINISH_MI"
 
# Si le client est fr, on propose d installer le patch FR réalisé par http://www.monkeyisland.fr
if [ "$POL_LANG" == "fr" ]
then
    POL_SetupWindow_question "Voulez-vous installer le patch FR réalisé par la team de http://www.monkeyisland.fr ?" "Patch FR"
    if["$APP_ANSWER" == 0]
    then
        POL_SetupWindow_wait_next_signal "Installation du patch FR en cours..." "Installation"
        cd $REPERTOIRE/tmp
        rm *.ttarch
        wget $LIEN_SITE/0.ttarch
        cp 0.ttarch "$REPERTOIRE/wineprefix/$PREFIX_MI/drive_c/Program Files/Telltale Games/Tales of Monkey Island/Rise of the Pirate God/Pack/"
         
        POL_SetupWindow_detect_exit
        POL_SetupWindow_message "Installation du patch FR terminée."
    fi
fi
 
POL_SetupWindow_make_shortcut "TalesMonkeyIsland" "Program Files/Telltale Games/Tales of Monkey Island/Rise of the Pirate God/" "MonkeyIsland105.exe" "$REPERTOIRE/tmp/icone.xpm" "Tales of Monkey Island - Rise of the God Pirate"
 
Set_WineVersion_Assign "1.1.29" "Tales of Monkey Island - Rise of the God Pirate"
 
# Clean du répertoire tmp
cd $REPERTOIRE/tmp
rm *.xpm
rm *.ttarch
 
POL_SetupWindow_reboot
POL_SetupWindow_Close
 
exit

Edité par DjLeChuck

Quentin PÂRIS Samedi 13 Mars 2010 à 23:40
Quentin PÂRISAnonymous

il faut mettre un espace dans les crochets du if

if [ condition ] et non if [condition]
DjLeChuck Samedi 13 Mars 2010 à 23:45
DjLeChuckAnonymous

Cela ne change rien.
Le script bloque toujours quand je clic sur Suivant au moment du if [ "$POL_LANG" == "fr" ]. :/
Si je clic sur annuler, l'exécution se stop.

Edité par DjLeChuck

Compte supprimé Dimanche 14 Mars 2010 à 10:13
Compte suppriméAnonymous

Mets des points-virgules avant tes then mon Bibieuw !

1
if [ "$POL_LANG" == "fr" ]; then
Quentin PÂRIS Dimanche 14 Mars 2010 à 12:22
Quentin PÂRISAnonymous

Exécute ton script grâce a un terminal, et regardes si tu ne trouves pas d'erreurs.

Pour éxécuter un script POL dans un terminal (POL n'est pas obligé d'être lancé)

export PLAYONLINUX="/usr/share/playonlinux/"
bash ton_script
DjLeChuck Dimanche 14 Mars 2010 à 17:07
DjLeChuckAnonymous

Bon, il y avait un soucis de syntaxe avec ma condition ainsi qu'une erreur de retour de variable.
La doc indiqué un retour en 0 - 1 alors que c'était en FALSE - TRUE.
Le problème est réglé. =)

Merci à vous deux.

P.S. : Le ; au if se fait seulement si le then est sur la même ligne.
Si le then est à la ligne suivante, le ; n'a pas à être mit.

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 dmca@playonlinux.com