<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hi Steve,</p>
    <p>qgis --version works as expected (tested in Linux). Can you test
      on Windows, please?</p>
    <p>Regards,</p>
    <p>Jorge Gustavo<br>
    </p>
    <div class="moz-cite-prefix">On 27/03/20 04:29, Steve Malers wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAKqd94T0YOYajoFKbFS2LooZM44CiT7XFpzcVMMqBFnzTCqWuQ@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">QGIS list:
        <div><br>
        </div>
        <div>I have tried to find the answer for this and hope the user
          community can help.  I need a robust and consistent way to
          determine the QGIS version on the command line that I can call
          from a bat file on Windows (and similar on Linux), something
          like:  qgis-bin.exe --version</div>
        <div><br>
        </div>
        <div>
          <div>Background:  I am developing a complex Python tool that
            uses PyQGIS and PyQt and is distributed as a virtual
            environment (venv) created using a specific version of QGIS
            Python, for example QGIS 3.10 python37.  The deployed
            environment requires that QGIS is installed separately  The
            run script modifies its PYTHONPATH to include packages for
            PyQGIS and the application. The venv includes a text file
            that indicates the QGIS version that the venv was built with
            and verifies that a compatible QGIS is installed.  The run
            script properly handles the typical case where stand-alone
            QGIS is installed because it looks at the file path, such as
            C:\Program Files\QGIS 3.10.  If it finds a match, then that
            version of QGIS is used in PYTHONPATH and the application
            starts OK.</div>
          <div><br>
          </div>
          <div>The problem is that if someone has not installed a
            stand-alone QGIS but has installed OSGeo464 version
            (C:\OSGeo4W64), there is no indicator of QGIS version in the
            installation folder.   I cannot find documentation for
            qgis-bin.exe command line options and experiments did not
            show support for --version or variants.  I could scrape the
            QGIS version from files somewhere in the distribution but
            looking into the code it seems to get complicated due to
            handoff from Python to C/C++ code.  If I can determine the
            version I can check to make sure that the OsGeo4W64 QGIS
            version matches that of the distributed venv.  Lacking this,
            the run script cannot do the check.  Supporting OSGeo4W64 is
            needed because some development and deployed environments
            use it.  My plan B is to write a simple Python program to
            access the version from the Python side, making general
            assumptions to get started, and then configure the main
            application startup.</div>
          <div><br>
          </div>
          <div>Any help would be appreciated.<br clear="all">
            <div><br>
            </div>
            -- <br>
            <div dir="ltr" class="gmail_signature"
              data-smartmail="gmail_signature">
              <div dir="ltr">
                <div dir="ltr">
                  <div dir="ltr">
                    <div dir="ltr">
                      <div dir="ltr">
                        <div dir="ltr">
                          <div dir="ltr">
                            <div dir="ltr">
                              <div dir="ltr">
                                <div>
                                  <div>Steve Malers<br>
                                  </div>
                                  <div>Chief Executive Officer and Chief
                                    Technology Officer<br>
                                  </div>
                                  <div>Open Water Foundation<br>
                                  </div>
                                  <div><a
                                      href="http://openwaterfoundation.org"
                                      target="_blank"
                                      moz-do-not-send="true">openwaterfoundation.org</a></div>
                                </div>
                                <div>Support the Open Water Foundation
                                  by selecting on <a
                                    href="https://smile.amazon.com/ch/46-2676240"
                                    target="_blank"
                                    moz-do-not-send="true">smile.amazon.com</a></div>
                                <div><span style="font-size:12.8px">Open
                                    data.  Open software.   Open
                                    decisions.... with positive social
                                    impact.</span></div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Qgis-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a>
List info: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
Unsubscribe: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a></pre>
    </blockquote>
    <div class="moz-signature">-- <br>
      <title>Email Signature</title>
      <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
      <table style="width: 525px; font-size: 11pt; font-family: Arial,
        sans-serif;" cellspacing="0" cellpadding="0">
        <tbody>
          <tr>
            <td style="text-align:center; font-size: 10pt; font-family:
              Arial, sans-serif; border-right: 1px solid;
              border-right-color: #fb6303; width: 125px; padding-right:
              10px; vertical-align: top;" rowspan="6" width="125"
              valign="top"> <a href="https://www.geomaster.pt"
                target="_blank"><img alt="Logo" style="width:105px;
                  height:auto; border:0;"
src="https://geomaster.pt/wp-content/uploads/2017/02/cropped-geomaster300x300-1.png"
                  width="85" border="0"></a> </td>
            <td style="padding-left:10px">
              <table cellspacing="0" cellpadding="0">
                <tbody>
                  <tr>
                    <td style="font-size: 10pt; color:#0079ac;
                      font-family: Arial, sans-serif; width: 400px;
                      padding-bottom: 5px; padding-left: 10px;
                      vertical-align: top;" valign="top"> <strong><span
                          style="font-size: 14pt; font-family: Arial,
                          sans-serif; color:#fb6303;">Geomaster</span></strong><br>
                      <strong><span style="font-size: 11pt; font-family:
                          Arial, sans-serif; color:black;">Jorge Gustavo
                          Rocha</span></strong> <span
                        style="font-family: Arial, sans-serif;
                        font-size:11pt; color:#000000;"><span
                          style="padding-right: 5px; padding-left: 5px;">
                          | </span>Software Engineer</span> </td>
                  </tr>
                  <tr>
                    <td style="font-size: 10pt; color:#444444;
                      font-family: Arial, sans-serif; padding-bottom:
                      5px; padding-top: 5px; padding-left: 10px;
                      vertical-align: top; line-height:17px;"
                      valign="top"> <span><span style="color: #fb6303;"><strong>e:</strong></span><span
                          style="font-size: 10pt; font-family: Arial,
                          sans-serif; color:#000000;"> <a class="moz-txt-link-abbreviated" href="mailto:jgr@geomaster.pt">jgr@geomaster.pt</a></span></span>
                      <span><span style="padding-left:
                          5px;padding-right: 5px;"> | </span><span
                          style="color: #fb6303;"><strong>m:</strong></span><span
                          style="font-size: 10pt; font-family: Arial,
                          sans-serif; color:#000000;"> +351 910 333 888<br>
                        </span></span> <span><span style="color:
                          #fb6303;"><strong>g:</strong></span><span
                          style="font-size: 10pt; font-family: Arial,
                          sans-serif; color:#000000;"> 41.54094,-8.40490</span></span>
                      <span><span style="padding-left:
                          7px;padding-right: 5px;"> | </span><span
                          style="color: #fb6303;"><strong>v: </strong></span><span
                          style="font-size: 10pt; font-family: Arial,
                          sans-serif; color:#000000; padding-left: 7px;">
                          510 906 109<br>
                        </span></span> <span> <span style="color:
                          #fb6303;"><strong>a: </strong></span> </span>
                      <span> <span style="font-size: 10pt; font-family:
                          Arial, sans-serif; color: #000000;"><span> </span>Rua
                          António Cândido Pinto, 67, 4715-400 Braga<br>
                        </span></span> </td>
                  </tr>
                </tbody>
              </table>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
  </body>
</html>