I'm the instructor a college Python programming course. I'd love to adopt VS Code for this course, but the fact that extensions are installed on a per-user basis is a major problem. For education and enterprise markets, there needs to be support for pre-installing extensions for all users.
It's important that we be able to provide a ready-to-use environment to students on login. I have 50 students in my class. I can't afford to lose class time to making students install the Python extension each time they use a new computer or to help troubleshooting students when they have problems.
I've put together a very hackish workaround where I've created a batch file that installs the plugin and then launches VS Code. I've added shortcuts to this batch file, but it's messy and I fear brittle.
Please add a flag to code --install-extension that allows users to specify the extension is to be installed for all users.
FWIW, @rhyspaterson mentioned needing this same functionality in a comment on Issue #27972.
Agree with this as now using Infra as Code to build Dev VM for Infra developers, it making a one source for Dev VM build challenging as no All Users option to install pre-req extensions.
Guess it is not possible yet to install extensions system wide ?
@anahimself @sandy081 Only option found is to copy the .vscode folder from the Infra as Code build accounts profile into the Default profile. Therefore every user logs on gets the extensions added to their profile as its created.
Be good to here VSCode is planning to adding a --install-extension-all-users option?
@wdrury-uk Did you try using the portable VS Code? You can have VS Code installed with extensions and provide it your users/students?
@joaomoreno Does this work?
@sandy081 Thanks but we don't use VS-Code mobile as its Infra as Code we build the VM from blank OS and install software upto required level of the Infrastructure stack.
Is there reason VS-Code isnt installing extensions for ALL user profiles.
Not sure what you mean by VS Code should install extensions for all user profiles.. Is not it depends on where you installed VS Code? Is not the Code should be installed for all users instead extensions?
Right now, extensions are installed on a per-user basis in the user's own folder. Every single user has to install the extensions they want to use themselves.
In education and corporate environments, there is a need for consistency. I use VSCode to teach students Python programming. I want to make sure that everyone has VSCode and all of the necessary extensions already installed when they login. VSCode does not support this right now.
What we're asking for is an option to specify that extensions are installed to a common folder (C:\ProgramData on Windows) and that VSCode instances check there, in addition to any per-user folders, and load all extensions that are found. This way, I can ensure my students get a consistent, ready-to-use experience with VSCode no matter what computer in the classroom they use.
@Bitmapped Not sure if you are aware of the cli argument --extensions-dir. Using this will point VS Code to look for extensions in the directory provided as value to the above argument
Eg: code --extensions-dir /users/home/extensions
@sandy081 thanks but I have tried the option and makes no difference when trying to install an extension. You have to install extensions, then move them form your user profile into common area and then use the option you provide.
As @Bitmapped mentions when setting up a standard build of a VM or client machine we need to be able to install extensions into a common place for ALL user to access, not install multiple copies of the same extension. This is in an inefficient approach to duplicate an install of an extension for each user.
How do we prioritise this as a required feature?
@sandy081 I'm not sure Portable solves anything here.
We currently have two extension locations:
The user wants a third extension folder: a customizable, system-wide one.
@Bitmapped Did you find any solution? I have VDI environment & I'm trying to publish VS Code as a published app & having the same difficulty.
@sohai9 Not really. I wrote an install script that copies the files for the extensions into the Default profile that Windows copies for new users, but it slows down first login for new users substantially.
@joaomoreno Could you explain how you setup two extension locations that will be checked by vscode? You mentioned (1) A non-customizable, system-wide one and (2) A customizable, user one. How did you achieve both? Thx
@Bitmapped Hi we use Visual Studio Code in the Company as primary development tool for Powershell and we solved the problem as follows:
We use the Powershell App Deployment Toolkit to distribute Visual Studio Code with SCCM. To bring the Extensions to the Users we use the ActiveSetup mechanism. ActiveSetup runs a Program/Script on the first user login after the software Install / setting the ActiveSetup key in registry (Internet Explorer uses this mechanism too).
During the installation with the Powershell App Deployment Toolkit a folder with configurations and extensions is copied to a local path and the corresponding active setup reg key is set.
Within the ActiveSetup script you can copy the extension from a path each user of the computer can read from to the users .vscode\extensions folder or /and delete not longer, used or outdated extensions.
Or you can use the code.exe --install-extension extensionname.vsix for each user to install the extension.
This is how we solved this on Windows.
On Linux / MAC you can use the user shell environment script to do something similar.
I hope this will help you.
@danielfeiler Thanks for this idea. I hadn't thought about using ActiveSetup.
I came up with a somewhat similar solution that copies the extension files to the default profile, where they are then copied into each new users' individual profile on first login, but it significantly slows down the first login with copying all the files on spinning disks.
@Bitmapped I have had also the problem, that ActiveSetup slows down the logon of the users because the logon process is waiting for ActiveSetup to finish. I solved this with a 2 File solution. First the activesetup.cmd which is initially called and a PowershellScript called from activesetup.cmd. The last one starts a additional Powershell with a scriptblock for unpacking / copying the extensions. After this one is started, ActiveSetup is "finished". Therefore the user logon goes on and parallelly the last started powershell process do all the work in the background. I have attached these two files to the post in a ZIP File.
activesetup.zip
.
Same problem for me.
We want to use visual studio code in school (15-18 year old learning computer science)
Space on network share is REALLY limited for users (around 300M) and having extensions on a per user basis (1200+ users) is not a solution.
Extension shall (optionnaly) be system wide potentially, and customisation (and just customization) on a per user basis
Having something that is not a hack but a robust industrial solution would be nice
@swirly you can use the --extensions-dir
@swirly you can use the --extensions-dir
parameter to specify a extensions directory. eventually it makes sense to combine it with the --user-data-dir parameter.
Thank you for your answer. This solution could work but is not a long term solution for me
This is not robust.
There should be an extension hierarchy :
Don't forget that in a school environement, user do not have any rights. Si if you use the --extension-dir, they shall not have access to any extension install
Taking into account academic situation with
is imho really a need. It is also the case of some corporate situation
maybe something like vsixinstaller.exe /admin, which is used for Visual Studio, but make one for VScode?
As you say, @swirly, extensions need to be designed to run from system's ProgramData but store user's settings under user's profile appdata.
I just tried this. basically its applying every option you find :)
C:\Users\junaid\AppData\Roaming\Code\User\settings.json
"extensions-dir":"C:\code\extensions\",
"extensions-folder":"C:\code\extensions\"
Created Short-Cut with following command-line.
C:\Code\Code.exe --extensions-dir="C:\code\extensions"
So far, it is using/updating the custom Directory.
I am gonna try running it from Other user account, and will let you know if it fails.
I'm just facing this issue, which is really severe in any environment where roaming profiles are used.
Sure, most extensions don't need much space, but alone the Python extension needs 271 MB.
Sure, most extensions don't need much space, but alone the Python extension needs 271 MB.
And it was my main concern. In our school, students have 400Mb space allowed (SAS storage space is quite expensive, and with the saves, with 1200+ students, we need lot's of space)
Using 271Mb just for one plugin is a no go.
And ... Python is the langage we are using to teach CS. Sadly
@swirly you can use the --extensions-dir
parameter to specify a extensions directory. eventually it makes sense to combine it with the --user-data-dir parameter.Thank you for your answer. This solution could work but is not a long term solution for me
This is not robust.
There should be an extension hierarchy :* global extension, organized by sysadmin and kept up to date by sysadmin * global extension should have their configuration on a per user basis in the user profile * user extension, installed by user and limited in numberDon't forget that in a school environement, user do not have any rights. Si if you use the --extension-dir, they shall not have access to any extension install
Taking into account academic situation with
* multiple users with roaming profiles * users without any admin right * few storage spaceis imho really a need. It is also the case of some corporate situation
I guess this simple update will not be anytime soon implemented... waiting too long already, will cance SCCM deployment and switch to notepad++..
I still dont see the point of having a system wide installation with only user based plugin (no system wide plugins)
exactly as wrote @anahimself !
VScode Team still ignoring:
of the large environments/corporates.
large environment/corporate is a thing, and education environnement is another (with greater constraint I think)
Not having vscode in school because of this limitation is a way to have pupils learn to use something else.
Changing habits can be hard and it will be a hard thing for vscode. Too bad, because it's a fantastic editor !
I too am having this exact same issue. I want to be able to pre-install extensions which are available to all users.
I have a standard disk image which is be deployed to all computers so when a user logs in (ubuntu 18.04) they'll have access to pre-installed extensions. As students' home directories are on a network share, I want to avoid having standard packages installed 100s of times and then backed up nightly.
As visual studio code already comes with some extensions, one potential workaround:
Log in as a user
In the install directory of VSCode is an extensions folder in \Microsoft VS Code\resources\app\extensions. Simply copy all necessary extensions in here and you are good to go! (First you have to download them in a per user basis and copy them over)
@Dampfwalze Thanks for this. I did that this morning with a handful of Python and Java extensions and it seems to be working. Will have to wait and see after students have a chance to kick the tires though.
In the install directory of VSCode is an extensions folder in
\Microsoft VS Code\resources\app\extensions. Simply copy all necessary extensions in here and you are good to go! (First you have to download them in a per user basis and copy them over)
Ok, thank you very much for your advice. It can be considered as a temporary hack and I will try this.
On the long term, updates will be a real pain (everything will have to be done manually). This is not a long term strategy. But it might work on a short term.
Most helpful comment
Thank you for your answer. This solution could work but is not a long term solution for me
This is not robust.
There should be an extension hierarchy :
Don't forget that in a school environement, user do not have any rights. Si if you use the --extension-dir, they shall not have access to any extension install
Taking into account academic situation with
is imho really a need. It is also the case of some corporate situation