Skip to content

Commit

Permalink
init mofa4q
Browse files Browse the repository at this point in the history
  • Loading branch information
pfavero-wheregroup committed Mar 19, 2024
0 parents commit 4d3f17b
Show file tree
Hide file tree
Showing 26 changed files with 2,171 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
input/other_programs/*.exe
output_exe/*.exe

input/batch/__pycache__/*.pyc

output_exe/MoFa4Q_*_Install.exe

input/other_programs/*.exe
input/other_programs/*.msi

/.idea

674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

125 changes: 125 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# ALL CURRENT GPKGS FOR PRESENTATION OF FOSSGIS HAMBURG ARE SAVED UNDER:
https://files.wheregroup.com/s/SXEaPTfSTmKHjmT to avoid to save them directly in GIT-repo

# QGIS-Install_MoFa4Q
MoFa4Q-Installer has its own Git-Repo (separate from the MoFa4Q Repo)

MoFa4Q-Installer prepare an executable file, which installs automatically the profile of MoFa4Q on Windows-PC.

PLEASE NOTE: The installer only works on Windows (not Ubuntu, OSMac)!

This is the architecture:
![alt diagram](docs/diagram.png)

The folder output_exe contains an executable file which contains everything necessary to install MoFa4Q.
This final .exe file is created by Inno Script Studio using various files located in the Input folder. The file is quite large because the final exe file contains the QGIS installer itself!

After installation by the user, the following resources are saved on the computer:
- QGIS application under **C:\Program Files\QGIS 3.xx.xx**
- MoFa4A Application, which contains useful resources (icons, batch files, etc.).
It will be stored:
- C:\Users\[USERR_NAME]\AppData\Local\Programs\ if installed for the only current user
- C:\Program Files\ if installed for all users
- The QGIS profile for MoFa4Q under standard location of profiles **"C:\Users\[USERR_NAME]\AppData\Roaming\QGIS\QGIS3\profiles\profiles\MoFa4Q_{#MyAppCompany}"**


## Quick start
Quick start for creating the executable:
1. clone this repo locally (e.g. under C:\devel\mofa4q_public).
The folder is named as [QGIS-Install_MoFa4Q]
2. go to the folder [QGIS-Install_MoFa4Q]\input\profiles\
3. download the repo of the QGIS profile https://github.com/WhereGroup/qgis_mofa4q_profile in this folder
4. Change the name of the repository folder from 'qgis_mofa4q_profile' to 'mofa4q_public'
5. download QGIS of your choose (at time of writing QGIS LTR Version 3.34.4)
and save the installation file under [QGIS-Install_MoFa4Q]\input\other_programs
6. download demo dop data dop.gpkg from https://files.wheregroup.com/s/SXEaPTfSTmKHjmT
and save it under [QGIS-Install_MoFa4Q]\input\profiles\geopackages\dop
7. to create the installation file you need the program Inno Setup (the used version is innosetup-6.2.1).
Please install from here https://jrsoftware.org/isdl.php.
8. start Inno Script Studio
9. go to the [QGIS-Install_MoFa4Q] folder
10. open the file setup_mofa4q.iss in Inno Script Studio
11. **adjust constants** on the file based on your need (see par. "Configuration setup_mofa4q.iss")

- folder of the installer = **DEVELDir** (devel) + **DEVEL_QGISInstallMofa4Q** (mofa4q_public)

Example: C:\devel\mofa4q_public

- QGIS profile name: = **MyAppName** (MoFa4Q) and **MyAppCompany** (public)

Example: C:\devel\mofa4q_public\input\profiles\mofa4q_public

12. click on the button "Compile the current Inno Setup Script" in Inno Script Studio
13. after a while an exe file is created under the folder [QGIS-Install_MoFa4Q]\output_exe
14. distribute the exe file to the PC where you want to install MoFa4Q. Double-click the exe file to install QGIS and MoFa4Q.
15. as an alternative to the exe file, you can use the silent installer (see "Silent installer").
16. To simulate the use of Synctool (see section Synctool), the last two lines of manifest.txt must be enabled:
```
qgisSyncDev=dev
qgisSyncDevServer=C:\geopackages
```
With this configuration, the synctool will look at the local C:\geopackages folder to retrieve new data, instead of looking at a real network server.


### Configuration setup_mofa4q.iss
It is possible to customize MoFa4Q, e.g. to define where MoFa4Q should be installed.
The setup is done in the file setup_mofa4q.iss, the configuration file used to generate the exe file. Attention: be careful when changing the configuration, otherwise the program will not work anymore.

Among the variables the ones worth mentioning are the following:
- **MyAppName** is the name of MoFa4Q application, this constant should be not changed,
because it is used direct in the code (e.g. MoFa4Q.bat)

- **DEVELDir** where this repo of the installer is saved

- **DEVEL_QGISInstallMofa4Q** This is the name of the installer repo folder.

- **QGISVersion** and **QGISFileName**: define the QGIS version. The QGIS's installer must be saved under:

C:\{#DEVELDir}\{#DEVEL_QGISInstallMofa4Q}\input\other_programs\


NB: **DefaultDirName** defines the folder where the program will be installed

https://jrsoftware.org/ishelp/index.php?topic=setup_defaultdirname


Inno Setup creates under C:\devel\mofa4q_public\output_exe the exe file:
MoFa4Q_public_Install.exe

Then, I can install on the computer the App MoFa4Q. Double click MoFa4Q_public_Install.exe

After the installation, we can have a look at what is being installed.

MoFa4Q program itself (not the profile) which contains batch files and icons is saved at following folder, if the installation is done only for the current user:
C:\Users\[USER_NAME]\AppData\Local\Programs\MoFa4Q

Otherwise, if the installation is done for all users, it will be saved here:
C:\Users\MoFa4Q

The profile is under the standard Windows location:
c:\Users\[USER_NAME]\AppData(Roaming)\QGIS\QGIS3\profiles

### License + Protocols (changelog.txt) + manifest
License and changelog.txt are saved in the profile at the main folder.

But they are also copied by the installer in the folder:
C:\Users\[USER_NAME]\AppData\Local\Programs\MoFa4Q

The installer used some its constants of the file setup_mofa4q.iss to generate the **manifest.txt**, which contains informations used by synctool and MoFa4Q

### Synctool
MoFa4Q used all offline data, even for the background map. A Synctool has been developed to refresh and update the data. When the PC is connected to a network it is possible to check if new data is available and download it.


The Synctool is a standalone Python application (file batch/mofa4q_sync.py) which is also installed by the installer.

To simulate the use of Synctool the last two lines of manifest.txt must be enabled:
```
qgisSyncDev=dev
qgisSyncDevServer=C:\geopackages
```
With this configuration, the synctool will look at the local C:\geopackages folder to retrieve new data, instead of looking at a real network server.

### Silent installer
It is also possible to install MoFa4Q in silent mode (no windows are displayed during the installation).
In addition, SILENT_MoFa4Q_Install_logging.cmd logs information about the installation to a temp file.
160 changes: 160 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
# Changelog

All notable changes to this project will be documented in this file.
For each version important additions, changes and removals are listed here.

The format is inspired from [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and the versioning aims to respect [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [v2.1.0] Minor and Feature Release - 2024-01-28

### Added
- add MainWindow Function and change icon or title name
- show warning when closing QGIS. Improve popup dialog
- add icon to main window
- add missed improt

### Changed
- simplify the gpkg_popup.py code
- adjust button dimensions based on resolution
- minor change
- change README.md
- change QGIS projects file
- optimize QGIS3.ini to version 3.34
- change QGIS Version to 3.34.1
- improve comments
- move file to the annotation folder
- change zoom to max extent

### Removed
- remove button function zoom out
- remove comment
- remove unuseful codes

### Fixed
- fix leftPanel bug on initialization
- fix macros indipendent from process of saving QLR file
- fix position buttons when monitor scale > 125%
- fix position buttons when page resized
- fix rotation for annotations in print
- fix and change main titel and icon path fix
- fix title of the main window
- fix bug log private geopackages

## [v2.0.2] Fix and Change - 2023-12-29

### Added
- add _initCheckGeopackagesLayer and change gpkg_popup.py to dynamic strings
- add new deployment
- add close qgis windows event to close btn of openSynchTool def
- add marco to gpkg_popup
- add alphabetically layers of a new private gpkg file

### Changed
- change manifest.txt
- change marco path
- change again height els in layer tree
- minor change
- increase width based on text in layer tree

### Removed
- remove horizontal scrollbar in layer tree
- remove unuseful resources, othe minor changes
- remove red symbol from text annotation
- remove fake geopackage

### Fixed
- fix gpkgPopup
- fix bugs
- fix marco and qgis project: Save automatic layertree to sequence.yml
- fix gpkgPopup.show mit custom text

## [v2.0.0] Minor and Feature Release - 2023-11-08

### Added
- improvement comments of annotations.py

### Changed
- change north-arrow to print templates
- improve print and pdf export
- change splash.png
- change projectfile to qgz basename

### Removed
- remove old qgis ltr version
- remove time info to print templates
- remove unused file
- optimze python code

### Fixed
- fix bug a4_hoch.qpt
- fix backgroundlayer
- fix problem dim frame of text notation
- fix mFeature.attribute id String of search dialog
- fix height of layer page in left panel
- fix extent of luftbilder layer and optimize view

## [v1.3.3] Change and Fix - 2023-10-13

### Added
- add more variable to manifest file

### Fixed
- fix path Server_folder

## [v1.3.2] Change and Fix - 2023-06-22

### Changed
- change and update qgis-ltr to 3.22.16

### Fixed
- fixed run msi installer

## [v1.3.1] Change and Fix - 2023-03-24

### Added

### Changed
- change and update to QGIS 3.28.4

### Removed

### Fixed
- bugfix qgis style

## [v1.3.0] Minor Release - 2022-07-01

### Added

### Changed
- toolbar disable

### Removed

### Fixed
- fix bug if info geopackage is corrupt

## [v1.2.6] Minor Release - 2022-05-31

### Added
- set visibility background image
- improve warning for search
- add empty folder to git

### Changed

### Removed

### Fixed

## [v1.2.5] Minor Release - 2021-11-19

### Added
- Improvement plot

### Changed

### Removed
- remove warning for some gpkgs

### Fixed
1 change: 1 addition & 0 deletions docs/diagram.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<mxfile modified="2019-11-25T16:31:51.165Z" host="www.diagrameditor.com" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/78.0.3904.108 Chrome/78.0.3904.108 Safari/537.36" etag="HtSJcPgLUBWFO3a6JEIL" version="12.1.3" type="device" pages="1"><diagram id="9FZ8eg_lb99T7szyuwr7" name="Page-1">7Vttc5s4EP41nrn70AyvfvkYOy/N3HWujdu5uU8eGWTQVCAqhGP3198KhDGgJr7W4FzsjCdGixDSPrvPLis8sGfR5p6jJPzAfEwHluFvBvbNwLLMoe3Cl5RsC8lwOCkEASe+6lQJ5uQ7VkJDSTPi47TWUTBGBUnqQo/FMfZETYY4Z0/1bitG63dNUIBbgrmHaFv6N/FFqKRmuQx54j0mQahuPbZGxYkIlZ3VStIQ+expT2TfDuwZZ0wUR9FmhqlUXqmX4rq7H5zdTYzjWBxywXAunrY0es8WHx6/OM70MXOdd2qUNaKZWrCarNiWGkBpUih2RTYYxpqGIqLQNOEwwZxEWGAO7ZjFcMUUURLE0PRgWlI+3a3bgIaP0lAOkjdIlCt/umKxUMibViW/IVEAy6FkCf+j1EMYvu8AQMynFMVfr9J1AL3beigXhbnAmz2R0ss9ZjBnvoUu6qyjjFTZqFlC9lQh7ipRuIe1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492tsNcdC5CRksBX8EyGWSBUFVDh6iGP2bi4D14Wm3gBNWQ0zHmq3aSynT6KyD3hoffNEBe5ZB2bk/BxRtRB2GwN1TVS659ZjENV1fu98g6dKriqukjnVb3iDooRKBvt0/zD//UJZb4Cy7Ob25UhXnbEmvVLWAS92nJyyCkc/wFW75jbbbWx+lU+DL3Db0Sipqwf6GZMsROQLH0ZBRkX65DEflwlVUU2X90ASM8lcsoEBMCRywT2RzATEBSPGyzQZ1GrpF+J65cQl4aYUJSn2n3Wi0hnKwmTpDI5uJ9jul84OeFHm5HRWkMQzqyg3tF/mPacn3jMaUI93UPfFfJe3L/Kz40kNCNvVpRBd7SJ8wR+//vHNi79F2fcbajp/+XZ4+ZVFfnZUf2HC7HFvR4tKV1s7KijJPEG9n214sjQsw/9S6iMNGRdeJg7eGrhE/tNH/h/H+HILqeSbssTRR41Fa9i6DPi1Bfj9uP2cd3Zeipk00Bt1GLa1C+1qZ+qheDndWDF+4Zw3zjmOofkdmy6YdsY5/4f9pxc5xz0N5zjVy2S/zDnQrH5SXHSvfpht3/4L</diagram></mxfile>
Binary file added docs/diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions input/batch/mofa4q.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
@REM Diese Datei startet mithilfe Mofa4Q variablen und startet das Mof4Q-Projekt
:::::::::::::: FIXED PARAMETERS ::::::::::::::
@echo off
set installFolder=c:\PROGRA~1\MoFa4Q
set qgisInstallPath=c:\PROGRA~1\QGIS
set FILE=%installFolder%\manifest.txt
for /f "delims=" %%a in (%FILE%) do set %%a
:::::::::::::: Progress ::::::::::::::

:::: Check MoFa4Q-Path exist?
IF exist "%FILE%" (
for /f "delims=" %%a in (%FILE%) do set %%a
goto qgis
) ELSE (
echo "%FILE% nicht gefunden! || If Errorlevel 1 Goto exit
goto exit
)

:qgis
::: call QGIS Programm with parameters
::: Check QGIS_DIRECTORY-Path exist?
IF exist "%qgisInstallPath%\bin\%qgisReleaseVersion%.bat" (
"%qgisInstallPath%\bin\%qgisReleaseVersion%.bat" --skipbadlayers --noversioncheck --profiles-path "%profilePath%" --profile "%profileName%" || If Errorlevel 1 Goto exit
goto mofa4start
) ELSE (
echo "%qgisInstallPath%\bin\%qgisReleaseVersion%.bat" || If Errorlevel 1 Goto exit
goto exit
)

:exit
ECHO [ENDE] Prozess beendet.
if %errorlevel%==1 (
timeout 5 > NUL
pause
exit
)
Loading

0 comments on commit 4d3f17b

Please sign in to comment.