Message posté par : Christophe
----------------------------------------
Procédure pour créer une version portable de QGIS 3.x pour Windows 10, fonctionnant sans
installation, par simple copie d'un dossier :
Commencer par installer QGIS traditionnellement.
Créer un dossier sur la clé USB, par exemple QGIS_3.22.7
Copier ensuite le dossier d'installation, habituellement "C:\Program Files\QGIS
3.22.7" dans le dossier créé sur la clé USB puis le renommer QGIS.
Créer dans le dossier QGIS_3.22.7 un fichier de lancement QGIS.bat contenant les
instructions suivantes :
-----------------
Code :
@echo "Portable QGIS 3.22.x"
@echo OFF
REM Unable commands display
REM expands to the drive letter and path in which that batch file is located and set a
variable
set DRV_LTR=%~dp0
REM set a specific Qgis variable with a variable setting before
set OSGEO4W_ROOT=%DRV_LTR%qgis
REM add a new path to the system path
path %PATH%;%OSGEO4W_ROOT%\apps\qgis-ltr\bin;%OSGEO4W_ROOT%\apps;%OSGEO4W_ROOT%\bin
REM if the bat file find one argument (project name), open it. Else open a Qgis program
with a new empty project
if "%1" == "" (start "QGIS" /B
%OSGEO4W_ROOT%\bin\qgis-ltr.bat --profiles-path %DRV_LTR%qgisconfig) else (start
"QGIS" /B %OSGEO4W_ROOT%\bin\qgis-ltr.bat --profiles-path %DRV_LTR%qgisconfig
--project %1)
REM To prevent command window from staying open, add exit at the end of file
/QGIS/bin/qgis-ltr.bat
-----------------
Modifier enfin le fichier QGIS_3.22.7/QGIS/bin/qgis-ltr.bat en y ajoutant :
-----------------
Code :
REM Begin - Added for portable version
del "%OSGEO4W_ROOT%\bin\qgis-ltr-bin.env"
"%OSGEO4W_ROOT%\bin\qgis-ltr-bin.exe" --postinstall
REM End - Added for portable version
-----------------
juste avant la dernière ligne et :
-----------------
Code :
REM Begin - Added for portable version
exit
REM End - Added for portable version
-----------------
juste après la dernière ligne.
Il suffit de double-cliquer sur le fichier de lancement QGIS.bat pour lancer QGIS.
Seul inconvénient : les projets QGIS (.qgz ou .qgs) ne seront pas associés à QGIS, il
faudra donc lancer QGIS, puis les ouvrir.
----------------------------------------
Le message est situé
https://georezo.net/forum/viewtopic.php?pid=353228#p353228
Pour y répondre : qgis_fr(a)ml.georezo.net ou reply de votre messagerie
Pour vous désabonner connectez-vous sur le forum puis Profil / Abonnement
--
Association GeoRezo - le portail géomatique
https://georezo.net