Création d installateurs pour Windows avec InnoSetup 14 juin 2012 F. Langrognet 5 e rencontre DevelopR6 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 1997 29 mai 2012 : InnoSetup 5.5.0 Licence libre (innosetup license) Permet le déploiement de tout logiciel (even for commercial use) F. Langrognet () INNOSETUP Juin 2012 4 / 50
Principales fonctionnalités InnoSetup Créé 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 InnoSetup Permet de créer le fichier iss (script) très facilement. Exemple On 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 assistant logiciel F. Langrognet () INNOSETUP Juin 2012 11 / 50
Assitant logiciel (Wizard) Quelques informations sur le produit... 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 ce programme à la fin de l 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 le dossier de l application Création d un lien vers le site web Création d une entrée pour la désinstallation Sur le Bureau : L utilisateur peut créer un raccourci 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 (innosetup script) 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 la licence F. Langrognet () INNOSETUP Juin 2012 26 / 50
Installation Choix du dossier d installation F. Langrognet () INNOSETUP Juin 2012 27 / 50
Installation Personnalisation des raccourcis Ici : le nom du dossier dans le Menu Démarrer F. Langrognet () INNOSETUP Juin 2012 28 / 50
Installation Choix supplémentaires Ici : création de l icône sur le Bureau F. Langrognet () INNOSETUP Juin 2012 29 / 50
Installation Prêt? F. Langrognet () INNOSETUP Juin 2012 30 / 50
Installation Installation termminée On peut lancer l application F. Langrognet () INNOSETUP Juin 2012 31 / 50
Installation Menu Démarrer Le menu Démarrer contient : Un raccourci vers l application Un raccourci pour la dé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
Sections Principales 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... Définition d une variable : Variables F. Langrognet () INNOSETUP Juin 2012 37 / 50
Programmation La 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 personnalisation Cré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 aux registres F. Langrognet () INNOSETUP Juin 2012 42 / 50
Registres Contenu du registre Entrée Info dans la base de registres F. Langrognet () INNOSETUP Juin 2012 43 / 50
Registres Accès aux registres dans [Code] Appel à la fonction RegQueryStringValue F. Langrognet () INNOSETUP Juin 2012 44 / 50
Registres Installation Affichage de la valeur issue de la base 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
Ressources www.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