Added wkhtmltopdf install support for Ubuntu 22.04

Real code to select correct wkhtmltopdf version for Ubuntu 22.04 installation. Note that 32-bit version of wkhtmltopdf is not available.
pull/384/head
Ossi Mantylahti 3 years ago
parent cc1406c93e
commit 35efd9eb56

@ -51,12 +51,15 @@ ADMIN_EMAIL="odoo@example.com"
## https://github.com/odoo/odoo/wiki/Wkhtmltopdf ): ## https://github.com/odoo/odoo/wiki/Wkhtmltopdf ):
## https://www.odoo.com/documentation/16.0/administration/install.html ## https://www.odoo.com/documentation/16.0/administration/install.html
WKHTMLTOX_X64="https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.$(lsb_release -c -s)_amd64.deb" # Check if the operating system is Ubuntu 22.04
WKHTMLTOX_X32="https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.$(lsb_release -c -s)_i386.deb" if [[ $(lsb_release -r -s) == "22.04" ]]; then
WKHTMLTOX_X64="https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb"
## For Ubuntu 22.04 uncomment to replace the 64 bit download link above with following: #No 32 bit version available for Ubuntu 22.04
#WKHTMLTOX_X64="https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb" else
#(No 32 bit version release seems to exist) # For older versions of Ubuntu
WKHTMLTOX_X64="https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.$(lsb_release -c -s)_amd64.deb"
WKHTMLTOX_X32="https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.$(lsb_release -c -s)_i386.deb"
fi
#-------------------------------------------------- #--------------------------------------------------
# Update Server # Update Server
@ -116,8 +119,6 @@ if [ $INSTALL_WKHTMLTOPDF = "True" ]; then
fi fi
sudo wget $_url sudo wget $_url
sudo gdebi --n `basename $_url` sudo gdebi --n `basename $_url`
#For Ubuntu 22.04 replace the above line with
#sudo apt install ./wkhtmltox_0.12.6-1.focal_amd64.deb
sudo ln -s /usr/local/bin/wkhtmltopdf /usr/bin sudo ln -s /usr/local/bin/wkhtmltopdf /usr/bin
sudo ln -s /usr/local/bin/wkhtmltoimage /usr/bin sudo ln -s /usr/local/bin/wkhtmltoimage /usr/bin

Loading…
Cancel
Save