How to install Visual Studio 2015 on a different drive
Asked Answered
H

8

45

I'm trying to figure out how to install Visual Studio Community 2015 on another drive besides my C:\ drive. Every time I open the installer of VS it shows the save location but won't let me change it:

visual studio install dialog with inactive path for install location

I'm wanting to change the download destination to my D:\ drive. If there is a work around could someone give me a hand? I've searched for about a few hours now, and I can't find anything relating to my issue.

Headphone answered 15/8, 2015 at 21:52 Comment(1)
The installation location field in the installer only seems to be grayed out if Visual Studio 2015 (or perhaps Visual C++ 2015 Build Tools) have previously been installed and then uninstalled. So I guess once it is installed you cannot move it to another location.Danzig
S
37

Run the installer from command line with argument /CustomInstallPath InstallationDirectory

See more command-line parameters and other installation information.

Note: this won't change location of all files, but only of those which can be (by design) installed onto different location. Be warned that there is many shared components which will be installed into shared repositories on drive C: without any possibility to change their path (unless you do some hacking using mklink /j (directory junction, i.e."hard link for folder"), but it is questionable whether it is worth it, because any Visual Studio updates will break those hard links. This is confirmed by people who tried that, although on Visual Studio 2012.)


Update: per recent comment, uninstallation of Visual Studio might be required before the above applies. Uninstallation command is like this: vs_community_ENU.exe /uninstall /force

Sharpe answered 15/8, 2015 at 22:4 Comment(12)
When I do this it's still forces it to the C:\ drive regardlessHeadphone
@BryanOlesky – yes, main files will always remain on C:Sharpe
What is considered a main file? Because as I'm watching both of these files being populated with files it looks to be that the files on C: are roughly 10x more then the files in my D:Headphone
@BryanOlesky - I cannot verify that in detail because I have put my installation into default location, but from second VS2012 install screenshot you can see that installed content was parted between C: and M:. I suppose that as MSDN documentation says, relocable files can be put anywhere, but there's a lot of files going into Microsoft shared directories. I don't think they could be put elsewhere – by design.Sharpe
@BryanOlesky - if you give me link to your image, I can post it into your question for you.Sharpe
@Sharpe I haven't tried this yet but when I do and have to install updates, where would the updates end up? this link also talks about custom path but there seems to be a problem with updates placona.co.uk/1196/dotnet/…Velasco
Why will some files "always remain on C"? This seems just terribly bad! I discovered that it installed about 30 GB (ballpark estimate) of my VS 2015 on C, despite a different drive specified on install. With a small SSD, this is unacceptable!Koan
@BenPhilipp - if you check where the files were added, I think you will find them under shared repositories. You might need to do further research how these repos can be moved to another drive (using hardlinks etc.). If you don't have time for this, you can (1) install only those VS2015 features you need (my VS has only fraction of size reported by you) (2) swap your small SSD for SSD of 250 GB or larger and move your drive C: image there and upsize it - no more problems with space (I've done this). If you do not have experience, many computer shops can do this for you in 1-2 days.Sharpe
@Sharpe - When I installed VS, I wasn't aware of the undesirable behavior and went ahead and installed all sorts of "nice to have" content. When I wrote the above comment I was already in the process of uninstalling and re-installing with more minimalistic settings (that is an obvious choice - as is upgrading your sysdrive). My comment can be taken closer to face value: I was really wondering why they wouldn't prompt for external, 3rd party and redistributable content. (I don't feel like implementing symlinks for all the dozens of paths is too great an idea)Koan
This did not work for me, but worked in conjunction of running command vs_community_ENU.exe /uninstall /force first.Doradorado
this doesn't work if installation path is locked on old installation path unfortunatelyRivers
As much as I love visual studio it would be really nice if Microsoft listened to those of us in development and realize this is not acceptable.Analogy
T
27

Run installer in command line (Admin) with argument:

vs_community_ENU.exe /uninstall /force

Then:

vs_community_ENU /CustomInstallPath E:\VisualStudio2015

Tabaret answered 28/1, 2016 at 13:12 Comment(1)
saves maybe 1GB, 1.5GB max in a VS + C++ installation, vast majority still goes to C: drive ;(Landel
M
13

Use VirtualBox. Create a machine on the drive you wish. Enable guest aditions and activate seamless mode.

Benefits:

  • The ENTIRE installation is on the second drive. will work even with a 32gb ssd. (This is the main selling point, considering that Visual studio with it's additional features exceeds 30gb. If you have the GB to spare this solution is NOT the best for you)
  • Uninstalling or backing up is a breeze. Just delete or move the image file. No system file conflicts and dirty registry in case of a corrupted installation.

Drawbacks:

  • You need a LOT of ram. I use 4GB (out of 8) and 2 (out of 6) cores to run comfortably. Even so it is still slower than a normal installation.
  • Will not work for applications with extensive 3d graphics. If you want to work with forms it's fine but if you want to create a 3d game for android using say xamarin then forget it.
  • Testing the program takes several seconds to compile (minutes for android apps). This may not seem much but during development these seconds do add up.

This is the solution i am using and am very happy with it but i am not your average professional programmer. I just create small windows form applications like file uploaders, chat apps etc. Try it out. It will take some time to setup but this experimentation isn't risky.

Maestricht answered 28/5, 2016 at 19:34 Comment(0)
S
8

After trying to manually uninstall, and then downloading another copy of the VS 2015 community installer for use with the force uninstall command line argument (Original answer by Michael Schuchardt), I was still unable to modify the install directory.

After testing further, I found that Unity (which integrates with Visual Studio as of Unity 5.2) also had to be removed. At this point Visual Studio Uninstaller (link to latest release on Github) can be used for the final removal of remaining any remaining components.

You will now be able to run the Visual Studio Installer and select a directory or, alternatively, run the install from command line using the "/CustomInstallPath ..." argument.

Sym answered 1/7, 2016 at 17:22 Comment(1)
Works for me!! Thank you!!Dollfuss
U
5

I use Xamarin with Visual Studio, and I prefer to move only some large android to another directory with(copy these folders to destination before create hardlinks):

mklink \J "C:\Users\yourUser\.android" "E:\yourFolder\.android"

mklink \J "C:\Program Files (x86)\Android" "E:\yourFolder\Android"
Unguentum answered 28/3, 2017 at 14:59 Comment(2)
Do you have any Performance decrease running Android folder on other drive? During build or debugging in Emulator or device?Summon
If the secondary drive is a HDD, yes.Unguentum
S
3

I found these two links which might help you:

  1. https://www.reddit.com/r/csharp/comments/2agecc/why_must_visual_studio_be_installed_on_my_system/

  2. http://www.placona.co.uk/1196/dotnet/installing-visual-studio-on-a-different-drive/

Basically, at least a portion needs to be installed on a system drive. I'm not sure if your D:\ corresponds to some external drive or an actual system drive but the symlink solution might help.

Good luck

Serpens answered 15/8, 2015 at 21:58 Comment(0)
L
1

Anyone tried this approach?

Doing a dir /s vs_ultimate.exe from the root prompt will find it. Mine was in <C:\ProgramData\Package Cache\{[guid]}>. Once I navigated there and ran vs_community_ENU.exe /uninstall /force it uninstalled all the Visual Studio assets I believe.

Got the advice from this post.

Loyola answered 27/10, 2016 at 22:7 Comment(0)
U
0

Uninstall the plugins first. And then try this. This uninstaller worked like a charm (I didn't even uninstall 2015 myself, it did everything on its own)!

Unclean answered 10/10, 2020 at 14:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.