Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows installation without administrative privileges on local machine #30754

Open
stevenprimeaux opened this issue Jul 16, 2019 · 17 comments
Open
Labels
Build/Install Related to compiling or installing QGIS Feature Request

Comments

@stevenprimeaux
Copy link

stevenprimeaux commented Jul 16, 2019

Feature description

I could see at least three possibilities for installation without administrative rights, examples of which are provided below.

  1. Windows installer that simply works without administrative privileges
  2. Portable app format
  3. Tarball of binaries (not source code)

Additional context

Myself and many others work in a context where administrative privileges are required for installation, even onto a local machine and into a local directory where the user has write privileges. When these privileges are not available, users are unable to install valuable open-source analytical tools like QGIS and OSGeo4W.

Here are some examples where I've been able to install applications without administrative rights:

  1. R Windows installer
  2. LibreOffice Portable
  3. Zip/tarball of RStudio binaries
@andreasneumann
Copy link
Member

I think you can already do that. If you install QGIS with the OSGeo4W installer (see http://download.osgeo.org/osgeo4w/osgeo4w-setup-x86_64.exe ) you can install in a directory of your choice, also on a different drive than C.

Needs to be confirmed by @jef-n

@jef-n would that work without administrative privileges?

@jef-n
Copy link
Member

jef-n commented Jul 17, 2019

@andreasneumann The included installers for the microsoft runtimes require admin privileges - so the installer does to. Apart from that it doesn't need them (the osgeo4w packages themselves are tar balls).

@andreasneumann
Copy link
Member

@jef - thanks for the clarifications.

What are the chances that these Microsoft runtime libraries are already existing on the system? In other words: would the QGIS installer detect already existing compatible Microsoft runtime environments and skip the installation if they already exist on the system?

Also: how frequently does QGIS need updates to these Microsoft runtime environments? If they are relatively stable over a couple of years, then the sysadmin may install these runtime environments separately from QGIS and then the user without admin rights could still install QGIS without the runtime? Would this be a useful workflow or do these runtime environments change quite frequently, e.g. with every new QGIS version?

@jef-n
Copy link
Member

jef-n commented Jul 17, 2019

The runtimes are tied to the compiler version used for building the individual packages. The OSGeo4W packages are not built with one compiler version - some because the package didn't need updates, some because the are repackaged from binaries. All runtimes used to be in one package - they are split now, but the package metadatas have not all be updated - so some still depend on the "all runtime" meta package that depends on all. Another thing is that only some in between runtimes require installation (Microsoft introduced that at some point, but reverted it later), the rest could just be included as plain files. So we'd need to investigate, which runtime require installation and whether we actually still need them. If we do, what packages depend on them and what it takes to replace those with ones that depend on later runtimes. Replacing those would enable us to drop the admin privilege requirement. Another thing that has been on my TODO list for long ;)

@AlisterH
Copy link
Contributor

Regarding the listed options 1 to 3:
The osgeo4w installer is also blocked by some "security" software (Trend Micro considered it to be malware last time I tried it).
Being able to "Install" without an actual installer would improve people's chance of successfully running QGIS... and reduce their chance of getting in trouble with their IT department ;)

@andreasneumann
Copy link
Member

The osgeo4w installer is also blocked by some "security" software (Trend Micro considered it to be malware last time I tried it).

yes. I also had this by some stupid AV software. Those are false positives from some batch files.

@amr66
Copy link

amr66 commented Jul 18, 2019

I run QGIS from an USB-Stick, "basically" portable. Some of the steps/problems that should be considered:

  • Microsoft runtimes: There is a way to extract the vc-runtime dlls, using lessmsi see here, in german. They need to be put into the bin-, or any directory in the PATH-Variable.
  • The only issue i had so far is opencl.dll, which causes python errors in some cases if it is not "updated" by QGIS. That needs administrator privilege and i was not able to place it in PATH.
  • Further some things in QGIS depend on absolute pathes, like many executables in pythons script directory, like pip3.exe.
  • If you want to use the same QGIS profile on any computer you can use the start option --profiles-path to point to a certain directory, were your profile will be read from. (I put a directory on my on my USB-Stick), QGIS also uses %APPDATA%\Local\Temp to save temporary files, so I start QGIS with %APPDATA% pointig to a path on my stick as well.
  • a lot of inspiration, where to find "non-portable" things, is to look into tmpl-files inside a QGIS installation. Some of them you may need to change, some not.

@djes
Copy link

djes commented Jul 31, 2019

I was able to use QGIS without admin privileges until 3.6.3, with a few manual work. For now 3.8.1 can be launched but only without processing plugin (compilation modification?). The misc vcredist are a problem and it seems that the multiple versions of sqlite3.dll in %PATH% too. My two cents.

@amr66
Copy link

amr66 commented Jul 31, 2019

VC redistributables should be extracted to a directory in your path. I think sqlite3 is installed by python2/python3 and by QGIS. Do you get error messages for that dll?
Or for the Processing Plugin?

@djes
Copy link

djes commented Jul 31, 2019

VC redistributables are making the postinstall.bat break and need to be edited. It's not too difficult. Sqlite3.dll is used by several programs and I'm not sure that the good one is used, as it's not the first found by «where» command in the shell... But I don't know if it's why the 3.8 processing plugin doesn't work. If only I could trace the problem... An idea?

@AlisterH
Copy link
Contributor

FWIW I just tried:

  • installing "standalone" QGIS 3.30.0 on one machine.
  • copying it from C:\Program files to D:\ on another machine which has old versions of QGIS up to 3.18.
  • editing D:\QGIS 3.30.0\bin\qgis-bin.env to replace all instances of C:\PROGRA~1 and C:/PROGRA~1 with D:`
  • running D:\QGIS 3.30.0\bin\qgis-bin.exe without admin rights.
    The first time it started up there was an error message, but there don't seem to be any problems the second time.

Even if it wouldn't work on a fresh Windows install with no previous versions of QGIS, and admin intervention was required occasionally due to new VC redistributables, it seems to me that there would be significant benefits to being able to run the installer without admin rights, or download a simple zipped installation of QGIS.
QGIS development is rapid and many users would benefit from being able to install new versions regularly, but are in corporate environments where getting an administrator to update QGIS on a regular basis is not feasible. Having a lot more users running up-to-date versions would be a good thing.

@amr66
Copy link

amr66 commented Mar 16, 2023

I think since we use setup v2 with all the new packages, this issue can be closed. @AlisterH Only thing I discovered, when copying QGIS to another drive/path, the env-file (qgis-ltr-bin.env in my case) in the bin directory does contain the old paths. If you start QGIS via the provided batch file you even don't need the .env file.

@AlisterH
Copy link
Contributor

I don't think it can be closed. Users currently still need to be able to run the installer somewhere with admin rights and then copy the installed QGIS from there.

@amr66
Copy link

amr66 commented Mar 17, 2023

Yes, I agree, but the issue is part of osgeo4w and its installer and not of the main QGIS repository. I always use the osgeo4w installer without admin privileges, copy the folder to my USB-Stick, delete the env file and start qgis with the provided bat-file (which sets all the needed environment variables). I even use my QGIS profile from the USB-drive adding the commandline switch "--profiles-path" when starting QGIS. By the way, the VC redistributables are now in the bin directory and do not need to be "installed" (if using the bat file to start QGIS).

@AlisterH
Copy link
Contributor

By the way, the VC redistributables are now in the bin directory and do not need to be "installed" (if using the bat file to start QGIS).

So there's no reason the standalone installer couldn't allow installing "per user" (e.g. to AppData\Local\Programs), without admin rights?

@amr66
Copy link

amr66 commented Mar 31, 2023

Sorry, never tried the standalone installer. May be it has command line options like the Osgeo4w setup?

@jef-n
Copy link
Member

jef-n commented Mar 31, 2023

So there's no reason the standalone installer couldn't allow installing "per user" (e.g. to AppData\Local\Programs), without admin rights?

Correct - just that it installs to "Program Files" per default and that doesn't work w/o admin rights.

@alexbruy alexbruy added the Build/Install Related to compiling or installing QGIS label Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build/Install Related to compiling or installing QGIS Feature Request
Projects
None yet
Development

No branches or pull requests

7 participants