This is a method to build your own qgis configuration packages using osgeo4W.

Overview

This project shows how to create a QGIS customized installation for your organization, using the power of OSGEO4W.

QGIS is highly customizable, and most of the tricks are very well documented in the official documentation.

OSGeo4W is the package manager used by QGIS, GRASS and most OSGeo project to provide binaries for Windows.

QGIS, all the underlying libraries (OGR, GDAL, etc..), GRASS, SAGA, a full python environnement, Qt , etc are available in OSGEO4W.

QGIS can also be installed in its different maintained versions : LTR - Release and dev in a stable way, where the standalone installer will duplicate the whole environnement at each version.

As OSGEO4W is a package manager, it is possible to set dependencies between applications, libraries and command line utilities.

Installing minor upgrades is really light and simple, and thus highly recommended in a corporate environnement

This script currently used former osgeo4W setup that was updated to V2 in june 2021. Porting still needs to be done.

Thanks a lot to all the QGIS contributors, bakers and developpers that allowed to reach to target.

Configuring your QGIS install

A pre-configured QGIS will allow you to

  • simplify and accelerate your QGIS upgrades
  • Let you automate this in your favorite deployment system (OCS Inventory, SCCM, Wapt, etc...)
  • Control users settings, either in a strict way (proxy, authentication and connexion methods) or in a permissive way (default value but users allowed to be free)
  • wire pre-installed ressources like plugins, SVG libraries, layout templates, startup project, etc...
  • etc..

How-to

Build a OSGEO4W customization package

This recipe uses linux shell scripts to create the package. It is possible - though painfull - to adapt it to a Windows environnement. However, WSL2 may help you in building and deploying on the same machine easily.

Directory structure

The directory structure is standard and provided by OSGEO4W

qgis-yourorganizationname/
├── apps
│   ├── qgis-yourorganizationname
│   │   ├── WMTS_scales.xml  -- some default scales (optional)
│   │   ├── layout_checks.py  -- some layout checks (copyright, citations, etc..) (optional)
│   │   ├── qgis-ltr-yourorganizationname.bat.template  -- .bat launcher template. This launcher will override the native qgis launchers after install
│   │   ├── qgis_constrained_settings.py -- a nice utility to constraint some in place user settings
│   │   ├── qgis_constrained_settings.yml -- the config file to decide which settings to constrain
│   │   ├── qgis_global_settings.ini      -- your customized default settings ini file. 
│   │   └── startup_project.qgs            -- a qgis startup project (optional)
│   │   └── qgis-ltr-backup  -- a directory to save the native OSGEO4W shortcut .lnk files that will be removed on install. Uninstall will reinstate them 
│   └── qgis-ltr
│       └── python
│           └── plugins      -- Some plugins you need to deploy on the PC. 
│               ├── SpreadsheetLayers│  
│               ├── coordinator
│               ├── french_locator_filter
│               ├── mask
│               ├── menu_from_project
│               ├── qNote
│               └── redLayer
├── etc
│   ├── postinstall
│   │   └── qgis-yourorganizationname.bat  -- postinstall plugin dealing with shortcuts launchers mainly
│   └── preremove
│       └── qgis-yourorganizationname.bat  -- preremove logic to restore a clean install when uninstalling your package
├── make.sh     -- Build your package tar.bz2 using the version tag in the setup.hint
├── deploy.sh   -- Deploy your built tar.bz2 to a local osgeo4W repository
├── deploy_ressources_somewhere.sh  -- a demo script if you wish to deploy things on a centralized repository (optional)
├── setup.hint   -- package metadat - Change here the package name and the version only

Build and deploy your package

work on your local computer. a linux / shell command line is required to build the package.

  1. play with package content
  2. increment version in setup.hint
  3. Build with ./make.sh
  4. Deploy with ./deploy.sh
  5. (uninstall) / install using either command line or OSGEO4w GUI

Install / Uninstall your package

This parts is run on a Windows OS.

The recommended install process for organizations is to first download OSGEO4W packages and then use them for offline installs. This way, the GIS admin can control precisely which packages are deployed and avoid multiple downloads of ~1Go of binaries for each install.

The command line install is also the prefered way to automate your installs :

You need a powershell or classical Windows console with elevation (ie admin) privileges.

Note that the next OSGEO4W generation will allow non-admin installs.

Full documentation for OSGEO4W CLI here

Below the variable names you need to change depending on your target directories choices

--menu-name "WINDOWS_MENU_NAME  Ex : "OSGEO4W" , "QGIS-LTR-MonOrganisation", "QGIS"
--root "X:\OSGEO4W_DEPLOY_TEST\INSTALL" = target install directory. Ex: "C:\OSGEO4W" , "C:\Program Files\QGIS" 
--local-package-dir "X:\OSGEO4W_DEPLOY_TEST\PAQUETS\http%3a%2f%2fwww.norbit.de%2fosgeo4w%2f"  = directory where you store your osgeo4W binaries for offline install   

Examples of possible commands

-- Install all available packages using caterogy names 

.\osgeo4w-setup.exe  --menu-name "WINDOWS_MENU_NAME" --root "X:\OSGEO4W_DEPLOY_TEST\INSTALL" --advanced  --quiet-mode --local-install --local-package-dir "X:\OSGEO4W_DEPLOY_TEST\PAQUETS\http%3a%2f%2fwww.norbit.de%2fosgeo4w%2f" --autoaccept  --delete-orphans --upgrade-also -C Libs -C Desktop -C Commandline_Utilitiesinstall

-- Uninstall only your qgis-yourorganizationname package, back to a native QGIS

.\osgeo4w-setup.exe  --menu-name "WINDOWS_MENU_NAME" --root "X:\OSGEO4W_DEPLOY_TEST\INSTALL" --quiet-mode --advanced  --local-install --local-package-dir "X:\OSGEO4W_DEPLOY_TEST\PAQUETS\http%3a%2f%2fwww.norbit.de%2fosgeo4w%2f" --autoaccept  --delete-orphans --upgrade-also -x qgis-yourorganizationname

--- Install only your package. Will also install qgis-ltr as it depends on it 

.\osgeo4w-setup.exe  --menu-name "WINDOWS_MENU_NAME" --root "X:\OSGEO4W_DEPLOY_TEST\INSTALL" --advanced  --local-install --local-package-dir "X:\OSGEO4W_DEPLOY_TEST\PAQUETS\http%3a%2f%2fwww.norbit.de%2fosgeo4w%2f" --autoaccept  --delete-orphans --upgrade-also -P qgis-yourorganizationname
 

Choosing between "shared directory" and "installer embedded" approach

You can choose to install most of the resources in the binaries install dir, OR point to a shared network location. You can choose for each ressource what is the best for you. For instance, an organisation with no shared network will embbed everything in the package. If you have shared disks or databases, then you can use it and it is often easier to maintain. BUT, in case of the need for remote / offline work, having all the resources already installed can save your butt :)

Advantages of centralized resources :

  • Easy to maintain (just add files, edit them, done)
  • No need to launch software updates for minor configuration changes

Drawbacks :

  • Network mounts can fails. Windows "letter drive" mounts does not help (tip: use UNC paths).
  • Network latence can slow down a lot QGIS opening because of on-the-fly compilation nature of python plugins.
  • Some shared drives can have metadata or privileges access issues causing issues with plugin's load

Tip: centralize all the resources here in this git repository and deploy them automatically when releasing a new version. This will let you version in one unique place and avoid issues with forgeting to version some network drive files.

What can be centralized on shared location

  • python plugins - using PYTHON_PLUGINPATH variable: can't be unistalled, take precedence over user's version (to be confirmed)
  • SVG symbols - using qsettings searchPathsForSVG
  • fichier global_settings.ini : default parameters
  • startup project , layout and project templates
  • python code (expressions, etc.. )

What can't be centralized currently

  • Style collections and color ramps
Owner
Régis Haubourg
Environment and agronomy engineer, I fell down into GIS passion 15 years ago, and definitely sank into Open Source projects
Régis Haubourg
MatroSka Mod Compiler for ts4scripts

MMC Current Version: 0.2 MatroSka Mod Compiler for .ts4script files Requirements Have Python 3.7 installed and set as default. Running from Source pip

MatroSka 1 Dec 13, 2021
Rock 💎 Paper 📝 Scissors ✂️ Lizard 🦎 Spock 🖖

Rock 💎 Paper 📝 Scissors ✂️ Lizard 🦎 Spock 🖖 If you’ve seen The Big Bang Theory, you’ve heard of a game called “Rock, Paper, Scissors, Lizard, Spoc

AmirHossein Mohammadi 16 Jun 19, 2022
A package selector for building your confy nest

Hornero A package selector for building your comfy nest About Hornero helps you to install your favourite packages on your fresh installed Linux distr

Santiago Soler 1 Nov 22, 2021
Add any Program in any language you like or add a hello world Program ❣️ if you like give us :star:

Welcome to the Hacktoberfest 2018 Hello-world 📋 This Project aims to help you to get started with using Github. You can find a tutorial here What is

Aniket Sharma 1.5k Nov 16, 2022
Python Function to manage users via SCIM

Python Function to manage users via SCIM This script helps you to manage your v2 users. You can add and delete users or groups, add users to groups an

4 Oct 11, 2022
Stack BOF Protection Bypass Techniques

Stack Buffer Overflow - Protection Bypass Techniques

ommadawn46 18 Dec 28, 2022
Excel cell checker with python

excel-cell-checker Description This tool checks a given .xlsx file has the struc

Paul Aumann 1 Jan 04, 2022
Moleey Panel with python 3

Painel-Moleey pkg upgrade && pkg update pkg install python3 pip install pyfiglet pip install colored pip install requests pip install phonenumbers pkg

Moleey. 1 Oct 17, 2021
pyshell is a Linux subprocess module

pyshell A Linux subprocess module, An easier way to interact with the Linux shell pyshell should be cross platform but has only been tested with linux

4 Mar 02, 2022
Minterpy - Multidimensional interpolation in Python.

minterpy is an open-source Python package for a multivariate generalization of the classical Newton and Lagrange interpolation schemes as well as related tasks.

Center for Advanced Systems Understanding 18 Jan 06, 2023
Swubcase - The shitty programming language

What is Swubcase? Swubcase is easy-to-use programming language that can fuck you

5 Jun 19, 2022
samples of neat code

NEAT-samples Some samples of code and config files for use with the NEAT-Python package These samples are largely copy and pasted, so if you

Harrison 50 Sep 28, 2022
The RAP community of practice includes all analysts and data scientists who are interested in adopting the working practices included in reproducible analytical pipelines (RAP) at NHS Digital.

The RAP community of practice includes all analysts and data scientists who are interested in adopting the working practices included in reproducible analytical pipelines (RAP) at NHS Digital.

NHS Digital 50 Dec 22, 2022
Force you (or your user) annotate Python function type hints.

Must-typing Force you (or your user) annotate function type hints. Notice: It's more like a joke, use it carefully. If you call must_typing in your mo

Konge 13 Feb 19, 2022
Простенький ботик для троллинга с интерфейсом #Yakima_Visus

Bot-Trolling-Vk Простенький ботик для троллинга с интерфейсом #Yakima_Visus Установка pip install vk_api pip install requests если там еще чото будет

Yakima Visus 4 Oct 11, 2022
Github Star Tracking app with Streamlit

github-star-tracking-python-app Github Star Tracking app with Streamlit #8daysofstreamlit How to run it locally? Clone or Download & Unzip the Repo En

amrrs 4 Sep 22, 2022
PyScaffold is a project generator for bootstrapping high quality Python packages

PyScaffold is a project generator for bootstrapping high quality Python packages, ready to be shared on PyPI and installable via pip. It is easy to use and encourages the adoption of the best tools a

PyScaffold 1.7k Jan 03, 2023
Schemdule is a tiny tool using script as schema to schedule one day and remind you to do something during a day.

Schemdule is a tiny tool using script as schema to schedule one day and remind you to do something during a day. Platform Python Install Use pip: pip

StardustDL 4 Sep 13, 2021
Objetivo: de forma colaborativa pasar de nodos de Dynamo a Python.

ITTI_Ed01_De-nodos-a-python ITTI. EXPERT TRAINING EN AUTOMATIZACIÓN DE PROCESOS BIM: OFFICIAL DE AUTODESK. Edición 1 Enlace al Master Enunciado: Traba

1 Jun 06, 2022
A 3D Slicer Extension to view data from the flywheel heirarchy

flywheel-connect A 3D Slicer Extension to view, select, and download images from a Flywheel instance to 3D Slicer and storing Slicer outputs back to F

4 Nov 05, 2022