Upload
dinhthuan
View
221
Download
4
Embed Size (px)
Citation preview
Création d’installateurs pour Windows avecInnoSetup
5e rencontre DevelopR6
14 juin 2012
F. Langrognet
Laboratoire de Mathématiques de Besançon
F. Langrognet () INNOSETUP Juin 2012 1 / 50
INNOSETUP
1 Fiche d’identité - Fonctionnalités
2 Utilisation via l’assistant logiciel
3 Personnalisation
4 Conclusion et alternatives
F. Langrognet () INNOSETUP Juin 2012 2 / 50
INNOSETUP
1 Fiche d’identité - Fonctionnalités
2 Utilisation via l’assistant logiciel
3 Personnalisation
4 Conclusion et alternatives
F. Langrognet () INNOSETUP Juin 2012 3 / 50
Fiche d’indentité
InnoSetup
Site web : www.jrsoftware.org
Auteur : Jordan Russel
Projet actif depuis 199729 mai 2012 : InnoSetup 5.5.0
Licence libre (innosetup license)Permet le déploiement de toutlogiciel (even for commercial use)
F. Langrognet () INNOSETUP Juin 2012 4 / 50
Principales fonctionnalités
InnoSetupCréé un Wizard (.exe)
pour installer une application sous Windows
Fonctionne sur toutes les versions de Windows (depuis Windows 2000) -32 et 64 bits
Gère l’installation, la désinstallation et installations personnalisées (Full,Compact, Custom, ...)
Plusieurs formats de compression
Création de raccourcis (menu Démarrer, sur le Bureau)
Multilinguisme
Installation protégée par mot de passe
Création d’entrées dans la base de registres Windows
F. Langrognet () INNOSETUP Juin 2012 5 / 50
INNOSETUP
1 Fiche d’identité - Fonctionnalités
2 Utilisation via l’assistant logiciel
3 Personnalisation
4 Conclusion et alternatives
F. Langrognet () INNOSETUP Juin 2012 6 / 50
InnoSetup
Principe
F. Langrognet () INNOSETUP Juin 2012 7 / 50
Assitant logiciel (Wizard)
Assitant logiciel de InnoSetupPermet de créer le fichier iss (script) très facilement.
ExempleOn souhaite créer un installateur pour déployer demo_DevelopR6 avec :
developR6.exe
un logo
un fichier de licence
F. Langrognet () INNOSETUP Juin 2012 8 / 50
Assitant logiciel (Wizard)
Une démo !. . .
Ou presque
F. Langrognet () INNOSETUP Juin 2012 9 / 50
Assitant logiciel (Wizard)
Démarrage de InnoSetup
F. Langrognet () INNOSETUP Juin 2012 10 / 50
Assitant logiciel (Wizard)
On choisit d’utiliser l’assistantlogiciel
F. Langrognet () INNOSETUP Juin 2012 11 / 50
Assitant logiciel (Wizard)
Quelques informations sur leproduit . . .
F. Langrognet () INNOSETUP Juin 2012 12 / 50
Assitant logiciel (Wizard)
Nom de l’application
Version
Editeur
Site web
F. Langrognet () INNOSETUP Juin 2012 13 / 50
Assitant logiciel (Wizard)
Dossier d’installation(Program Files)
Nom du dossier
. . .
F. Langrognet () INNOSETUP Juin 2012 14 / 50
Assitant logiciel (Wizard)
Exécutable à installer
Possibilité de lancer ceprogramme à la fin del’installation
Other application files :dépendances éventuelles(dll)
F. Langrognet () INNOSETUP Juin 2012 15 / 50
Assitant logiciel (Wizard)
Menu Démarrer :
L’utilisateur peut modifier ledossier de l’application
Création d’un lien vers le siteweb
Création d’une entrée pourla désinstallation
Sur le Bureau :
L’utilisateur peut créer unraccourci
F. Langrognet () INNOSETUP Juin 2012 16 / 50
Assitant logiciel (Wizard)
Licence associé au logiciel
F. Langrognet () INNOSETUP Juin 2012 17 / 50
Assitant logiciel (Wizard)
Multilinguisme
F. Langrognet () INNOSETUP Juin 2012 18 / 50
Assitant logiciel (Wizard)
Derniers réglages
Ex : ajout d’une icône
F. Langrognet () INNOSETUP Juin 2012 19 / 50
Assitant logiciel (Wizard)
Voilà, c’est fini !
F. Langrognet () INNOSETUP Juin 2012 20 / 50
Assitant logiciel (Wizard)
Enfin...
presque !
F. Langrognet () INNOSETUP Juin 2012 21 / 50
Fichier .iss / InnoSetup
L’assistant logiciel de InnoSetup créé simplement un fichier .iss (innosetupscript) qu’il faut compiler pour créer l’installateur
F. Langrognet () INNOSETUP Juin 2012 22 / 50
Installation
Installation
F. Langrognet () INNOSETUP Juin 2012 23 / 50
Installation
Choix de la langue
F. Langrognet () INNOSETUP Juin 2012 24 / 50
Installation
Message de bienvenue
F. Langrognet () INNOSETUP Juin 2012 25 / 50
Installation
Affichage et acceptation de lalicence
F. Langrognet () INNOSETUP Juin 2012 26 / 50
Installation
Choix du dossier d’installation
F. Langrognet () INNOSETUP Juin 2012 27 / 50
Installation
Personnalisation des raccourcisIci : le nom du dossier dans leMenu Démarrer
F. Langrognet () INNOSETUP Juin 2012 28 / 50
Installation
Choix supplémentairesIci : création de l’icône sur leBureau
F. Langrognet () INNOSETUP Juin 2012 29 / 50
Installation
Prêt ?
F. Langrognet () INNOSETUP Juin 2012 30 / 50
Installation
Installation termminéeOn peut lancer l’application
F. Langrognet () INNOSETUP Juin 2012 31 / 50
Installation
Menu Démarrer
Le menu Démarrer contient :
Un raccourci versl’application
Un raccourci pour ladésinstallation
Un raccourci vers le site web
F. Langrognet () INNOSETUP Juin 2012 32 / 50
Installation
Raccourci
Raccourci sur le bureau
F. Langrognet () INNOSETUP Juin 2012 33 / 50
INNOSETUP
1 Fiche d’identité - Fonctionnalités
2 Utilisation via l’assistant logiciel
3 Personnalisation
4 Conclusion et alternatives
F. Langrognet () INNOSETUP Juin 2012 34 / 50
Personnalisation
L’assistant logiciel permet de créer un fichier .iss (script innosetup).Ce script est personnalisable.
Structure d’un script InnoSetup
Sections
F. Langrognet () INNOSETUP Juin 2012 35 / 50
SectionsPrincipales sections
[Setup] : informations pour l’installation et la désinstallation
[Languages] : informations pour le multilinguisme
[Files] : liste des fichiers à installer
. . .F. Langrognet () INNOSETUP Juin 2012 36 / 50
Constantes - Variables
Constantes
{app} : le répertoire dans lequel l’application sera installée
{win} : le répertoire dans lequel est installé Windows (ex : C :WINDOWS)
{pf} : le répertoire de Progam Files de Windows
. . .
VariablesDéfinition d’une variable :
F. Langrognet () INNOSETUP Juin 2012 37 / 50
ProgrammationLa section [code]
Section permettant de personnalisation par programmation (Delphi) :
◮ Modifier les pages standards de l’installateur◮ Ajouter des pages◮ Créer des fonctions personnalisées◮ . . .
Programmation événementielle :
◮ Evénements standards :⋆ function NextButtonClick(CurPageId : Integer) : Boolean⋆ function BackButtonClick(CurPageID : Integer) : Boolean⋆ procedure CancelButtonClick(CurPageID : Integer ; var Cancel,
Confirm : Boolean)◮ Evénements personnalisés
Autres fonctions :
◮ function CheckPassword(Password : String) : Boolean◮ function IsAdminLoggedOn() : Boolean
F. Langrognet () INNOSETUP Juin 2012 38 / 50
Programmation
Exemple de personnalisationCréation d’un bouton infos sur chaque page
F. Langrognet () INNOSETUP Juin 2012 39 / 50
Programmation
Exemple de personnalisation
F. Langrognet () INNOSETUP Juin 2012 40 / 50
Registres
Accès Registres
La section [Registry] permet d’accéder à la base de registres Windows(lecture, écriture) lors de l’installation
On peut aussi utiliser les fonctions ad’hoc dans la section [Code]
F. Langrognet () INNOSETUP Juin 2012 41 / 50
Registres
Un exemple d’accès auxregistres
F. Langrognet () INNOSETUP Juin 2012 42 / 50
Registres
Contenu du registre
Entrée Info dans la base deregistres
F. Langrognet () INNOSETUP Juin 2012 43 / 50
Registres
Accès aux registres dans [Code]
Appel à la fonctionRegQueryStringValue
F. Langrognet () INNOSETUP Juin 2012 44 / 50
Registres
Installation
Affichage de la valeur issue de labase de registres
F. Langrognet () INNOSETUP Juin 2012 45 / 50
INNOSETUP
1 Fiche d’identité - Fonctionnalités
2 Utilisation via l’assistant logiciel
3 Personnalisation
4 Conclusion et alternatives
F. Langrognet () INNOSETUP Juin 2012 46 / 50
Conclusion
InnoSetup
Utilisation facile (assistant graphique simple)
Très complet
Personnalisation par programmation
Licence souple
Projet actif, pérenne
Code disponible (Delphi)
Communauté active (forum, ...)
F. Langrognet () INNOSETUP Juin 2012 47 / 50
Logiciels connexes
Logiciels connexes
Inno Script Generator (pour générer et configurer le .iss)
F. Langrognet () INNOSETUP Juin 2012 48 / 50
Alternatives
NSIS
InstallShield
DreamShield
InstalCreator
cpack(/cmake)
Comparaison InnoSetup/NSIS
F. Langrognet () INNOSETUP Juin 2012 49 / 50
Ressourceswww.jrsoftware.org
www.commentcamarche.net/download/telecharger-60-inno-setup-compiler
www.commentcamarche.net/faq/33511-creer-un-setup-d-installation-inno-setup-compiler
www.siteduzero.com/tutoriel-3-38596-inno-setup-un-peu-plus-loin.html
thierryaim.developpez.com/tutoriel/innosetup/iscode/
www.opencandy.com/2011/06/09/installer-platform-comparison-making-the-right-choice/
Création d’installateurs pour Windows avec InnoSetup
FIN
Merci de votre attention
F. Langrognet () INNOSETUP Juin 2012 50 / 50