Как изменить путь установки vs code

от admin

Name already in use

visualstudio-docs / docs / install / change-installation-locations.md

  • Go to file T
  • Go to line L
  • Copy path
  • Copy permalink
  • Open with Desktop
  • View raw
  • Copy raw contents Copy raw contents

Copy raw contents

Copy raw contents

Select the installation locations in Visual Studio

You can reduce the installation footprint of Visual Studio on your system drive by changing the location of some of its files. Specifically, you can use a different location for the download cache and shared components, tools, and SDKs.

You can reduce the installation footprint of Visual Studio on your system drive by changing the location for some of its files. Specifically, you can use a different location for the download cache, shared components, SDKs, and tools files.

[!NOTE] There are some tools and SDKs that have different rules on where they can be installed. Such tools and SDKs are installed on your system drive even if you choose another location.

When you install Visual Studio, choose the Installation locations tab.

In the Visual Studio IDE section, accept the default. Visual Studio installs the core product and includes files that are specific to this version of Visual Studio.

[!TIP] If your system drive is a solid-state drive (SSD), we recommend that you accept the default location on your system drive. The reason? When you develop with Visual Studio, you read from and write to a lot of files, which increases the disk I/O activity. It’s best to choose your fastest drive to handle the load.

In the Download cache section, decide if you want to keep the download cache, and then decide where you want to store its files.

Check or uncheck Keep download cache after the installation.

If you decide not to keep the download cache, the location is used only temporarily. This action won’t affect or delete files from previous installations.

Specify the drive where you want to store installation files and manifests from the download cache.

For example, if you select the «Desktop development with C++» workload, the temporarily required size is 1.58 GB on your system drive, which is then freed as soon as the installation completes.

[!IMPORTANT] This location is set with your first installation and cannot be changed later from the installer UI. Instead, you must use command-line parameters to move the download cache.

In the Shared components, tools, and SDKs section, note that it uses the same drive that you chose in the «Download cache» section. The \Microsoft\VisualStudio\Shared directory is where Visual Studio stores the files that are shared by side-by-side Visual Studio installations. SDKs and tools are also stored in this directory.

When you install Visual Studio, choose the Installation locations tab.

. image type=»content» source=»media/vs-2022/vs-installer-installation-locations-tab.png» border=»false» alt-text=»Screenshot showing the Installation locations tab of the Visual Studio Installer.».

In the Visual Studio IDE section, accept the default path. Visual Studio installs the core product, and includes files that are specific to this version of Visual Studio.

[!TIP] If your system drive is a solid-state drive (SSD), we recommend that you keep the core product on your system drive. The reason? When you develop with Visual Studio, you read from and write to a lot of files, which increases the disk I/O activity. It’s best to choose your fastest drive to handle the load.

[!IMPORTANT] You can select a different location only when you first install Visual Studio. If you’ve already installed it and want to change the location, you must uninstall Visual Studio and then reinstall it.

In the Download cache section, decide whether you want to keep the download cache, and if so, where you want to store its files.

Check or uncheck Keep download cache after the installation.

If you decide not to keep the download cache, the download cache location is only temporarily used. This action won’t affect or delete files from previous installations.

For example, if you select the «Desktop development with C++» workload, the temporarily required size for the download cache location is 1.28 GB. As soon as the installation completes, downloaded cache files are removed, leaving only package metadata.

Specify the folder path, including the drive, where you want to store the installation files and manifests from the download cache.

[!IMPORTANT] You can select a different location only when you first install Visual Studio. If you’ve already installed it and want to change the location, you must uninstall Visual Studio and then reinstall it.

In the Shared components, tools, and SDKs section, select the folder where you want to store the files that are shared by side-by-side Visual Studio installations. SDKs and tools are also stored in this directory.

[!IMPORTANT] If you’ve installed Visual Studio on your computer before, you won’t be able to change the Shared components, tools, and SDKs path and it will appear greyed out.

Visual Studio Code on Windows

Alternatively, you can also download a Zip archive, extract it and run Code from there.

Tip: Setup will add Visual Studio Code to your %PATH% , so from the console you can type ‘code .’ to open VS Code on that folder. You will need to restart your console after the installation for the change to the %PATH% environmental variable to take effect.

User setup versus system setup

VS Code provides both Windows user and system level setups. Installing the user setup does not require Administrator privileges as the location will be under your user Local AppData (LOCALAPPDATA) folder. User setup also provides a smoother background update experience.

The system setup requires elevation to Administrator privileges and will place the installation under Program Files. This also means that VS Code will be available to all users in the system.

See the Download Visual Studio Code page for a complete list of available installation options.

32-bit versions

If you need to run a 32-bit version of VS Code, both a 32-bit Installer and Zip archive are available.

Updates

VS Code ships monthly releases and supports auto-update when a new release is available. If you’re prompted by VS Code, accept the newest update and it will be installed (you won’t need to do anything else to get the latest bits).

Note: You can disable auto-update if you prefer to update VS Code on your own schedule.

Windows Subsystem for Linux

Windows is a popular operating system and it can be a great cross-platform development environment. This section describes cross-platform features such as the Windows Subsystem for Linux (WSL) and the new Windows Terminal.

Recent Windows build

Make sure you are on a recent Windows 10 build. Check Settings > Windows Update to see if you are up-to-date.

Windows as a developer machine

With WSL, you can install and run Linux distributions on Windows. This enables you to develop and test your source code on Linux while still working locally on your Windows machine.

When coupled with the WSL extension, you get full VS Code editing and debugging support while running in the context of WSL.

See the Developing in WSL documentation to learn more or try the Working in WSL introductory tutorial.

New Windows Terminal

Available from the Microsoft Store, the Windows Terminal (Preview) lets you easily open PowerShell, Command Prompt, and WSL terminals in a multiple tab shell.

Next steps

Once you have installed VS Code, these topics will help you learn more about VS Code:

    — Learn how to install Git, Node.js, TypeScript, and tools like Yeoman. — A quick orientation to VS Code. — Learn how to configure VS Code to your preferences through settings. — Lets you jump right in and learn how to be productive with VS Code.

Common questions

What command-line arguments are supported by the Windows Setup?

VS Code uses Inno Setup to create its setup package for Windows. Thus, all the Inno Setup command-line switches are available for use.

Additionally, you can prevent the Setup from launching VS Code after completion with /mergetasks=!runcode .

Scrolling is laggy and not smooth

On certain devices, editor scrolling is not smooth but laggy for an unpleasant experience. If you notice this issue, make sure you install the Windows 10 October 2018 update where this issue is fixed.

I’m having trouble with the installer

Try using the zip file instead of the installer. To use this, unzip VS Code in your AppData\Local\Programs folder.

Note: When VS Code is installed via a Zip file, you will need to manually update it for each release.

Icons are missing

I installed Visual Studio Code on my Windows 8 machine. Why are some icons not appearing in the workbench and editor?

VS Code uses SVG icons and we have found instances where the .SVG file extension is associated with something other than image/svg+xml . We’re considering options to fix it, but for now here’s a workaround:

Using the Command Prompt:

  1. Open an Administrator Command Prompt.
  2. Type REG ADD HKCR\.svg /f /v "Content Type" /t REG_SZ /d image/svg+xml .

Using the Registry Editor (regedit):

  1. Start regedit .
  2. Open the HKEY_CLASSES_ROOT key.
  3. Find the .svg key.
  4. Set its Content Type Data value to image/svg+xml .
  5. Exit regedit .

Unable to run as admin when AppLocker is enabled

With the introduction of process sandboxing (discussed in this blog post) running as administrator is currently unsupported when AppLocker is configured due to a limitation of the runtime sandbox. If your work requires that you run VS Code from an elevated terminal, you can launch code with —no-sandbox —disable-gpu-sandbox as a workaround.

How to Change VS Code Code.exe Path for Update?

[Windows 10] I have "Microsoft VS Code (User Setup)" installed in a custom directory and whenever I try to update it this shows up:

Error Prompt 1

Error Prompt 2

How do I change the path to point it to the right directory where "Code.exe" exists?

MC Emperor's user avatar

BuzzFuzz's user avatar

2 Answers 2

I had the same problem recently. I ended up reinstalling VS Code.

Do I lose my settings?

No. Note that I did not uninstall VS Code, I just downloaded the installer from the website and installed VSCode. This won’t hurt, as it does not touch your settings and extensions.

What I tried

I first tried to visit the path mentioned in the error log, and I noticed that the folder _ within that directory contained the new VS Code version, downloaded by the updater.

So the path should have been C:\Users\myusername\AppData\Local\Programs\Microsoft VS Code\_\Code.exe instead, perhaps.

I tried to move all files from _ to their parent directory, and then, in VS Code, Help » Restart to update. This opened the new version of VS Code, but after closing it and starting it from the original install location (or through a shortcut I have always been using), the old version was still loaded. So apparently, this "trick" didn’t work.

Then I tried to make a symbolic link to Code.exe within the _ directory, so the VS Code updater would find Code.exe. This caused roughly the same things to happen. So, this didn’t work either.

At last, I decided to just download VS Code from their website, and simply install it. This seemed the most simple option to me.

Как изменить путь установки vs code

Gray Pipe

Лучший отвечающий

Вопрос

Ответы

  • Предложено в качестве ответа Maksim Marinov Microsoft contingent staff, Moderator 24 октября 2016 г. 12:57
  • Помечено в качестве ответа Maksim Marinov Microsoft contingent staff, Moderator 25 октября 2016 г. 7:24

Если Вам помог чей-либо ответ, пожалуйста, не забывайте жать на кнопку "Предложить как ответ" или "Проголосовать за полезное сообщение" Мнения, высказанные здесь, являются отражение моих личных взглядов, а не позиции корпорации Microsoft. Вся информация предоставляется "как есть" без каких-либо гарантий.

  • Помечено в качестве ответа Vladislavvvv 25 октября 2016 г. 11:46

Все ответы

  • Предложено в качестве ответа Maksim Marinov Microsoft contingent staff, Moderator 24 октября 2016 г. 12:57
  • Помечено в качестве ответа Maksim Marinov Microsoft contingent staff, Moderator 25 октября 2016 г. 7:24

Если Вам помог чей-либо ответ, пожалуйста, не забывайте жать на кнопку "Предложить как ответ" или "Проголосовать за полезное сообщение" Мнения, высказанные здесь, являются отражение моих личных взглядов, а не позиции корпорации Microsoft. Вся информация предоставляется "как есть" без каких-либо гарантий.

  • Помечено в качестве ответа Vladislavvvv 25 октября 2016 г. 11:46

Звучит как магия, как так удаляли, а место свободное уменшилось. Но если честно сказать всегда лучшим методом переустановки VS, является новая установка на чистую ОС.

Если Вам помог чей-либо ответ, пожалуйста, не забывайте жать на кнопку "Предложить как ответ" или "Проголосовать за полезное сообщение" Мнения, высказанные здесь, являются отражение моих личных взглядов, а не позиции корпорации Microsoft. Вся информация предоставляется "как есть" без каких-либо гарантий.

Читать:
Как создать ярлык в ubuntu

Похожие статьи