[GRASS-dev] Unable to install manual for add-on r.estimap.recreation under Windows

Nikos Alexandris nik at nikosalexandris.net
Fri Jan 18 18:13:38 PST 2019


Stefan Blumentrath:

>Hei Nikos,
>
>Unfortunately, also under Windows people cannot necessarily choose
>where to install an addon, so that it ends up in HOME by default should
>be fine, and it should not be required to install addons in the man
>program directory system wide...
>
>On Win10 with GRASS 7.4.0 from OSGeo4W I can install and run (open the
>GUI) of r.estimap.recreation without issue, though, when I run the
>module from CMD it opens both GUI and the python script in a text
>editor...

I require, and would much appreciate, some further help on these last
standing issue(s).


At times I think of Linux having some complicated ways
to combine file (through make), to copy them around and still keep
programs interacting and working.  In the end there is a bigger picture
and I reach a point of some understanding.

After some installation-Fun under Windows, using OSGeo4W, however, I cannot
understand how I can proceed in integrating an GRASS GIS add-on (here:
r.estimap.recreation) withing QGIS' GRASS Plugin, in an automatic way.


Here my findings after trials:

* There are at least 4 paths where a GRASS GIS add-on can be installed,
including both standard/default and manual ways of installing.

* The .bat files are never removed after an un-installation: how safe is
this?

* I cannot see how a GRASS GIS add-on can be installed in a path visible
to QGIS automatically, without manual intervention, i.e. copying
manually the script and .bat files where QGIS can see them.  Including
esiting the 'default.qgc' to insert an entry for the add-on under the
GRASS Plugin menu.


In detail:


# Paths for GRASS GIS add-ons under Windows

## GRASS GIS

C:\OSGeo4W64\apps\grass\grass-7.4.4

## 'bin' and 'script' directories for GRASS GIS add-ons

1) 'C:\OSGeo4W64\apps\grass\grass-7.4.4\bin'
  and  'C:\OSGeo4W64\apps\grass\grass-7.4.4\scripts'
2) 'C:\OSGeo4W64\apps\qgis-ltr-dev\grass\bin'
  and  'C:\OSGeo4W64\apps\qgis-ltr-dev\grass\scripts'

3) 'C:\Users\nik\AppData\Roaming\GRASS7\addons\bin'
  and  'C:\Users\nik\AppData\Roaming\GRASS7\addons\scripts'
4) 'C:\Users\nik\.grass7\addons\bin'
  and  'C:\Users\nik\.grass7\addons\scripts'


# Installing an add-on

## via GRASS GIS

Using the GUI under 
	'Settings > Addons extensions > Install extensions from addons'
	the command that is executed is:
```
g.extension extension=r.estimap.recreation url=                                 
Downloading precompiled GRASS Addons <r.estimap.recreation>...
Updating addons metadata file...
Installation of <r.estimap.recreation> successfully finished
```

This installs the selected add-on in to
  'C:\Users\nik\AppData\Roaming\GRASS7\addons\bin'
  and  'C:\Users\nik\AppData\Roaming\GRASS7\addons\scripts'.

Using the GUI to uninstall the add-on, removes only the Python script under
  'C:\Users\nik\AppData\Roaming\GRASS7\addons\scripts'.
  The .bat file under 
  'C:\Users\nik\AppData\Roaming\GRASS7\addons\bin\'
  remains untouched.

## via GRASS GIS system-wide

Opting for 'system-wide', executes the command
```
g.extension -s --verbose extension=r.estimap.recreation url=                    
Downloading precompiled GRASS Addons <r.estimap.recreation>...
Downloading source code for <r.estimap.recreation> from <http://wingrass.fsv.cvut.cz/grass74/x86_64/addons/grass-7.4.4/r.estimap.recreation.zip> which is identified as 'remote_zip' type of source...
Updating addons metadata file...
Manual page for <r.estimap.recreation> updated
Installation of <r.estimap.recreation> successfully finished
```
and installs in
  'C:\OSGeo4W64\apps\grass\grass-7.4.4\bin'
  and  'C:\OSGeo4W64\apps\grass\grass-7.4.4\scripts'.

Trying to uninstall the add-on, after a system-wide installation, is not possible!
The add-on is not listed under the
  'Settings > Addons extensions > Manage installed extension'.

Doing the un-installation manually,
```
g.extension -s --verbose extension=r.estimap.recreation op=remove -f            
List of removed files:
C:\OSGEO4~1\apps\grass\grass-7.4.4\scripts\r.estimap.recreation.py
C:\OSGEO4~1\apps\grass\grass-7.4.4\docs\man\man1\man1\r.estimap.recreation.1
C:\OSGEO4~1\apps\grass\grass-7.4.4\docs\html\protected_areas.png
C:\OSGEO4~1\apps\grass\grass-7.4.4\docs\html\spectrum_high_provision_near.png
C:\OSGEO4~1\apps\grass\grass-7.4.4\docs\html\mobility.png
C:\OSGEO4~1\apps\grass\grass-7.4.4\docs\html\potential_corine.png
C:\OSGEO4~1\apps\grass\grass-7.4.4\docs\html\r.estimap.recreation.html
C:\OSGEO4~1\apps\grass\grass-7.4.4\docs\html\area_of_interest.png
C:\OSGEO4~1\apps\grass\grass-7.4.4\docs\html\demand.png
C:\OSGEO4~1\apps\grass\grass-7.4.4\docs\html\bathing_water_quality.png
C:\OSGEO4~1\apps\grass\grass-7.4.4\docs\html\distance_to_infrastructure.png
C:\OSGEO4~1\apps\grass\grass-7.4.4\docs\html\corine_land_cover_2006.png
C:\OSGEO4~1\apps\grass\grass-7.4.4\docs\html\potential_masked.png
C:\OSGEO4~1\apps\grass\grass-7.4.4\docs\html\unmet_demand.png
C:\OSGEO4~1\apps\grass\grass-7.4.4\docs\html\potential_based_on_corine_land_cover_2006.png
C:\OSGEO4~1\apps\grass\grass-7.4.4\docs\html\potential_3.png
C:\OSGEO4~1\apps\grass\grass-7.4.4\docs\html\corine_land_cover_2006_suitability.png
C:\OSGEO4~1\apps\grass\grass-7.4.4\docs\html\potential.png
C:\OSGEO4~1\apps\grass\grass-7.4.4\docs\html\potential_2.png
C:\OSGEO4~1\apps\grass\grass-7.4.4\docs\html\corine_land_cover_legend.png
C:\OSGEO4~1\apps\grass\grass-7.4.4\docs\html\land_suitability.png
C:\OSGEO4~1\apps\grass\grass-7.4.4\docs\html\spectrum.png
C:\OSGEO4~1\apps\grass\grass-7.4.4\docs\html\potential_4.png
C:\OSGEO4~1\apps\grass\grass-7.4.4\docs\html\population_2015.png
C:\OSGEO4~1\apps\grass\grass-7.4.4\docs\html\opportunity.png
C:\OSGEO4~1\apps\grass\grass-7.4.4\docs\html\water_resources.png
C:\OSGEO4~1\apps\grass\grass-7.4.4\docs\html\potential_1.png
C:\OSGEO4~1\apps\grass\grass-7.4.4\docs\html\local_administrative_units.png
Updating addons metadata file...
Extension <r.estimap.recreation> successfully uninstalled.
```

 does not remove but the Python script under
  'C:\OSGeo4W64\apps\grass\grass-7.4.4\scripts'.
  The file
  'C:\OSGeo4W64\apps\grass\grass-7.4.4\bin\r.estimap.recreation.bat'
  remains untouched.


# Installing an add-on via QGIS' GRASS Plugin "GRASS Shell"

## Standard installation

```
C:\OSGeo4W64\bin>g.extension r.estimap.recreation
WARNING: GRASS_ADDON_BASE is not defined, installing to ~/.grass7/addons
Downloading precompiled GRASS Addons <r.estimap.recreation>...
Updating addons metadata file...
Installation of <r.estimap.recreation> successfully finished
WARNING: This add-on module will not function until you set the
         GRASS_ADDON_BASE environment variable (see "g.manual variables")
```

Removing it, though, does not remove the .bat file from
  'C:\Users\nik\.grass7\addons\bin'.

## Using g.extension's '-s' flag

```
C:\OSGeo4W64\bin>g.extension r.estimap.recreation -s
Downloading precompiled GRASS Addons <r.estimap.recreation>...
Updating addons metadata file...
Installation of <r.estimap.recreation> successfully finished
WARNING: This add-on module will not function until you set the
         GRASS_ADDON_BASE environment variable (see "g.manual variables")
```

This installs into
  'C:\OSGeo4W64\apps\grass\grass-7.4.4\bin'
  and  'C:\OSGeo4W64\apps\grass\grass-7.4.4\scripts'.
  
  
The only way I found it works, is when all is copied under 2)
  'C:\OSGeo4W64\apps\qgis-ltr-dev\grass\bin'
  and  'C:\OSGeo4W64\apps\qgis-ltr-dev\grass\scripts'.


More information about the grass-dev mailing list