Closed ghtmtt closed 10 years ago
start "QGIS" /B "%OSGEO4W_ROOT%"\bin\qgis-bin.exe %* --configpath %USERPROFILE%.qgis-custom --project %OSGEO4W_ROOT%\project.qgs
adds what should be included when QGIS starts: in this specific case --configpath
(that redirects to .qgis-custom
) and --project
that allows to start QGIS with a project.
WORKING !!! Solved the final problem. This is the final qgis.bat\ file (and so this has to be included in the qgis.bat.tmpl):
call "%~dp0\o4w_env.bat" @echo off call "%OSGEO4W_ROOT%"\apps\grass\grass-6.4.3\etc\env.bat @echo off path %OSGEO4W_ROOT%\apps\qgis\bin;%OSGEO4W_ROOT%\apps\grass\grass-6.4.3\lib;%PATH% set QGIS_PREFIX_PATH=%OSGEO4W_ROOT:\=/%/apps/qgis set GDAL_FILENAME_IS_UTF8=YES rem Set VSI cache to be used as buffer, see #6448 set VSI_CACHE=TRUE set VSI_CACHE_SIZE=1000000
if not exist %USERPROFILE%.qgis-custom ( mkdir %USERPROFILE%.qgis-custom xcopy %OSGEO4W_ROOT%\qgisconfig %USERPROFILE%.qgis-custom /s /v /e )
start "QGIS" /B "%OSGEO4W_ROOT%"\bin\qgis-bin.exe %* --configpath %USERPROFILE%.qgis-custom
@pcav when you have time, could you please try to create the package?
p.s. I added the qgis.bat.tmpl file in https://github.com/faunalia/HealthQGIS/tree/master/packaging
if not exist %USERPROFILE%.qgis-custom ( mkdir %USERPROFILE%.qgis-custom xcopy %OSGEO4W_ROOT%\qgisconfig %USERPROFILE%.qgis-custom /s /v /e )
this option in the script should create the folder .qgis-custom
if it doesn't exist, but, if it already exists, additional edits and customizations will be written and included.
@pcav do you think this is a good idea? I think so. Users should be able to make small changes to the GUI even if we provide them a clean environment to work.
Not sure if including data+project in the package is a good idea. If we have lots of data the package will suffer for it. Maybe it is better to include them and the project file in another folder and send them separately.
I'll try if the project opens with our QGIS or not.
IMO it is useful to be able to do it. Then we can decide when to include the data, and when not.
OK, so I'll include all the sample data we have now and the project file in the package. Disable it and/or removing the data is just a matter of 2 seconds.
It seems that there are some problems (package won't be created) if some file is too large. I think is due to some file I put in data (so actually the problem seems related to some layer, maybe raster). The output of creatensis is:
Internal compiler error #12345: error mmapping file (1706328133, 33554432) is out of range.
Note: you may have one or two (large) stale temporary file(s) left in your temporary directory (Generally this only happens on Windows 9x). running nsis failed [makensis -V1 -DVERSION_NAME='Master' -DVERSION_NUMBER='2.2.1' -DBINARY_REVISION=1 -DVERSION_INT='2030001' -DQGIS_BASE='QGIS Master' -DINSTALLER_NAME='QGIS-OSGeo4W-2.2.1-1-Setup-x86.exe' -DDISPLAYED_NAME='QGIS 'Master' (2.2.1)' -DSHORTNAME='qgis' -DINSTALLER_TYPE=OSGeo4W -DPACKAGE_FOLDER=osgeo4w/unpacked-x86 -DLICENSE_FILE='osgeo4w/unpacked-x86/apps/qgis/doc/LICENSE' -DARCH='x86' QGIS-Installer.nsi] at creatensis.pl line 431.
This are all the steps for the creation of the packaging:
git clone https://github.com/qgis/QGIS.git
)./ms-windows/osgeo4w
creatensis --help
for all the options). Usually I usetime perl creatensis.pl -verbose -version=2.2.0 -arch=x86 -releasename=QGIS
. Take into account to use the-keep
option: this avoids to re-compress every single package, but I never tried it../osgeo4w/addons
). All the additions have to be put in this directory 4.2. insideaddons
create thebin
directory and put inside theqgis.bat.tmpl
file. This file will be converted inqgis.bat
, so the file that starts QGIS on windows. You can findqgis.bat.tmpl
inosgeo4w
4.3. you have to edit this file with the option you want (example, start QGIS with the --configpath option). The next comment contains theqgis.bat.tmpl
file 4.4. inaddons
I also included theqgisconfig
directory that is the directory created by QGIS when it stars with the--configpath
option. (I just start QGIS and typed in the terminalqgis --configpath ~/ms-windows/osgeo4w/addons/qgisconfig
). In this way I have customized QGIS with additional plugins, GUI configurations, etc, and all this edits have been written in this directory 4.5. I also create thedata
directory inaddons
where I put all the data. This way, all the data will be included in the final package 4.6. Finally I save the project in theaddons
directorycreatensis.pl
and all the additions and customization will be includedms-windows
directory and you can install itAttention: it will take a while, especially the first time because the script has to download all the data from the osgeo server. The creation of the package will last something like 1 hour (32 bit)