cancel
Showing results for 
Search instead for 
Did you mean: 

VSCode and STM32 setup on classroom PCs

bully
Senior

Hello,

we thoroughly use STM32H750 DK systems on our faculty and install VSCode and STM32 plugins on all classroom computers each school year. We have noticed, that plugin is installed in home directory of each user, which is a big struggle for our situtation. 

Can we somehow create "per system" installations of CubeIDE and as alternative IDE VSCode + STM32 plugin to be installed in some common folders for all students that work on PCs?

Thanks in advance,

Robert.

 

5 REPLIES 5
Cartu38 OpenDev
Lead III

@bully I fear no choice ... VSCode is what it is and STM32Cube is enriching this solution by extensions ... so STM32Cube cannot act here. My 2 cents at least.

We're trying to install both tools: CubeIDE and VSCode se two IDEs for STM32. We're having problems with VSCode plugin, because it seems to install on "per user" base, which is not good for PCs, where there are more users.

Regards.

 

@bully yes fully understood.
My point - but I'm not expert here somebody else may have extra clue - is maybe you have to ask to Microsoft / VSCode community about how to. Your need maybe valid playing with Python ecosystem or any other .... not restricted to STM32Cube.

Such said I guess answer to your point is this one:

Cartu38OpenDev_1-1764933054511.png


About Cube you may kind of face another issue about collateral it's pulling out of VSCode scope like toolchains, debuggers & co. By default end user area is considered but some settings exist to control here.

Cartu38OpenDev_0-1764932938920.png

Let's promote variable and restart VSCode ....

ankes
Associate III

While I do not have a ready-made solution for you as it depends a bit on what kind of setup your faculty uses, there are few options you could explore, if you haven't already.

The most straightforward one is to use the ".vscode/extensions.json" file as part of the project files themselves. When a new user starts working on the project (opens the cloned or extracted folder) then VS Code will recommend the necessary extensions. The latest versions get downloaded, installed to the user's AppData folder, and are ready to go.

There is also an approach for those not faint of heart. In it, you use a temporary user account to install the necessary extensions, and then copy the ".vscode" folder from that user's home directory either to "C:\Users\Default" (for non-domain joined computers) or to files associated with a Group Policy (for domain-joined computers).

For non-domain joined computers, any new users created on the computer get a set of extensions ready and baked. After opening VS Code they will likely get updated since new versions of extensions are released all the time. This approach does not work for user accounts that exist before the files are copied over.

For domain-joined computers note that the files in the Group Policy point to a very specific version of an extension and if ever a new version gets published VS Code may try to install that for the user. When the GP detects that the files have changed it may attempt to revert the changes back to the original set, unless the policy is configured correctly to allow updates from the users.

This latter approach may also break down horribly if a new version of VS Code gets released that maintains the extensions in a different manner or method. The ".vscode\extensions.json" as part of project files is much more robust.

KnarfB
Super User

This is not a completetly tested tutorial, but could be a starting point:

For VS Code itself, use the system-wide installation option.

For VS Code extensions, you may use code --extensions-dir <common folder> to use centrally managed extensions.

For STM32Cube bundles and other stuff, there is a cube executable which you can call from a VS code terminal.

cube --help will show environment variables which you can tweak to point to centrally managed folders.

hth

KnarfB