<type>documentation</type>
<domain>intro</domain>
<id>linux-installation-detail</id>
<title>Linux Installation Notes</title>
<date>$Date$</date>
<version>$Revision$</version>
<product>all</product>

On Linux, Wing can be installed from RPM, Debian package, or from tar archive.  Use the latter
if you do not have root access on your machine or wish to install Wing somewhere
other than ``/usr/lib/~~PRODUCT_SPEC_VERSION~~``.  Only 64-bit Linux is supported, although
in Wing Pro `remote development <ref:proj/remote-hosts>`__ can be used to develop on
a 32-bit host.

~~~if WEBSITE:
The instructions here are for Wing Pro.  The package naming for Wing Personal is instead
``wing-personal~~MAJOR_VERSION~~`` and for Wing 101 it is ``wing-101-~~MAJOR_VERSION~~``.
~~~

**Installing Wingware's Public Key**

Some systems will complain when you try to install Wing without first installing our
public key into your key repository.  The key is `available here <https://wingware.com/pgpkey>`__.  
Copy and paste the key into a file ``wingware.pub`` and then use the following to import the key.

For RPM systems::

  sudo rpm --import wingware.pub

For Debian systems::

  sudo apt-key add wingware.pub

An alternative is just to bypass the key check with ``--nogpg`` command line option for ``rpm``,
``--nogpgcheck`` for ``yum``, ``--no-debsig`` for ``dpkg``, and ``--allow-unauthenticated`` for ``apt``.

**Dependencies**

In order to support as many Debian and Redhat derived distributions as
possible with a single package download, the approach to dependency
management in Wing packages is somewhat different than for regular
distribution-specific packages:

1) Wing includes private copies of most of its dependencies (including Qt,
PyQt, OpenSSH, Python, and others) so that it only depends on low-level
OS-provided packages that are more likely to be compatible across systems.

2) Wing packages do not list every dependency by name because some of those
are renamed in derived distributions. In most cases, if you follow the
instructions below, dependencies introduced by packages we do list take care
of installing also the unlisted packages. 

In rare cases, you may need to first manually install what's necessary to run
``Qt`` and ``X11`` applications. Once that is done, Wing should have what it
needs to run.

**Installing from RPM**

Wing can be installed from an RPM package on RPM-based systems, such as RedHat,
CentOS, and Oracle Linux.

For the easiest installation, with automatic package dependency management, run 
``sudo yum localinstall ~~PRODUCT_SPEC_VERSION~~-~~FULL_VERSION~~.0.x86_64.rpm``

You can also install with ``sudo rpm -i
~~PRODUCT_SPEC_VERSION~~-~~FULL_VERSION~~.0.x86_64.rpm`` but this does not
automatically install dependencies and may fail to clearly list what
dependencies are missing.

Or use your favorite RPM administration tool. 

Most files for Wing are placed under the ``/usr/lib/~~PRODUCT_SPEC_VERSION~~`` directory and the
``~~FULL_EXECUTABLE~~`` command is placed in the ``/usr/bin`` directory.

**Installing from Debian package**

Wing can be installed from a Debian package on Debian, Ubuntu, Kali, Mint, and other Debian-based systems. 

For the easiest installation, with automatic package dependency management,
run ``sudo apt install ./~~PRODUCT_SPEC_VERSION~~_~~FULL_VERSION~~.0_amd64.deb``

You can also install with ``sudo dpkg -i ~~PRODUCT_SPEC_VERSION~~_~~FULL_VERSION~~.0_amd64.deb`` 
but this does not automatically install dependencies, requiring you to also run ``sudo apt-get -f install``
to complete the installation.

Most files for Wing are placed under the ``/usr/lib/~~PRODUCT_SPEC_VERSION~~`` directory and the 
``~~FULL_EXECUTABLE~~`` command is placed in the ``/usr/bin`` directory.

**Installing from Tar Archive**

Wing may also be installed from a tar archive. This can be used on systems
that do not use RPM or Debian packages, or if you wish to install Wing into a directory other
than ``/usr/lib/~~PRODUCT_SPEC_VERSION~~``. 

Unpacking this archive with ``tar -zxvf ~~PRODUCT_SPEC~~-~~FULL_VERSION~~.0-linux-x64.tar.gz`` 
will create a ``~~PRODUCT_SPEC~~-~~FULL_VERSION~~.0-linux-x64`` directory that contains the
``wing-install.py`` script.

To install from that::

> cd ~~PRODUCT_SPEC~~-~~FULL_VERSION~~.0-linux-x64
> ./wing-install.py

This will prompt for the location to install Wing, and the location in which to place the executable
``~~FULL_EXECUTABLE~~``. These locations default to ``/usr/local/lib/~~PRODUCT_SPEC~~`` and
``/usr/local/bin``, respectively. The install program must have read/write access to both of these
directories, and all users running Wing must have read access to both.

Note that there is no dependency management in the tar archive installer, so
you may need to manually install what's necessary to run ``Qt`` and ``X11``
applications, before Wing can start up successfully.

**Configuring Wing for High DPI Displays**

Wing's UI is implemented with the Qt toolkit, which includes support for high DPI
displays, but the support varies depending on the desktop environment in use:

On ``KDE``, as of early 2019, Wing should display correctly.

On ``Gnome``, as of early 2019, Wing may suggest an interface scale factor based
on the size of a character on the primary display.

If Wing is not displaying correctly, the user interface may be scaled
manually. To scale icons, windows, and other elements other than
fonts, use the `User Interface > Other > Icon and Window Scale Factor
<script:show_preferences_gui#prefname="main.non-font-scale-factor">`__
preference. To scale the entire UI, including fonts, use
``Presentation Mode`` in the common configuration menu, which is
accessed from the menu icon in the top right of Wing's window.

The ``QT_*`` environment variables described at `https://doc.qt.io/qt-5/highdpi.html
<https://doc.qt.io/qt-5/highdpi.html>`__ may also be used to scale Wing's display.
