=== Preparation for Installation ===

Typically, the necessary interface rendering utilities (newt/whiptail) are installed automatically with the package.
If for some reason they are missing from your system, install them manually:
    
    RED OS/ROSA: sudo dnf install -y newt
    Alt: sudo apt-get install -y newt52
    Debian/Astra Linux: sudo apt install -y whiptail

=== Installation ===

If installing an RPM distribution:
    
    sudo ./r7draw_rpm_install.sh

If installing a DEB distribution:
    
    sudo apt-get install -y r7draw-*.amd64.deb
    // or
    sudo apt install -y r7draw-*.amd64.deb

1. At the API URL prompt: enter the full URL of the installed R7-Disk, for example example.com .
2. At the Site domain prompt: enter the domain where R7-Disk is running, for example example.com .
3. At the Use HTTPS? prompt: select Yes to use the HTTPS protocol, or No otherwise.
4. If HTTPS was selected in step 3, enter the full paths to the certificate file (Public Certificate) and the private key (Private Key).
5. Wait for the installation to complete.

=== AI Agent ===

1. Starting from version 26.1.2, R7-Graphics includes an experimental "AI Agent" feature.
2. To enable this feature, you must set two parameters in the configuration file /etc/r7-office/r7draw/settings.env: the URL to "R7-Assistant" and the secret key, respectively:
    
    CHAT_URL=https://ai.r7-assistant.com
    CHAT_KEY=SuperSecretKey

3. Automation in future versions: After the testing phase is complete and the "AI Agent" feature becomes a core part of R7-Graphics,
   the configuration of these parameters will be included in the standard installation process. Manual editing of the configuration file to activate the feature will no longer be required.

=== "Silent" Installation ===

RED OS/ROSA:

    ARCH=$(uname -m) && \
    API_URL="https://disk.example.com" DOMAIN="example.com" MAKE_HTTPS="true" \
    CERTIFICATE="/etc/nginx/ssl/r7draw.crt" \
    CERTIFICATE_KEY="/etc/nginx/ssl/r7draw.key" \
    dnf install -y ./r7draw-*.$ARCH.rpm

Alt:

    ARCH=$(uname -m) && \
    API_URL="https://disk.example.com" DOMAIN="example.com" MAKE_HTTPS="true" \
    CERTIFICATE="/etc/nginx/ssl/r7draw.crt" \
    CERTIFICATE_KEY="/etc/nginx/ssl/r7draw.key" \
    apt-get install -y ./r7draw-*.$ARCH.rpm

Debian/Astra Linux:

    ARCH=$(dpkg --print-architecture) && \
    export API_URL="https://disk.example.com" \
       DOMAIN="example.com" \
       MAKE_HTTPS="true" \
       CERTIFICATE="/etc/nginx/ssl/r7draw.crt" \
       CERTIFICATE_KEY="/etc/nginx/ssl/r7draw.key" \
       DEBIAN_FRONTEND=noninteractive && \
    sudo -E apt-get install -y -o Dpkg::Options::="--force-confold" ./r7draw-*."$ARCH".deb