On Jan 29, 2008 11:53 PM, Tim Michelsen <[EMAIL PROTECTED]> wrote:
> > 2. try to find QGIS in some default paths (/usr, /usr/local on linux
> > or "${PROGRAM_FILES}/Quantum GIS" on windows etc.) or try to use a
> > previously saved path to QGIS installation from QSettings
> > 3. if no installation has been found, fire up a simple UI in PyQt and
> > let the user select the installation directory.
> I would like to come up with something in the same direction:
> In both apps presented in this thread everything seems to be relying on
> the path that is hardcoded into qgislite.py and mainwindow.py
> repectivly. The variable used is qgis_prefix = "/usr/local/qgis_svn"
> (line 55).
>
> I do not use a svn version of qgis. Instead I use the Ubuntu packages:
>   whereis qgis
> qgis: /usr/bin/qgis /usr/lib/qgis /usr/share/qgis
> Due to some to me unknown reason, the standalone apps and python
> tutorials only work on my Ubuntu box when I set the path as follows:
> qgis_prefix = "/usr"
> I would recommend to use the where command for linux systems to get the
> install folder.
> Some pseudocode:
> test if on linux
>         execute in bash `whereis qgis`
>         whereis_output = read output from that command
>         qgis_prefix = whereis_output
> if on windows
>         use the approach Martin pointed out:
>         (${PROGRAM_FILES}/Quantum GIS"
>         note that some users like to change the default install folder
>         to something like c:\programms\qgis
> else (installation folder can't be found
>         open a gui folder selection dialog and let the user select it.

Maybe I haven't explained it well, but this is what I meant, just
without running whereis utility. Since it just looks to /usr and
/usr/local directories we don't have to run it and look there by
ourselves.


> As a workaround we could use a configuration.py file. There we set the
> paths and the parameters for the app:
>
> cat configuration.py
> qgis_prefix = "/usr"
> startup_project = "./data/mycustomproject.qgs"
>
> So if you deliver the app and your users have problems to start the
> program they'd only need to modify this configuration file and wouldn't
> need to mess up with the rest.

Yes, script with just configuration is a simpler variant of a
bootstrap script. In fact we should be able to support also gui-less
configuration (since qgis libraries can be used also without gui).


> I think what the maximum would be to achieve real stand alone apps: ship
> a directory with these resources in the app.
> |-- LICENSE.TXT
> |-- Makefile
> |-- README.TXT
> |-- core
> |-- data
> |-- qgis_common
> |-- qgislite.py
> `-- tools
> Then every needed file could be put into the common directory
> (qgis_common). And we are totally independant of a QGIS install.

Right, this is suitable for windows. But I would say that e.g. for
linux it's more appropriate to ship standalone apps and let the user
install the libraries with package manager.


> In case of using many stand alone apps one would put the qgis_common
> somewhere else and refernce it with the qgis_prefix variable.
>
> Well, this are just some ideas. They only based on brainstorming and
> didn't undergo testing here ;-) Hope you like them.

Of course thanks for ideas!

Regards
Martin
_______________________________________________
Qgis-user mailing list
Qgis-user@lists.qgis.org
http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-user

Reply via email to