How to keep a clean local development environment

As a developer I have to work with a lot of tools, development environments and frameworks and I want to

  • keep them in the same spot,
  • know what I work with, especially with which version,
  • keep old versions for compatibility reasons and
  • have a simple way of updating stuff without the need to change a lot of shortcuts.

While using Visual Studio Code I found out that the tool is installed in

%LocalAppData%\Programs\Microsoft VS Code

when installing in user mode (without UAC permissions / as non admin). I adopted this idea for the tools I use on a daily basis:

Now I am installing everything in the folder

%LocalAppData%\Programs

and add a environment variable. For example:

Environment variables

These are then added to the %PATH% variable to make the executables available on command line:

This way if I have to install a new version of a application I just copy it into a new folder, change the environment variable, restart the shell and I am using the new version. Something is wrong with the new version? Just change the variable back and the old version is used. Then I can continue until a patch is available.

The same principle can be applied to server environments. For example if a “Azure DevOps” build agent is used that is executed as specific user for this purpose. Then the tools can be installed solely for this user and the setup does not interfere with potential other services running on this machine. Same goes for shared development instances. Sure, tools used by everybody can be installed globally, but each developer has his own preferences and this setup supports this.

I am using this principle now for

  • IDEs like Eclipse, IntelliJ and Netbeans
  • Development kits like Java, Msys2, Python and dotnet
  • Build environments like Gradle, Maven and Ant
  • Tools like Keystore Explorer, KeePass and others

Adding the stuff to the path variable is optional of course. For example I do not want gcc available on every command line because when compiling ESP32 applications the regular gcc compiler would be the wrong one and both compilers are called “gcc.exe”. Fortunately tools like VS Code support environment variables in their configuration files:

This would be %ProjectDir%\.vscode\c_cpp_properties.json for example:

This way I can configure the used compiler locally for each and every project.