Installer une Appimage
Installer une Appimage
1 Installation (ex: PyCDCover)
créer le dossier “PyCdCover-AppImage. Y enclure:
Dossiers à inclure dans AppDir
Dossier Pourquoi ? Controleur/ Contient le contrôleur du programme. locales/ locales (langues) Modele/ Contient les classes métier (PDF, gabarit…). Vue/ Interface graphique PySide6. ressources/ Images, templates, fichiers utilisés à l’exécution. 📄 Fichiers à inclure
Fichier Utilité pycdcover.py Script principal qui lance l’application. pycdcover.png Icône de l’application (pour l’AppImage). LICENSE.md Obligatoire dans un paquet si tu veux le distribuer. README.md Recommandé mais pas obligatoire. requirements.txt liste des dépendances Fichier Utilité install.sh script maison qui pilote toute la construction REMARQUE - Important: pour Piveo, il ne faut pas intégrer les dossiers *.JSON, les .db, le dossier “fichiers.
Rendre exécutable “install.sh”:
1
chmod +x install.sh
exécuter “install.sh”:
1
./install.sh
l’AppImage est construite. La rendre exécutable:
1
chmod +x PyCDCover-x86_64.AppImageet puis l’exécuter:
1
./PyCDCover-x86_64.AppImage
2 intégration dans Ubuntu
1
sudo mkdir -p /opt/PyCDCover
1
sudo cp PyCDCover-x86_64.AppImage /opt/PyCDCover/1
sudo chmod +x /opt/PyCDCover/PyCDCover-x86_64.AppImage
Alacarte
Alacarte permet de créer un exécutable sur les bureaux GNU/Linux
4 Effacement
Effacer l’appimage:
1
sudo rm /opt/PyCDCover/PyCDCover-x86_64.AppImage(Optionnel) Nettoyer le cache d’icônes
1
update-desktop-database ~/.local/share/applications/
5 Scripts “Install.sh
5.1 Script “Install.sh - PyCDCover
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
#!/bin/bash
set -e
APP=PyCDCover
ARCH=x86_64
APPDIR=AppDir
PYTHON=python3
echo "== PyCDCover AppImage builder =="
# 1) Nettoyage
rm -rf "$APPDIR"
rm -f "$APP-$ARCH.AppImage"
# 2) Arborescence AppDir
mkdir -p "$APPDIR/usr/bin"
mkdir -p "$APPDIR/usr/lib/python3/site-packages"
# 3) Copie du projet
cp -r \
Controleur \
Modele \
Vue \
locales \
ressources \
pycdcover.py \
pycdcover.png \
"$APPDIR/"
# 4) Exécutable principal (point d’entrée unique)
cat > "$APPDIR/usr/bin/pycdcover" <<'EOF'
#!/bin/bash
HERE="$(dirname "$(readlink -f "$0")")"
export PYTHONPATH="$HERE/../lib/python3/site-packages:$HERE/../.."
exec python3 "$HERE/../../pycdcover.py"
EOF
chmod +x "$APPDIR/usr/bin/pycdcover"
# 5) AppRun
cat > "$APPDIR/AppRun" <<'EOF'
#!/bin/bash
HERE="$(dirname "$(readlink -f "$0")")"
exec "$HERE/usr/bin/pycdcover"
EOF
chmod +x "$APPDIR/AppRun"
# 6) Fichier .desktop
cat > "$APPDIR/PyCDCover.desktop" <<EOF
[Desktop Entry]
Type=Application
Name=PyCDCover
Exec=pycdcover
Icon=pycdcover
Categories=Audio;Utility;
Terminal=false
EOF
# 7) Icône
cp pycdcover.png "$APPDIR/"
# 8) Dépendances Python
$PYTHON -m pip install -r requirements.txt \
--target "$APPDIR/usr/lib/python3/site-packages" \
--break-system-packages \
--disable-pip-version-check
# 9) appimagetool
if [ ! -f appimagetool-x86_64.AppImage ]; then
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
chmod +x appimagetool-x86_64.AppImage
fi
# 10) Création AppImage
ARCH=$ARCH ./appimagetool-x86_64.AppImage "$APPDIR"
echo "✅ AppImage générée : $APP-$ARCH.AppImage"
5.2 Script “Install.sh - PyCDCover
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
#!/bin/bash
set -e
APP=Piveo
ARCH=x86_64
APPDIR=AppDir
PYTHON=python3
echo "== Piveo AppImage builder =="
# 1) Nettoyage
rm -rf "$APPDIR"
rm -f "$APP-$ARCH.AppImage"
# 2) Arborescence AppDir
mkdir -p "$APPDIR/usr/bin"
mkdir -p "$APPDIR/usr/lib/python3/site-packages"
# 3) Copie du projet
cp \
Piveo.pyw \
FenetrePrincipale.py \
ChoixOrganisme.py \
FrameGauche.py \
FrameDroiteHaute.py \
FrameDroiteBasse.py \
GestionLangue.py \
ModifierBDD.py \
utils.py \
utils_i18n.py \
"$APPDIR/"
cp -r locales "$APPDIR/"
# 4) Exécutable principal (POINT D’ENTRÉE UNIQUE)
cat > "$APPDIR/usr/bin/piveo" <<'EOF'
#!/bin/bash
HERE="$(dirname "$(readlink -f "$0")")"
export PYTHONPATH="$HERE/../lib/python3/site-packages:$HERE/../.."
exec python3 "$HERE/../../Piveo.pyw"
EOF
chmod +x "$APPDIR/usr/bin/piveo"
# 5) AppRun
cat > "$APPDIR/AppRun" <<'EOF'
#!/bin/bash
HERE="$(dirname "$(readlink -f "$0")")"
exec "$HERE/usr/bin/piveo"
EOF
chmod +x "$APPDIR/AppRun"
# 6) Desktop
cat > "$APPDIR/Piveo.desktop" <<EOF
[Desktop Entry]
Type=Application
Name=Piveo
Exec=piveo
Icon=piveo
Categories=Education;Utility;
Terminal=false
EOF
# 7) Icône
cp piveo.png "$APPDIR/"
# 8) Dépendances Python
$PYTHON -m pip install PySide6 \
--target "$APPDIR/usr/lib/python3/site-packages" \
--break-system-packages \
--disable-pip-version-check
# 9) appimagetool
if [ ! -f appimagetool-x86_64.AppImage ]; then
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
chmod +x appimagetool-x86_64.AppImage
fi
# 10) Création AppImage
ARCH=$ARCH ./appimagetool-x86_64.AppImage "$APPDIR"
echo "✅ AppImage générée : $APP-$ARCH.AppImage"
This post is licensed under CC BY 4.0 by the author.