Skip to content

[ConfigManager] Make OSGeo4W QGIS installation aware #473

@jonnyforestGIS

Description

@jonnyforestGIS

Hi @NathanW2 ,
ROAM is not OSGeo4W QGIS installation aware. So I search in the code and I found in here this section inside of utils.py of configmanager.

def qgis_path(base_path, name):

for installpath in [qgis_path(os.environ['ProgramFiles'],"qgis-bin.exe"),

I start to do a PR about this and perhaps with a separate def osgeo path, something like this:

def qgis_path(base_path, name):
    return os.path.join(base_path, "QGIS 3.10", "bin", name)

def osgeo_path(base_path, name):
    return os.path.join(base_path, "bin", name)

def find_qgis():
    triedpaths = []
    for installpath in [qgis_path(os.environ['ProgramFiles'],"qgis-bin.exe"),
                        qgis_path(os.environ['ProgramFiles(x86)'], "qgis-bin.exe"),
                        qgis_path(os.environ['ProgramFiles'], "qgis-ltr-bin.exe"),
                        qgis_path(os.environ['ProgramFiles(x86)'], "qgis-ltr-bin.exe"),
                        osgeo_path(os.environ['OSGeo4W64'],"qgis-ltr-bin.exe"),
                        osgeo_path(os.environ['OSGeo4W'],"qgis-ltr-bin.exe"),
                        ]:

Let me know if is more complex than this if not I can submit a PR with these changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions