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
You might also like...
Run-Your-Own Firefox Sync Server

Run-Your-Own Firefox Sync Server This is an all-in-one package for running a self-hosted Firefox Sync server. It bundles the "tokenserver" project for

Provides guideline on how to configure pre-commit hooks in your own python project
Provides guideline on how to configure pre-commit hooks in your own python project

Pre-commit Configuration Guide The main aim of this repository is to act as a guide on how to configure the pre-commit hooks in your existing python p

Simple AoC helper program you can use to develop your own solutions in python.

AoC-Compabion Simple AoC helper program you can use to develop your own solutions in python. Simply install it in your python environment using pip fr

Myrepo - A tool to create your own Arch Linux repository

myrepo A (experimental) tool to create your own Arch Linux repository Example We

Procedurally generated Oblique Strategies for writing your own Oblique Strategies

Procedurally generated Oblique Strategies for writing your own Oblique Strategies.

Python Create Your Own Tool Series

Python Create Your Own Tool Series Hey there! This is an additional Github repository that contains the final product files for each video in my Youtu

The refactoring tutorial I wrote for PyConDE 2022. You can also work through the exercises on your own.
The refactoring tutorial I wrote for PyConDE 2022. You can also work through the exercises on your own.

Refactoring 101 planet images by Justin Nichol on opengameart.org CC-BY 3.0 Goal of this Tutorial In this tutorial, you will refactor a space travel t

Packages of Example Data for The Effect

causaldata This repository will contain R, Stata, and Python packages, all called causaldata, which contain data sets that can be used to implement th

An AI-powered device to stop people from stealing my packages.

Package Theft Prevention Device An AI-powered device to stop people from stealing my packages. Installation To install on a raspberry pi, clone the re

Comments
  • Update for OSGeo4W V2

    Update for OSGeo4W V2

    Here is a first step to update this custom package for OSGeo4W V2. Fixes #2

    Few things need testing:

    • [ ] Installation (I tested it and everything seems fine but I would like to have your confirmation)
    • [ ] Removal (I tested a full removal but did not try to remove custom package only)
    • [ ] Update (If you have a one line update command, please share it)

    Main changes are in postinstall and preremove scripts.

    opened by nicogodet 2
  • OsGeo4W V2 update

    OsGeo4W V2 update

    I started working on the update of your awesome work.

    Few typos and some changes in postinstall and preremove script (avoid the use of nircmd). Still WIP but I will isolate the main change and propose a PR, I hope we can both work on this.

    enhancement 
    opened by nicogodet 2
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
Build your own Etherscan with web3.py

Build your own Etherscan with web3.py Video Tutorial: Run it pip3 install -r requirements.txt export FLASK_APP=app export FLASK_ENV=development flask

null 35 Jan 2, 2023
python package to showcase, test and build your own version of Pickhardt Payments

Pickhardt Payments Package The pickhardtpayments package is a collection of classes and interfaces that help you to test and implement your dialect of

Rene Pickhardt 37 Dec 18, 2022
A QGIS integration plugin for Kart repositories

QGIS Kart Plugin A plugin to work with Kart repositories Installation The Kart plugin is available in the QGIS Plugins server. To install the latest v

Koordinates 27 Jan 4, 2023
Standalone PyQGIS application for executing custom scripts without a QGIS GUI.

PyQGIS Standalone Script Executer Standalone PyQGIS application that is able to run a custom script, in this case Proximity.py without the need of a G

null 6 Sep 23, 2022
ICEtool - ICEtool plugin for QGIS

ICEtool ICEtool is an all in one QGIS plugin to easily compute ground temperatur

Arthur Evrard 13 Dec 16, 2022
🗽 Like yarn outdated/upgrade, but for pip. Upgrade all your pip packages and automate your Python Dependency Management.

pipupgrade The missing command for pip Table of Contents Features Quick Start Usage Basic Usage Docker Environment Variables FAQ License Features Upda

Achilles Rasquinha 529 Dec 31, 2022
Run CodeServer on Google Colab using Inlets in less than 60 secs using your own domain.

Inlets Colab Run CodeServer on Colab using Inlets in less than 60 secs using your own domain. Features Optimized for Inlets/InletsPro Use your own Cus

null 2 Dec 30, 2021
Its a simple and fun to use application. You can make your own quizes and send the lik of the quiz to your friends.

Quiz Application Its a simple and fun to use application. You can make your own quizes and send the lik of the quiz to your friends. When they would a

Atharva Parkhe 1 Feb 23, 2022
Automatically give thanks to Pypi packages you use in your project!

Automatically give thanks to Pypi packages you use in your project!

Ward 25 Dec 20, 2021
The earliest beta version of pytgcalls on Linux x86_64 and ARM64! Use in production at your own risk!

Public beta test. Use in production at your own risk! tgcalls - a python binding for tgcalls (c++ lib by Telegram); pytgcalls - library connecting pyt

Il'ya 21 Jan 13, 2022