3

Plugin in QGIS are managed by the internal plugin manager, and this requires active (and fast) internet connection. Another way to do it offline is answered here How to install a QGIS plugin when offline? which requires technical knowledge.

Is there not any way we can get standalone installers for individual plugins just like the qgis package?

  • 1
    You could make your own installer using NSIS. Is that what you are looking for? or something different? – Devdatta Tengshe Nov 5 '13 at 12:06
  • 3
    Agree, "installing" a plugin offline just means to copy it into the plugins folder. If you want standalone installers for this task, then write yourself a little script like a batch file – Curlew Nov 5 '13 at 12:16
  • 1
    Plugins are usually tiny ZIP files which the plugin manager downloads. Is there really an issue with slow connections? – underdark Nov 5 '13 at 17:27
  • 1
    DevdattaTengshe : It might be what i need. curlew : I wanted to now if that has already been done. underdark : yes, slow connection is issue and bigger issue is no connection at all. – neogeomat Nov 6 '13 at 4:57
3

To copy all contents of a plugin folder to QGIS plugins folder, you can use a batch script below (see code comments starting with rem). What the script does in short is to copy contents of the plugin folder from a path to the QGIS plugin path. However, if the folder already exists, it overwrites it.

@echo Off
   set PLUGIN_PATH="%USERPROFILE%\.qgis2\python\plugins"
   set PLUGIN=plugin_folder_name
   rem Create the plugin folder if it does not exist 
   if not exist "%PLUGIN_PATH%\%PLUGIN%" mkdir "%PLUGIN_PATH%\%PLUGIN%"
   rem copy all contents to destination - /mir means -overwrite destination
   robocopy "%~dp0\%PLUGIN%"  "%PLUGIN_PATH%\%PLUGIN%" /mir /is /it 

You need to save the above code to a batch file such as install.bat in the root folder where the plugin folder is located. If you are installing it for QGIS3 then you need to change the second line to match QGIS3 plugin path.

 E:\plugin_folder_name
 E:\install.bat

If you want to combine your plugin with QGIS Installer, then you need an NSIS script like this one.

  • Please find the updated code. – wondim Mar 18 '18 at 6:41
  • 1
    To make things simpler, you could replace the first two lines with setlocal. Then, assuming you have your install.bat and the folder containing the plugin in the same directory, it will also work. – 15Step Mar 18 '18 at 17:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.