<html><body><div style="font-family: Andale Mono; font-size: 12pt; color: #000000"><div>Bonjour Hubert,<br></div><div><br data-mce-bogus="1"></div><div>Je mets directement ma librairie dans C:\wapt\lib\sites-packages\ puis je crée un agent wapt<br data-mce-bogus="1"></div><div>Ainsi le module est déployé en même temps que l'agent avec le paquet waptupgrade.<br data-mce-bogus="1"></div><div>Cela a deux avantages :<br data-mce-bogus="1"></div><div>- la sécurité d'avoir le module quoi qu'il arrive. On est plusieurs gestionnaires et un paquet spécifique est le risque de ne pas l'avoir sur tous les postes.<br data-mce-bogus="1"></div><div>- le contrôle de la version grâce au champ min_wapt_version<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div><strong>Ce qui me manque c'est la gestion de la version de l'agent. Je ne sais pas comment incrémenter la version de l'agent pour qu'il prenne en compte le module à jour.</strong><br data-mce-bogus="1"></div><div>Je génère l'agent wapt mais lors du déploiement sur une machine cliente qui a déjà l'agent, waptupgrade n'installe pas l'agent parce qu'il considère que c'est la même version.</div><div><br data-mce-bogus="1"></div><div>Cordialement,<br data-mce-bogus="1"></div><div><br></div><div data-marker="__SIG_PRE__"><div><div style="color: #5e5e5d; font-size: 13px; font-family: arial;"><b><span style="color: #333333;">Frédéric GARESCHÉ</span><br></b></div><div style="color: #5e5e5d; font-size: 13px; font-family: arial;"><span style="color: #808080;"><b>Équipe Assistance et Exploitation<br></b></span></div><div style="color: #5e5e5d; font-size: 13px; font-family: arial;"><span style="color: #808080;"><b>Direction du Système d'Information (D.S.I)</b></span></div><div style="color: #5e5e5d; font-size: 13px; font-family: arial;"><span style="color: #808080;"><b>Correspondant Département EII et laboratoire IETR<br></b>Tél. : +33 (0)2 23 2<strong>3 82 81</strong></span></div><div style="color: #5e5e5d; font-size: 13px; font-family: arial;"><div><span style="color: #808080;">20 avenue des Buttes de Coësmes</span><br><span style="color: #808080;">CS 70839 - 35 708 RENNES Cedex 7</span></div></div><div style="color: #5e5e5d; font-size: 13px; font-family: arial;"><span style="color: #808080;"></span><br></div><a href="https://www.insa-rennes.fr" target="_blank"><img src="http://ressources.insa-rennes.fr/images/logos/logo-INSARennes_mail.jpg" alt="" data-mce-src="http://ressources.insa-rennes.fr/images/logos/logo-INSARennes_mail.jpg"></a><br></div></div><div><br></div><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><b>De: </b>"Hubert TOUVET" <htouvet@tranquil.it><br><b>À: </b>"wapt" <wapt@lists.tranquil.it><br><b>Envoyé: </b>Lundi 1 Juillet 2019 09:59:01<br><b>Objet: </b>Re: [Wapt] Ajouter un module python à wapt<br></div><div><br></div><div data-marker="__QUOTED_TEXT__">Bonjour,<br>
    A priori, la méthode décrite ci-dessous n'a pas de raison de ne plus
    fonctionner dans les versions de wapt post 1.3<br>
    Il faut créer un paquet qui initialement copie le module dans le
    VirtualEnv  de wapt.<br>
    Ensuite, il doit être disponible comme décrit ci-dessous.<br>
    La principale différence de ce point de vue entre 1.3 et 1.6/1.7 est
    le fait que Wapt a une installation python en propre qui est
    construit par VirtualEnv au lieu de procédure custom.<br>
    Lors des mises à jour de l'agent Wapt, normalement, Innosetup ne
    touche pas aux fichiers qu'il n'a pas installés lui-même.<br>
    Donc le module additionnel devrait persister... à vérifier.<br>
    <br>
    Quelles difficultés rencontrez-vous ?<br>
    <br>
    Hubert<br>
    <br>
    <div class="moz-cite-prefix">Le 01/07/2019 à 09:26, Frederic
      Garesche a écrit :<br>
    </div>
    <blockquote cite="mid:1820443044.403668.1561966019407.JavaMail.zimbra@insa-rennes.fr">
      
      <div style="font-family: Andale Mono; font-size: 12pt; color:
        #000000">
        <div>
          <div>
            <div style="font-family: andale mono; font-size: 12pt;
              color: rgb(0, 0, 0);">
              <div>Bonjour Joël,<br>
              </div>
              <br>
              <div>J'utilise un module intégré dans l'agent wapt.<br>
              </div>
              <div>Je l'ai mis dans
                C:\wapt\lib\sites-packages\malibpython.py<br>
              </div>
              <div>Le module contient des fonctions que j'ai créées pour
                simplifier la création des paquets.</div>
              <div>Dans le setup.py, il suffit d'ajouter la ligne : from
                libinsa import *<br>
              </div>
              <div>Cela fonctionne dans toutes les fonctions de base de
                wapt : install(), uninstall(), sessionsetup(), ... <br>
              </div>
              <div><br>
              </div>
              <div>L'équipe wapt m'avait fourni une solution pour mettre
                à jour mon module.
                 Mais cela ne fonctionne plus depuis
                la migration d'après wapt
                1.3.13.</div>
              <div>Et hélas, l'équipe Wapt ne m'a pas donner de nouvelle
                solution.</div>
              <div>Je voulais aussi savoir si ma méthode d'inclusion de
                module était la plus adapté par rapport au
                fonctionnement de wapt mais là non plus je n'ai pas eu
                de réponse.<br>
              </div>
              <div>
                 <br>
              </div>
              <div>La seule solution que j'ai actuellement est de mettre
                à jour mon module lors d'une mise à jour de wapt.<br>
              </div>
              <div><br>
              </div>
            </div>
            <div style="font-family: andale mono; font-size: 12pt;
              color: rgb(0, 0, 0);">Voici pour exemples, trois des mes
              fonctions :</div>
            <div style="font-family: andale mono; font-size: 12pt;
              color: rgb(0, 0, 0);"><br>
            </div>
            <div style="font-family: andale mono; font-size: 12pt;
              color: rgb(0, 0, 0);"><span style="font-size: 8pt;">def
                add_trustedpublisher_certificates(certificates):</span><br>
              <span style="font-size: 8pt;">    r"""Add trustedpublisher certificates</span><br>
              <br>
              <span style="font-size: 8pt;">    Args:</span><br>
              <span style="font-size: 8pt;">        certificates (list) : list of
                trustedpublisher certificate files to add</span><br>
              <br>
              <span style="font-size: 8pt;">    Returns:</span><br>
              <span style="font-size: 8pt;">        None</span><br>
              <br>
              <span style="font-size: 8pt;">    >>>
add_trustedpublisher_certificates(['SymantecTimeStampingServicesCAG2.cer','SymantecTimeStampingServicesSignerG4.cer'])</span><br>
              <span style="font-size: 8pt;">    """</span><br>
              <span style="font-size: 8pt;">    if not isinstance(certificates,list):</span><br>
              <span style="font-size: 8pt;">        certificates = [certificates]</span><br>
              <br>
              <span style="font-size: 8pt;">    for cert in certificates:</span><br>
              <span style="font-size: 8pt;">        if isfile(cert):</span><br>
              <span style="font-size: 8pt;">            print('Adding TrustedPublisher
                certificate : %s' %(cert))</span><br>
              <span style="font-size: 8pt;">            run(r'certutil.exe -f -addstore
                "TrustedPublisher" "%s"' %(cert))</span><br>
              <span style="font-size: 8pt;">        else:</span><br>
              <span style="font-size: 8pt;">            print(r'Warning : trustedpublisher
                certificate file %s not found' %(cert))</span><br>
              <br>
              <span style="font-size: 8pt;">def add_drivers(drivers,drivers_path_root):</span><br>
              <span style="font-size: 8pt;">    r"""Add drivers</span><br>
              <br>
              <span style="font-size: 8pt;">    Args:</span><br>
              <span style="font-size: 8pt;">        drivers (list) : list of driver files with
                their relative path</span><br>
              <span style="font-size: 8pt;">        drivers_path_root (str) : root path where
                to find the drivers</span><br>
              <br>
              <span style="font-size: 8pt;">    Returns:</span><br>
              <span style="font-size: 8pt;">        None</span><br>
              <br>
              <span style="font-size: 8pt;">    >>>
add_drivers(['usb-blaster\\usbblstr.inf','usb-blaster-ii\\usbblasterii.inf'],'C:\\Altera\\17.1\\quartus\\drivers')</span><br>
              <span style="font-size: 8pt;">    """</span><br>
              <span style="font-size: 8pt;">    if not isinstance(drivers,list):</span><br>
              <span style="font-size: 8pt;">        drivers = [drivers]</span><br>
              <br>
              <span style="font-size: 8pt;">    if isdir(drivers_path_root):</span><br>
              <span style="font-size: 8pt;">        for driver in drivers:</span><br>
              <span style="font-size: 8pt;">            print('installing %s' %(driver))</span><br>
              <span style="font-size: 8pt;">            with
                disable_file_system_redirection():</span><br>
              <span style="font-size: 8pt;">               
                run_notfatal(r'C:\Windows\System32\pnputil.exe -i -a
                "%s\%s"' %(drivers_path_root,driver))</span><br>
              <span style="font-size: 8pt;">    else:</span><br>
              <span style="font-size: 8pt;">        print(r'Warning : drivers path root %s not
                found' %(drivers_path_root))</span><br>
              <br>
              <span style="font-size: 8pt;">def
                add_firewall_rule(name_rule,path,profil='domain,private'):</span><br>
              <span style="font-size: 8pt;">    r"""Add firewall rule</span><br>
              <br>
              <span style="font-size: 8pt;">    Args:</span><br>
              <span style="font-size: 8pt;">        name_rule (str) : Name of the rule</span><br>
              <span style="font-size: 8pt;">        path (str) : Absolute path to the file to
                allow</span><br>
              <span style="font-size: 8pt;">        profil (str): Add the rule for domain |
                private | public</span><br>
              <br>
              <span style="font-size: 8pt;">    Returns:</span><br>
              <span style="font-size: 8pt;">        None</span><br>
              <br>
              <span style="font-size: 8pt;">    >>> add_firewall_rule('Packet Tracer
                Executable',r'C:\Program Files\Cisco Packet Tracer
                7.1\bin\PacketTracer7.exe')</span><br>
              <span style="font-size: 8pt;">    """</span><br>
              <span style="font-size: 8pt;">    try:</span><br>
              <span style="font-size: 8pt;">        run(r'netsh advfirewall firewall show rule
                name="%s"' %name_rule)</span><br>
              <span style="font-size: 8pt;">    except:</span><br>
              <span style="font-size: 8pt;">        print('Firewall : adding rule "%s" in %s'
                %(name_rule,profil))</span><br>
              <span style="font-size: 8pt;">        if isfile(path):</span><br>
              <span style="font-size: 8pt;">            run_notfatal(r'netsh advfirewall
                firewall add rule name="%s" dir=in action=allow
                program="%s" enable=yes profile=%s'
                %(name_rule,path,profil))</span><br>
            </div>
            <div style="font-family: andale mono; font-size: 12pt;
              color: rgb(0, 0, 0);"><br>
            </div>
            <div style="font-family: andale mono; font-size: 12pt;
              color: rgb(0, 0, 0);"><br>
              <div>
                <div>
                  <div style="color: rgb(94, 94, 93); font-size: 13px;
                    font-family: arial;"><b><span style="color: rgb(51,
                        51, 51);">Frédéric GARESCHÉ</span><br>
                    </b></div>
                  <div style="color: rgb(94, 94, 93); font-size: 13px;
                    font-family: arial;"><span style="color: rgb(128,
                      128, 128);"><b>Équipe Assistance et Exploitation<br>
                      </b></span></div>
                  <div style="color: rgb(94, 94, 93); font-size: 13px;
                    font-family: arial;"><span style="color: rgb(128,
                      128, 128);"><b>Direction du Système d'Information
                        (D.S.I)</b></span></div>
                  <div style="color: rgb(94, 94, 93); font-size: 13px;
                    font-family: arial;"><span style="color: rgb(128,
                      128, 128);"><b>Correspondant Département EII et
                        laboratoire IETR<br>
                      </b>Tél. : +33 (0)2 23 2<strong>3 82 81</strong></span></div>
                  <div style="color: rgb(94, 94, 93); font-size: 13px;
                    font-family: arial;">
                    <div><span style="color: rgb(128, 128, 128);">20
                        avenue des Buttes de Coësmes</span><br>
                      <span style="color: rgb(128, 128, 128);">CS 70839
                        - 35 708 RENNES Cedex 7</span></div>
                  </div>
                  <div style="color: rgb(94, 94, 93); font-size: 13px;
                    font-family: arial;"><span style="color: rgb(128,
                      128, 128);"></span><br>
                  </div>
                  <a href="https://www.insa-rennes.fr" target="_blank"><img alt="" data-mce-src="http://ressources.insa-rennes.fr/images/logos/logo-INSARennes_mail.jpg" style="" src="http://ressources.insa-rennes.fr/images/logos/logo-INSARennes_mail.jpg"></a><br>
                </div>
              </div>
              <br>
              <hr id="zwchr">
              <div><b>De: </b>"Latieule Joel"
                <a class="moz-txt-link-rfc2396E" href="mailto:joel.latieule@ac-montpellier.fr" target="_blank"><joel.latieule@ac-montpellier.fr></a><br>
                <b>À: </b>"wapt" <a class="moz-txt-link-rfc2396E" href="mailto:wapt@lists.tranquil.it" target="_blank"><wapt@lists.tranquil.it></a><br>
                <b>Envoyé: </b>Lundi 1 Juillet 2019 08:14:42<br>
                <b>Objet: </b>Re: [Wapt] Ajouter un module python à
                wapt<br>
              </div>
              <br>
              <div>
                <p>Bonjour Frederic,</p>
                <p><br>
                </p>
                <p>Sans pouvoir t'aider et dans l'objectif d'acquérir de
                  nouvels exemples d'usage avec WAPT, pourrait tu
                  m'indiquer comment tu souhaite utiliser les modules
                  ajouter à l'agent ?</p>
                <p>Je suis également dans un étab scolaire (bien plus
                  petit que le tient). Je suis intéressé pour faire
                  évoluer mon installation.<br>
                </p>
                <pre class="moz-signature">Joël LATIEULE - 06.38.02.33.27 / TICE

Collège Victor Hugo - 0110021n
5 boulevard Marcel Sembat, 11100 Narbonne
04.68.90.24.00</pre>
                <div class="moz-cite-prefix">Le 27/06/2019 à 13:37,
                  Frederic Garesche a écrit :<br>
                </div>
                <blockquote cite="mid:1375882737.183352.1561635458274.JavaMail.zimbra@insa-rennes.fr">
                  <div style="font-family: andale mono; font-size: 12pt;
                    color: rgb(0, 0, 0);">
                    <div>
                      <div>Bonjour,<br>
                      </div>
                      <div><br>
                      </div>
                      <div>J'utilise un module pour regrouper quelques
                        fonctions qui sont souvent utilisées dans nos
                        paquets.<br>
                      </div>
                      <div>On a, par exemple, une fonction pour modifier
                        plus facilement la base de registre, une autre
                        pour modifier les profils déjà présents sur la
                        machine et surtout modifier notre profil
                        obligatoire sur notre parc d'enseignement.<br>
                      </div>
                      <div>Nos fonctions ne sont certes pas super bien
                        écrites ni optimales mais restent
                        fonctionnelles. <br>
                      </div>
                      <div>Le module est utilisé aussi bien pour la
                        fonction install() que pour la fonction
                        uninstall().</div>
                      <div><br>
                      </div>
                      <div><strong>Quelle méthode préconisez-vous pour
                          ajouter son propre module python à l'agent
                          Wapt 1.7.4 ?</strong></div>
                      <div><br>
                      </div>
                      <div>En attendant une réponse de votre part, je
                        vous souhaite une bonne journée,<br>
                      </div>
                      <div><br>
                      </div>
                      <div><br>
                      </div>
                      <div><em>PS : J'avais déjà posé la question mais
                          je n'avais pas eu de réponse.</em></div>
                      <div><br>
                      </div>
                    </div>
                    <div><br>
                    </div>
                    <div>
                      <div>
                        <div style="color: rgb(94, 94, 93); font-size:
                          13px; font-family: arial;"><b><span style="color: rgb(51, 51, 51);">Frédéric
                              GARESCHÉ</span><br>
                          </b></div>
                        <div style="color: rgb(94, 94, 93); font-size:
                          13px; font-family: arial;"><span style="color:
                            rgb(128, 128, 128);"><b>Équipe Assistance et
                              Exploitation<br>
                            </b></span></div>
                        <div style="color: rgb(94, 94, 93); font-size:
                          13px; font-family: arial;"><span style="color:
                            rgb(128, 128, 128);"><b>Direction du Système
                              d'Information (D.S.I)</b></span></div>
                        <div style="color: rgb(94, 94, 93); font-size:
                          13px; font-family: arial;"><span style="color:
                            rgb(128, 128, 128);"><b>Correspondant
                              Département EII et laboratoire IETR<br>
                            </b>Tél. : +33 (0)2 23 2<strong>3 82 81</strong></span></div>
                        <div style="color: rgb(94, 94, 93); font-size:
                          13px; font-family: arial;">
                          <div><span style="color: rgb(128, 128, 128);">20
                              avenue des Buttes de Coësmes</span><br>
                            <span style="color: rgb(128, 128, 128);">CS
                              70839 - 35 708 RENNES Cedex 7</span></div>
                        </div>
                        <div style="color: rgb(94, 94, 93); font-size:
                          13px; font-family: arial;"><span style="color:
                            rgb(128, 128, 128);"></span><br>
                        </div>
                        <a href="https://www.insa-rennes.fr" target="_blank"><img alt="" data-mce-src="http://ressources.insa-rennes.fr/images/logos/logo-INSARennes_mail.jpg" style="" src="http://ressources.insa-rennes.fr/images/logos/logo-INSARennes_mail.jpg"></a><br>
                      </div>
                    </div>
                  </div>
                  <br>
                  <fieldset class="mimeAttachmentHeader"></fieldset>
                  <pre class="moz-quote-pre">_______________________________________________
WAPT mailing list
<a class="moz-txt-link-abbreviated" href="mailto:WAPT@lists.tranquil.it" target="_blank">WAPT@lists.tranquil.it</a>
<a class="moz-txt-link-freetext" href="http://lists.tranquil.it/listinfo/wapt" target="_blank">http://lists.tranquil.it/listinfo/wapt</a>
</pre>
                </blockquote>
                <br>
                _______________________________________________<br>
                WAPT mailing list<br>
                <a class="moz-txt-link-abbreviated" href="mailto:WAPT@lists.tranquil.it" target="_blank">WAPT@lists.tranquil.it</a><br>
                <a class="moz-txt-link-freetext" href="http://lists.tranquil.it/listinfo/wapt" target="_blank">http://lists.tranquil.it/listinfo/wapt</a><br data-mce-bogus="1"></div>
            </div>
          </div>
          <br>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre">_______________________________________________
WAPT mailing list
<a class="moz-txt-link-abbreviated" href="mailto:WAPT@lists.tranquil.it" target="_blank">WAPT@lists.tranquil.it</a>
<a class="moz-txt-link-freetext" href="http://lists.tranquil.it/listinfo/wapt" target="_blank">http://lists.tranquil.it/listinfo/wapt</a>
</pre>
    </blockquote>
    <br>
  

<br>_______________________________________________<br>WAPT mailing list<br>WAPT@lists.tranquil.it<br>http://lists.tranquil.it/listinfo/wapt<br></div></div></body></html>