.. Reminder for header structure:
  Parts (H1)          : #################### with overline
  Chapters (H2)       : ******************** with overline
  Sections (H3)       : ====================
  Subsections (H4)    : --------------------
  Subsubsections (H5) : ^^^^^^^^^^^^^^^^^^^^
  Paragraphs (H6)     : """""""""""""""""""""

.. meta::
 :description: Quickstart - Import and Deploy a WAPT Package
 :keywords: Quickstart, WAPT, Agent, Install

.. _quickstart_manage_package:

#############################################
Quickstart - Import and Deploy a WAPT Package
#############################################

The purpose of this documentation is to guide you through your first experience with the following steps:

- Downloading a package from the WAPT store.
- Add a package dependency to a machine.
- Updating and installing the package on that machine.

*****************************************
Downloading a package from the WAPT store
*****************************************

- Open the WAPT Console.

- Navigate to the :guilabel:`Packages Inventory` tab. (1)

- Click :guilabel:`Import from Internet`. (2)

- Ensure the console is targeting https://wapt.tranquil.it/wapt (The Official WAPT Store). (3)

- Finally, click on :kbd:`OK`. (4)

.. figure:: wapt-resources/wapt-repository_inventory.png
  :scale: 75%
  :align: center
  :alt: Repository Inventory

  Repository Inventory

.. hint::

  This step only needs to be completed once. After that, you can modify this configuration as needed by clicking the :guilabel:`Repository Settings` button.

- In the :kbd:`Search` field, enter the name of the software you want to download. For this example, we will search for "VLC". (1)

- If you want to import only the lastest version available in the WAPT Store, click on :guilabel:`Last version only`. (2)

- Select the correct package you want (architecture, OS, locale, etc.). (3)

- Add this package to your basket. (4)

.. figure:: wapt-resources/wapt-select_package.png
  :scale: 60%
  :align: center
  :alt: Select Package

  Select Package

- Finally, click on :guilabel:`Import basket packages`.

.. figure:: wapt-resources/wapt-import_basket.png
  :scale: 65%
  :align: center
  :alt: Import Basket

  Import Basket

****************************************
Adding a package dependency to a machine
****************************************

- Go to the :guilabel:`Inventory` tab. (1)

- Select the machine where you want to install the package. (2)

- Right-click → :guilabel:`Edit Host`. (3)

.. figure:: wapt-resources/wapt-edit_host.png
  :scale: 75%
  :align: center
  :alt: Edit Host

  Edit Host

***************************************************
Updating and installing the package on that machine
***************************************************

In the :guilabel:`Edit Host` window:

- Select the desired package from the right-side list (e.g., wapt-vlc). (1)

- Click :guilabel:`Add Dependencies to Package` (or drag and drop it to the left-side list). (2)

- The package will appear in the left-side list. (3)

- Click :guilabel:`Save and Apply`. (4)

.. figure:: wapt-resources/wapt-add_dependancy.png
  :scale: 75%
  :align: center
  :alt: Add Dependency

  Add Dependency

.. hint::
  
  :guilabel:`Save and Apply` : Triggers an immediate update and installs the new package dependency (e.g., wapt-vlc) on the machine.

  :guilabel:`Save`: Only updates the package list without installing it. This is **recommended for production environments to avoid disrupting users**. The installation will occur later, during the waptexit process (a summary window showing pending installations before shutdown).

***********************
Verify the Installation
***********************

- Select the machine where you have to install the package. (1)

- Monitor the installation progress in the :guilabel:`Host Tasks` tab for the machine. This tab provides real-time updates on WAPT actions.

- Go to the :guilabel:`host packages` tab. (2)

- Check the :guilabel:`Host Packages` tab to view the package status (OK, Update, or Error). (3)

.. figure:: wapt-resources/wapt-verify_dependancy.png
  :scale: 60%
  :align: center
  :alt: Verify Dependency

  Verify Dependency

**Congratulations!** You've successfully installed your first WAPT package and understood the package dependency system.
