.. Reminder for header structure: Parts (H1) : #################### with overline Chapters (H2) : ******************** with overline Sections (H3) : ==================== Subsections (H4) : -------------------- Subsubsections (H5) : ^^^^^^^^^^^^^^^^^^^^ Paragraphs (H6) : """"""""""""""""""""" .. meta:: :description: Frequent problems and questions :keywords: lost password, lost private key, stolen private key, BIOS bug, waptdeploy, WAPT, documentation, the WAPT Deployment utility .. _wapt_faq_packages: ##################### FAQ - Packages Issues ##################### ************************************************ Updating WAPT packages from Python 2 to Python 3 ************************************************ .. _python2to3: .. attention:: With WAPT 2.0, the WAPT internals have switched to python3. WAPT packages **MUST** follow the new python3 syntax. .. list-table:: The principal syntax differences :header-rows: 1 :widths: 80, 10, 10 * - Syntax - Python 2 - Python 3 * - print - :code:`print'Hello'` - :code:`print('Hello')` * - unicode string - :code:`ur` - :code:`r` * - operators - :code:`<> <=> !=` - :code:`!=` * - Windows registry access - :code:`_winreg` - :code:`winreg` .. hint:: For more details, visit: * https://python-future.org/compatible_idioms.html. * https://blog.couchbase.com/tips-and-tricks-for-upgrading-from-python-2-to-python-3/. ************************************* Problems when creating a WAPT package ************************************* Problems with access rights and PyScripter ========================================== When trying to install a package from :program:`PyScripter`, if the following message appears: .. image:: wapt-resources/windows_pyscripter_read-only-install-package_dialog-box.png :align: center :alt: OperationnalError: attempt to write a read-only database Launch :program:`PyScripter` using a :term:`Local Administrator` account and redo the desired action. .. _package_too_big: The WAPT package is too big and I can not upload it on the repository ===================================================================== When a package is too big, it is necessary to build the WAPT package locally then to upload it with :program:`WinSCP` or an equivalent utility. * Build the WAPT package with :program:`PyScripter` or manually :ref:`build the package `. .. hint:: The WAPT package in :file:`C:\\waptdev`. * Download and install :program:`WinSCP` * Using :program:`WinSCP`, upload the WAPT package in the correct :ref:`repository location ` according to the version of the WAPT repository. * Once the upload has finished, recreate the :file:`Packages` index file on the WAPT repository using the following command and remplacing **repository** by the :ref:`repository location ` according to the version of the WAPT repository. .. code-block:: bash wapt-scanpackages repository Access violation error while re-signing a WAPT package ====================================================== .. image:: wapt-resources/wapt_console_package-resign-error_screen-item.png :align: center :alt: Signature processing has not ended successfully If the **Access violation** error appear, it may mean that the WAPT package is too big. Manually edit the package and visit :ref:`this procedure for signing large WAPT packages `. WAPT package in error ===================== .. _common_problems_installing_a_package: Problem installing a WAPT package --------------------------------- I have a WAPT package that returns in error and the software is not installed on the computer when I physically go to check on the computer. Explanation ^^^^^^^^^^^ An error has occurred during the execution of the :file:`setup.py`. You can read and analyze error messages returned in the WAPT Console and try to understand and solve them. The installation of the package will be retried at each :command:`upgrade` cycle until the package does not return an error. Solution ^^^^^^^^ * If WAPT returns an error code, research the error code on the Internet. Example for a MSI: *1618*: another installation in already running. Restarting the computer should solve the problem. .. note:: MSI error codes are available by visiting `this website `_. * Go to the computer and try to install the package with the WAPT command line utility. Then check that the software has installed. .. attention:: Once the silent installation has finished, do nothing else. The objective is to reproduce the behavior of the WAPT Agent. * If the package installs silently in user context, this may mean that the software installer does not work in *SYSTEM* context. * If it is still not working, launch the installation manually. It is possible for an error to appear explicitly describing the problem (ex: missing dependency, etc). * It is possible that the installer does not support installing over an older version of the software, so you will have to explicitly remove older versions of the application before installing the new one. Error "timed out after seconds with output '600.0'" --------------------------------------------------- Some packages return the following error in the WAPT Console: .. code-block:: bash "Error timed out after seconds with output '600.0'" Explanation ^^^^^^^^^^^ By default, when installing a WAPT package embedding a :command:`run` and a :command:`install_msi_if_needed` command, WAPT will wait 600 seconds for the installer to finish its task. If the installer has not finished in this delay, WAPT will stop the running installation. Solution ^^^^^^^^ If the software to be installed is known to be big (Microsoft Office, Solidworks, LibreOffice, Katia, Adobe Creative Suite), it is possible that the 600 second delay will be too short. You will have to increase the timeout value, ex: :code:`timeout` = ``1200``. .. code-block:: bash run('"setup.exe" /adminfile office2010noreboot.MSP', timeout = 1200) Error "has been installed but the uninstall key can not be found" ----------------------------------------------------------------- Some WAPT packages return the following error in the WAPT Console: .. code-block:: bash XXX has been installed but the uninstall key can not be found. Explanation ^^^^^^^^^^^ WAPT relies on Windows to install :mimetype:`.msi` binaries with :code:`install_msi_if_needed` and :mimetype:`.exe` binaries with :command:`install_exe_if_needed`. By default, WAPT accepts return codes *0* (OK) and *3010* (computer restart required) and it verifies that the *uninstall key* is present. Unfortunately, we can not fully trust these return codes, so WAPT does additional checks after completing the installation to make sure that all has gone well: * It checks the presence of the *uninstall key* on the host. * It checks that the version number of the software is equal or greater than the version number in the :file:`control` file. * If this is not the case, it infers that the software may not be present on the host. The function returns the WAPT package in error. The installation will be retried at every *upgrade* cycle until the WAPT package returns no error. Solution ^^^^^^^^ .. attention:: Before doing anything, it is advisable to go physically to the computer returning in error and to **manually check whether the software has correctly installed**. If the software has not installed correctly, refer to the :ref:`section of this documentation on installing a package `. * If the software has installed correctly, this may mean that the uninstall key or the software version in the package is not correct. * Retrieve the correct *uninstall key* and make changes to the WAPT package accordingly. * If the error happens when using the :code:`install_msi_if_needed` function, this means that the MSI installer is badly packaged and that it is returning an incorrect *uninstall key*. Error "has been installed and the uninstall key found but version is not good" ------------------------------------------------------------------------------ Some WAPT packages return the following error in the WAPT Console: .. code-block:: bash XXX has been installed and the *uninstall key* found but version is not good. Explanation ^^^^^^^^^^^ When using :code:`install_msi_if_needed` or :code:`install_exe_if_needed` functions, additional checks are performed to make sure that all has gone well. .. attention:: Before doing anything, it is advisable to go physically to the computer returning in error and to **manually check whether the software has correctly installed**. If the software has not installed correctly, refer to the :ref:`section of this documentation on installing a package `. Solution: with ``install_msi_if_needed`` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The informations being extracted from the MSI installer, this means that the MSI file does not return correct values or that the *uninstall key* is incorrect. You can check using the Windows Command Line utility. .. code-block:: bash wapt-get list-registry If the returned key is not that which has been entered in the install section of the :file:`setup.py`, it is not possible to use :code:`install_msi_if_needed`. You **MUST** review the install section of your :file:`setup.py`, use the :code:`run()` function and manually manage exceptions. Solution: with ``install_exe_if_needed`` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This probably means that the version number entered in the :program:`install_exe_if_needed` function is not correct. Make corrections to the WAPT package accordingly. .. note:: If the :code:`min_version` argument has not been entered, WAPT will try to retrieve the version automatically from the :mimetype:`.exe` installer. You can check the *uninstall key* and the version number using the command: .. code-block:: bash wapt-get list-registry If no version is provided with the :command:`wapt-get list-registry` command, this means that the software installer does not provide an *uninstall key*. There are **2** solutions: * Use the argument :code:`get_version` to provide the path to another :code:`uninstallkey`. .. code-block:: python def install(): def versnaps2(key): return key['name'].replace('NAPS2 ','') install_exe_if_needed('naps2-5.3.3-setup.exe',silentflags='/VERYSILENT',key='NAPS2 (Not Another PDF Scanner 2)_is1',get_version=versnaps2) * Providing an empty value for :code:`min_version` tells WAPT not to check for versions. .. code-block:: ini min_version=' ' .. attention:: With this method, **versions are no longer checked during updates!** Error "DNSName values should be passed as an A-label string" ------------------------------------------------------------ .. code-block:: bash FATAL ERROR : ValueError: DNSName values should be passed as an A-label string. This means unicode characters should be encoded via a library like idna. Ensure that your workstation name does not contain any special characters.