How to create a portable version with QGis 2.8

What is a portable application?

A portable application (or portable software) is a computer program characterized by its portability, ie its ability to operate in different execution environments. It does not require pre-installation, does not depend on external components, and does not create a lasting modification of the system by its operation.
These applications are useful for working on a computer whose security policy does not allow installations, or to avoid making lasting changes to a temporarily used computer. Therefore, we can make use of the application from a removable storage like a USB key.

We will discuss how to create a portable version with QGis 2.8, either to be able to use it without installation, or to distribute applications using QGis.
 

If you simply want to download a portable version, you can do it directly from our NASCA site:

for the 32-bit version with this link: http://www.nasca.ovh/downloads/qgis/QGis_2_8_Wien_x32.7z

for a 64-bit version, with this one: http://www.nasca.ovh/downloads/qgis/QGis_2_8_Wien_x64.7z

Firstly, let us give back to Caesar what is Caesar’s: we base ourselves upon the work by Arpa Piemonte in Italy. You can check their work for previous versions of QGis at this address.

We will cover two topics:
– how to create a blank version of QGis 2.8 portable, executable from a USB stick or an external drive.
– how to add plugins to this version

How to create a QGis 2.8 blank portable version

You must, of course, have QGis installed on the computer where you will create the portable version.
On your removable unit:

  • create a directory to install qgis. You can name it as you please. Here we will use QGis_2_8_x64

We select x64 because the PC on which we will create the portable version is a 64bits PC. If you are using a 32-bit PC, you will select x32. This is important because a 32-bit portable version can be run on either a 32-bit or 64-bit PC. On the other hand, a 64-bit portable version can only be executed on a 64-bit PC.

  • In this directory create a sub-directory that you will name qgis.

Here, respecting the name is important because it will be used in the path instructions to run the portable version.

  • Copy the contents of your QGis 2.8 installation, ie all the files and directories located in x: / Program Files (x86) / QGis Wien or x: / Programs / QGis Wien, in the QGis directory of your removable drive
  • Create a text file in the QGis_2_8_x64 directory called qgis.bat.

Therefore, you will have, in the QGis_2_8_x64 directory, the QGis directory and the qgis.bat file.

[Update of the article of 17-10-2015]

Identify the file name used by your QGis version for launching:

This file is located in the QGis_2_8_x64 / bin or QGis_2_8_x32 / bin directory and is named qgis.bat or qgis-ltr.bat. Do not confuse the qgis.bat you created in the previous step and this one.

  • In the qgis.bat file, copy the following lines:
  • If the file found is QGis_2_8_x64 / bin / qgis.bat

@ECHO OFF
SET DRV_LTR =% ~ dp0
SET OSGEO4W_ROOT =% DRV_LTR% qgis
path% PATH%;% OSGEO4W_ROOT% \ apps \ qgis \ bin;% OSGEO4W_ROOT% \ apps;% OSGEO4W_ROOT% \ bin
IF « 1% »==« »(Start« Quantum GIS /% OSGEO4W_ROOT% \ bin \ qgis.bat -configpath% DRV_LTR% qgisconfig) ELSE (start ‘ Quantum GIS /% OSGEO4W_ROOT% \ bin \ qgis.bat -configpath% DRV_LTR% qgisconfig -project% 1)

  • If the file found is QGis_2_8_x64 / bin / qgis-ltr.bat

@ECHO OFF
SET DRV_LTR =% ~ dp0
SET OSGEO4W_ROOT =% DRV_LTR% qgis
path% PATH%;% OSGEO4W_ROOT% \ apps \ qgis \ bin;% OSGEO4W_ROOT% \ apps;% OSGEO4W_ROOT% \ bin
IF « 1% »==« »(Start« Quantum GIS /% OSGEO4W_ROOT% \ bin \ qgis-ltr.bat -configpath% DRV_LTR% qgisconfig) ELSE (start ‘ Quantum GIS / % OSGEO4W_ROOT% \ bin \ qgis-ltr .bat -configpath% DRV_LTR% qgisconfig-project% 1)

[End of article of 17-10-2015 update]

  • Once saved, run the qgis.bat file by double-clicking it

This will create the necessary variables (lines 2 and 3), add the path variable (line 4) and launch QGis (line 5).
You will get the following error message:

 

  • Click close.

You will have a warning message:

  • Click OK
  • Close the command window
  • Restart QGis by double-clicking qgis.bat

You will need to have the opening, without any error message, of QGis. You will also need to have a new directory under QGis_2_8_x64 named qgisconfig.

Your removable unit now contains the QGis 2.8 portable version, fully operational.

How to add plugins to your portable version

You can still launch the portable version on your machine and manually add the plugins, just as you do with any non-portable version.

You can also save time by transferring the plugins installed in your basic version to the portable version.
For it:

  • Copy the contents of C: \ Users \ username \ .qgis2 \ python \ plugins to the qgisconfig \ python \ plugins directory under QGis_2_8_x64   (or x32) on your removable unit.

Warning !: this installs the plugins, ie when you open the plugin manager from QGis, these plugins will appear as installed. However, they will not be activated by default. You will need to open the plugin manager and check the boxes corresponding to the plugins you want to see activated when launching your portable version.

How to launch the portable version of QGis with a default project

The last line of the qgis.bat file is used to launch, by default, QGis with a blank project. But you can open an existing project automatically, adding the project name as a parameter in the qgis.bat file .

You can, but it’s a bit heavy, open a command window, navigate to the QGis_2_8_x64 directory and type in the command line

qgis.bat project_name.qgs

But it’s easier to create, next to the qgis.bat file, a new .bat file that you can name at your convenience and that will contain a single line, the previous command line.

Double-clicking on this .bat file you will execute qgis.bat with the name of the selected project as the parameter.

Leave a Reply

Your email address will not be published. Required fields are marked *