<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Bonjour.</p>
    <p>Je débute dans la création de paquets WAPT, et pour l'instant, ça
      se passe plutôt bien (si ce n'est le douloureux apprentissage de
      Python, je suis plutôt perl moi ^^)</p>
    <p>Je rencontre par contre un problème de détection de la
      uninstallKey avec la fonction install_msi_if_needed.</p>
    <p>Je crée un paquet pour iTunes, dont j'extrais les MSI, et je
      n'installe que les composants qui m'intéressent</p>
    <p>Pour les deux dépendances (Application Support et Mobile Device
      Support), aucun pb, ma fonction install() est triviale, et tout
      fonctionne, eg</p>
    <p><br>
    </p>
    <pre style="box-sizing: inherit; font: 12px/20px Consolas, "Liberation Mono", Menlo, Courier, monospace; background-color: rgb(255, 255, 255); margin: 0px; padding: 0px !important;"><code class="py hljs python" style="box-sizing: inherit; font: 12px/20px Consolas, "Liberation Mono", Menlo, Courier, monospace; background: rgb(255, 255, 255); padding: 0px !important; display: block; overflow-x: auto; color: rgb(51, 51, 51); margin: 0px;"><ol class="linenums" style="box-sizing: inherit; font-size: 12px; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; line-height: 20px; background-color: rgb(255, 255, 255); margin: 0px; padding: 0px !important;"><li class="L6" rel="L6" style="box-sizing: inherit; font-size: 12px; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; line-height: 20px; display: block; width: 1092px;"><span class="hljs-function" style="box-sizing: inherit; font-size: 12px; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; line-height: 20px;"><span class="hljs-keyword" style="box-sizing: inherit; color: rgb(51, 51, 51); font-weight: bold; font-size: 12px; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; line-height: 20px;">def</span> <span class="hljs-title" style="box-sizing: inherit; color: rgb(153, 0, 0); font-weight: bold; font-size: 12px; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; line-height: 20px;">install</span><span class="hljs-params" style="box-sizing: inherit; font-size: 12px; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; line-height: 20px;">()</span>:</span>
</li><li class="L7" rel="L7" style="box-sizing: inherit; font-size: 12px; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; line-height: 20px; display: block; width: 1092px;">    print(<span class="hljs-string" style="box-sizing: inherit; color: rgb(221, 17, 68); font-size: 12px; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; line-height: 20px;">'Installing Apple Mobile Device Support'</span>)
</li><li class="L8" rel="L8" style="box-sizing: inherit; font-size: 12px; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; line-height: 20px; display: block; width: 1092px;">    <span class="hljs-keyword" style="box-sizing: inherit; color: rgb(51, 51, 51); font-weight: bold; font-size: 12px; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; line-height: 20px;">if</span> iswin64():
</li><li class="L9" rel="L9" style="box-sizing: inherit; font-size: 12px; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; line-height: 20px; display: block; width: 1092px;">        install_msi_if_needed(<span class="hljs-string" style="box-sizing: inherit; color: rgb(221, 17, 68); font-size: 12px; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; line-height: 20px;">"AppleMobileDeviceSupport64.msi"</span>)
</li><li class="L10" rel="L10" style="box-sizing: inherit; font-size: 12px; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; line-height: 20px; display: block; width: 1092px;">    <span class="hljs-keyword" style="box-sizing: inherit; color: rgb(51, 51, 51); font-weight: bold; font-size: 12px; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; line-height: 20px;">else</span>:
</li><li class="L11" rel="L11" style="box-sizing: inherit; font-size: 12px; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; line-height: 20px; display: block; width: 1092px;">        install_msi_if_needed(<span class="hljs-string" style="box-sizing: inherit; color: rgb(221, 17, 68); font-size: 12px; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; line-height: 20px;">"AppleMobileDeviceSupport.msi"</span>)
</li></ol></code></pre>
    <p><br>
    </p>
    <p>Mais pour iTunes lui même, ça ne marche pas aussi bien. Le
      problème, c'est que la fonction install_msi_if_needed détecte la
      uninstallKey {A9921EE9-86E5-402C-A934-4A8DBAD99E24} alors que une
      fois installé, iTunes est visible dans le registre sous la clé
      {5881B877-CB42-4317-9411-96BA3CA39715}. L'installation échoue donc
      avec l'erreur</p>
    <p><br>
    </p>
    <p>2018-12-06 11:04:56,388 CRITICAL Fatal error in install script:
      EWaptSetupException: Fatal error : MSI iTunes64.msi has been
      installed but the uninstall key
      {A9921EE9-86E5-402C-A934-4A8DBAD99E24} can not be found:<br>
      Traceback (most recent call last):<br>
        File "C:\Program Files (x86)\wapt\common.py", line 3512, in
      install_wapt<br>
          exitstatus = setup.install()<br>
        File "C:\waptdev\wapt-itunes\setup.py", line 11, in install<br>
          install_msi_if_needed('iTunes64.msi' if iswin64() else
      'iTunes.msi',properties=props)<br>
        File "C:\Program Files (x86)\wapt\common.py", line 3471, in
      new_func<br>
          return func(*args,**kwargs)<br>
        File "C:\Program Files (x86)\wapt\setuphelpers.py", line 3915,
      in install_msi_if_needed<br>
          error('MSI %s has been installed but the uninstall key %s can
      not be found' % (msi,key))<br>
        File "C:\Program Files (x86)\wapt\setuphelpers.py", line 4305,
      in error<br>
          raise EWaptSetupException(u'Fatal error : %s' % reason)<br>
      EWaptSetupException: Fatal error : MSI iTunes64.msi has been
      installed but the uninstall key
      {A9921EE9-86E5-402C-A934-4A8DBAD99E24} can not be found<br>
      <br>
      FATAL ERROR : EWaptSetupException: Fatal error : MSI iTunes64.msi
      has been installed but the uninstall key
      {A9921EE9-86E5-402C-A934-4A8DBAD99E24} can not be found<br>
      Exit code:  3</p>
    <p><br>
    </p>
    <p>Comment gérer ce genre de cas ?</p>
    <p>Jusqu'à présent, j'utilisais WPKG, qui permet de rechercher dans
      le registre une entrée Uninstall à partir de la valeur de
      DisplayName, je pouvais donc rechercher "iTunes" et comparer sa
      version sans me soucier du nom de la clé elle même (qui peut
      changer d'une version à l'autre, je ne sais pas si c'est le cas
      pour iTunes). Est-ce qu'il existe un mécanisme similaire avec WAPT
      ?</p>
    <p><br>
    </p>
    <p>Cordialement,</p>
    <p>Daniel<br>
    </p>
    <p><br>
    </p>
    <div class="moz-signature">-- <br>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <table>
        <tbody>
          <tr>
            <td>
              <p> <img
src="https://www.firewall-services.com/media/image/signature_mail_fws.png"
                  alt="Logo FWS" width="275"> </p>
            </td>
            <td> <font size="2" face="Verdana, Geneva, sans-serif"> <strong>Daniel
                  Berteaud</strong><br>
                <br>
                FIREWALL-SERVICES SAS.<br>
                Société de Services en Logiciels Libres<br>
                Tel : 05 56 64 15 32<br>
                Matrix: @dani:fws.fr<br>
                <em><a class="moz-txt-link-abbreviated" href="http://www.firewall-services.com">www.firewall-services.com</a></em> </font> </td>
          </tr>
        </tbody>
      </table>
    </div>
  </body>
</html>