Change Visual Studio installation folder after install - visual-studio

I'm running out of space on the partition that has Visual Studio installed. It's safe to copy the installation in another partition?

You could move the files to the new location (manually) and then use Junction (http://technet.microsoft.com/en-us/sysinternals/bb896768.aspx) to create a link back. I did that with 2012 and it seems to be working for me.

Without having tried I bet this isn't possible.
Installation folders are typically stored in many places such as config files and the registry. After moving, all these references will still point to the old and now invalid location. And, even worse, moving the folder will also break any installation / uninstallation / update routines which means that you will no longer be able to install patches and service packs.
Conclusion: You are way better off uninstalling Visual Studio and moving it to the new location. It takes only a short time as compared to the headache that you would end up otherwise.
(Or, if you don't like to do that you can of course still mount a new partition to the program files folder to increase disc space or get a larger hard drive)

I tried repairing or modifying it via the installer (add remove programs), because I moved it to another Partition. But nothing, it crashes with weird error reports.
Uninstalling and reinstalling seems the only choice, but that doesn't work either...
I used a USB Stick, gave it the old HDD label and made a junction like described here: https://superuser.com/questions/484061/how-to-create-an-ntfs-junction
mklink /J <new directory to be linked> <target directory>
D:\>mklink /J "Program Files\Microsoft Visual Studio 11.0" "K:\Program Files\Mic
rosoft Visual Studio 11.0"
This doesn't work unfortunately because VS still complains about other missing files, but it at least let's you unistall it.
EDIT: If you try to reinstall VS and it won't let you choose a different folder look here at the accepted answer: How to change Visual Studio 2012 install directory?

No, that wouldn't work with any newer versions of Visual Studio. If it's pre-2003 you might have a chance.

Related

Visual Studio 2017 installation on a different location due to lack of space using symbolic link

Trying to create a symbolic link for Visual Studio Community 2017 due to low storage space.
For reference, Disk C is the one with low space. I want the files to be installed to Disk D.
mklink /j "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community" "D:\Program Files (x86)\Microsoft Visual Studio\2017\Community"
Ran cmd as admin and it returns The system cannot find the path specified.
May I know the mistake here? Thanks.
For now, we cannot completely install VS to another hard drive. During the initial VS installation, we can choose another hard drive to install to install, but most of those components still install in the system drive per this.
Some other community members already reported a suggestion to the VS Product Team, please check this: Allow users to install entirely to another hard drive, it is tags as ‘PLANNED’, due to the complexity and the VS Product Team still have not achieved this requirement, and you can also vote it to make them know the high priority, sorry for this inconvenience.
If you have not never install the VS on your computer before, you can use the mklink /j command to save some spaces on the system drive like this: VS2015 & VS2017 Ignore Path Selection During Installation

Visual studio installation path grayed out

I had to reformat one of my drives (T:) and change its purpose. I had Visual studio 2015 installed on it, uninstalled it before formatting and now the drive has a different letter (can't change it, other things installed on it). I want to install visual studio 2015 again, but on the C: drive. When I run the installation, I get this:
The T: drive doesn't exist anymore, and I can't change the installation path to another drive.
I tried some solutions where I had to delete registry keys, but didn't succeed since most of the solutions were for older versions of visual studio. Is there a way to change the path?
Run installer in command line (Admin Mode) In folder keep File vs_community_ENU.exe
and put this command
vs_community_ENU.exe /uninstall /force
Then put this
vs_community_ENU /CustomInstallPath C:\VisualStudio2015
NewDrive:\VisualStudio2015
it work for me
Hope this helps
I had the same problem. I had an installed Visual Studio on a crashed harddisk.
I tried everything above, nothing worked. You should use this method as ultima ratio:
There is a VisualStudioUninstaller by Microsoft.
Download it
Extract it
Run it with Setup.ForcedUninstall.exe in an administrator command prompt
If this fails:
Start an elevated powershell:
install-package msi -provider PowerShellGet
get-msicomponentinfo '{777CBCAC-12AB-4A57-A753-4A7D23B484D3}' | get-msiproductinfo | uninstall-msiproduct -properties IGNOREDEPENDENCIES=ALL
Try again. If this fails, replace the GUID with one of the following:
Visual Studio 2015: {777CBCAC-12AB-4A57-A753-4A7D23B484D3}
Visual Studio 2013: {56E09E41-21B6-4F87-8D60-0787D028ECDD}
Visual Studio 2012: {DB786F13-64A8-45D7-8C03-0E819DF9F7B3}
Visual Studio 2010: {01696F98-947C-4CF9-8BD3-ABE70332FDED}
Sources: blogs.msdn.microsoft.com
and
landinghub.visualstudio.com
If this fails get an exorcist or/and reinstall your system.
I know you said it worked, but for some (including me) it did not. After multiple hours, however, I found a way. Here are the steps to my solution:
If you have not uninstalled VS2015 yet, do it through Control Panel.
Run the setup (ect. vs_community.exe).
If you cannot install on desired drive, keep reading here :)
Copy the path from where the VS2015 want you to install it on (e.g.: "D:\Programmer\Microsoft Visual Studio 14.0").
Open regedit(Just press windows key, type it in, and press Enter).
Warning, now you are in the windows registry, be careful or you may cause system-wide instability.
Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData Here there should be 2 folders called something like S-1-5-18 and S-1-5-21-345634235-23423416487. Just start with the one with the smallest number.
Go into the Components folder, and here you should see many folders with numbers and letters as name. Right click on the first of these, and click Search. ("Find" for Windows 10)
Paste the path from step 4. here, and make sure that the 3 top boxes are checked (they should be by default).
Right-click the first result of the search and click export. Save it somewhere you remember, then right-click it again and delete it this time.
Run the VS2015 setup again (vs_community.exe) and check if you can change the path now. If not go back to 9. and continue.
If it worked, just install VS2015 and just remember where you put your saved reg files. If anything goes wrong, you can restore them again by running the file.
Hope this helps someone!
This worked for me:
Start procmon and run the VS installation.
In procmon, find the relevant registry by looking for:
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\*\Components"
Make sure the key you've found was successfully opened (result should be SUCCESS)
Open regedit and find the relevant Components folder.
Search for the key you have found.
Export it for backup, and then delete it.
Hope it works for you too :-)
For me, it was the mistake of installing SQL Server Management Studio 2016 before installing Visual Studio 2015. SSMS 2016 is now based of VS 2015 Shell Core. And the new setup doesn't allow for any interaction except pressing the Install button. That way, part of VS 2015 was installed to C: drive. And hence, all options to change VS 2015 Enterprise install path failed.
I removed SMSS 2016 and, explicitly, VS 2015 Shell Core and then tried to install VS 2015 and it worked with Custom Path and Browse button.
You can use junction tool by Microsoft to create a REAL directory on other partition (e.g. D:\Program Files (x86)\Microsoft Visual Studio 14.0) and make a symbol link to it as C:\Program Files (x86)..., just like the command shows below, then windows will use C:\Program Fil.. as path and the real dirs/files are in D:\Prog...
junction.exe 'C:\Program Files (x86)\Microsoft Visual Studio 14.0' 'D:\Program Files (x86)\Microsoft Visual Studio 14.0'
Download junction tool from https://technet.microsoft.com/en-us/sysinternals/bb896768.aspx
In case someone still has this problem (I had it, since I deleted my partition, on which Visual Studio was installed before):
Open the registry, go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\Setup
and there you will find some files. At least one of these files should contain the old path. Delete the file and the installation should work now.
In case there are other people who couldn't get it to work with the solutions already posted, here's what I did:
My problem was, that I had VS installed on partition E. The harddrive containing E crashed one day, and I couldn't uninstall VS properly anymore.
/uninstall /force wouldn't do the trick, since the setup would crash every time.
So I took my partition "D" and gave it the letter "E". Now I was able to install VS to the specified path. After that, I uninstalled it with /uninstall /force and the setup finished successfully.
After that I changed the partition "E" back to "D" and was able to install VS to "D".
I hope this helps someone with the same problem.
I know this is old, but just so you know there are command line switches that are very helpful for this sort of thing. In the command prompt, call your executable followed by /CustomInstallPath then the directory, as follows (adjust your executable pathname, of course, as necessary):
vs_community__e45cb735eddf4e4b9d95904be6e1ba26.exe /CustomInstallPath
Just a heads up, this didn't work for me the first time, so don't be afraid to try a couple times. I left my computer for the weekend (logged out), and ran the exact same command without doing anything else and it worked. Go figure...
In powershell:
Remove-Item
Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\CACBC777BA2175A47A35A4D7324B483D
see https://stackoverflow.com/a/33839884/3353857

Visual studio installer retains previous installation path [duplicate]

I had to reformat one of my drives (T:) and change its purpose. I had Visual studio 2015 installed on it, uninstalled it before formatting and now the drive has a different letter (can't change it, other things installed on it). I want to install visual studio 2015 again, but on the C: drive. When I run the installation, I get this:
The T: drive doesn't exist anymore, and I can't change the installation path to another drive.
I tried some solutions where I had to delete registry keys, but didn't succeed since most of the solutions were for older versions of visual studio. Is there a way to change the path?
Run installer in command line (Admin Mode) In folder keep File vs_community_ENU.exe
and put this command
vs_community_ENU.exe /uninstall /force
Then put this
vs_community_ENU /CustomInstallPath C:\VisualStudio2015
NewDrive:\VisualStudio2015
it work for me
Hope this helps
I had the same problem. I had an installed Visual Studio on a crashed harddisk.
I tried everything above, nothing worked. You should use this method as ultima ratio:
There is a VisualStudioUninstaller by Microsoft.
Download it
Extract it
Run it with Setup.ForcedUninstall.exe in an administrator command prompt
If this fails:
Start an elevated powershell:
install-package msi -provider PowerShellGet
get-msicomponentinfo '{777CBCAC-12AB-4A57-A753-4A7D23B484D3}' | get-msiproductinfo | uninstall-msiproduct -properties IGNOREDEPENDENCIES=ALL
Try again. If this fails, replace the GUID with one of the following:
Visual Studio 2015: {777CBCAC-12AB-4A57-A753-4A7D23B484D3}
Visual Studio 2013: {56E09E41-21B6-4F87-8D60-0787D028ECDD}
Visual Studio 2012: {DB786F13-64A8-45D7-8C03-0E819DF9F7B3}
Visual Studio 2010: {01696F98-947C-4CF9-8BD3-ABE70332FDED}
Sources: blogs.msdn.microsoft.com
and
landinghub.visualstudio.com
If this fails get an exorcist or/and reinstall your system.
I know you said it worked, but for some (including me) it did not. After multiple hours, however, I found a way. Here are the steps to my solution:
If you have not uninstalled VS2015 yet, do it through Control Panel.
Run the setup (ect. vs_community.exe).
If you cannot install on desired drive, keep reading here :)
Copy the path from where the VS2015 want you to install it on (e.g.: "D:\Programmer\Microsoft Visual Studio 14.0").
Open regedit(Just press windows key, type it in, and press Enter).
Warning, now you are in the windows registry, be careful or you may cause system-wide instability.
Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData Here there should be 2 folders called something like S-1-5-18 and S-1-5-21-345634235-23423416487. Just start with the one with the smallest number.
Go into the Components folder, and here you should see many folders with numbers and letters as name. Right click on the first of these, and click Search. ("Find" for Windows 10)
Paste the path from step 4. here, and make sure that the 3 top boxes are checked (they should be by default).
Right-click the first result of the search and click export. Save it somewhere you remember, then right-click it again and delete it this time.
Run the VS2015 setup again (vs_community.exe) and check if you can change the path now. If not go back to 9. and continue.
If it worked, just install VS2015 and just remember where you put your saved reg files. If anything goes wrong, you can restore them again by running the file.
Hope this helps someone!
This worked for me:
Start procmon and run the VS installation.
In procmon, find the relevant registry by looking for:
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\*\Components"
Make sure the key you've found was successfully opened (result should be SUCCESS)
Open regedit and find the relevant Components folder.
Search for the key you have found.
Export it for backup, and then delete it.
Hope it works for you too :-)
For me, it was the mistake of installing SQL Server Management Studio 2016 before installing Visual Studio 2015. SSMS 2016 is now based of VS 2015 Shell Core. And the new setup doesn't allow for any interaction except pressing the Install button. That way, part of VS 2015 was installed to C: drive. And hence, all options to change VS 2015 Enterprise install path failed.
I removed SMSS 2016 and, explicitly, VS 2015 Shell Core and then tried to install VS 2015 and it worked with Custom Path and Browse button.
You can use junction tool by Microsoft to create a REAL directory on other partition (e.g. D:\Program Files (x86)\Microsoft Visual Studio 14.0) and make a symbol link to it as C:\Program Files (x86)..., just like the command shows below, then windows will use C:\Program Fil.. as path and the real dirs/files are in D:\Prog...
junction.exe 'C:\Program Files (x86)\Microsoft Visual Studio 14.0' 'D:\Program Files (x86)\Microsoft Visual Studio 14.0'
Download junction tool from https://technet.microsoft.com/en-us/sysinternals/bb896768.aspx
In case someone still has this problem (I had it, since I deleted my partition, on which Visual Studio was installed before):
Open the registry, go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\Setup
and there you will find some files. At least one of these files should contain the old path. Delete the file and the installation should work now.
In case there are other people who couldn't get it to work with the solutions already posted, here's what I did:
My problem was, that I had VS installed on partition E. The harddrive containing E crashed one day, and I couldn't uninstall VS properly anymore.
/uninstall /force wouldn't do the trick, since the setup would crash every time.
So I took my partition "D" and gave it the letter "E". Now I was able to install VS to the specified path. After that, I uninstalled it with /uninstall /force and the setup finished successfully.
After that I changed the partition "E" back to "D" and was able to install VS to "D".
I hope this helps someone with the same problem.
I know this is old, but just so you know there are command line switches that are very helpful for this sort of thing. In the command prompt, call your executable followed by /CustomInstallPath then the directory, as follows (adjust your executable pathname, of course, as necessary):
vs_community__e45cb735eddf4e4b9d95904be6e1ba26.exe /CustomInstallPath
Just a heads up, this didn't work for me the first time, so don't be afraid to try a couple times. I left my computer for the weekend (logged out), and ran the exact same command without doing anything else and it worked. Go figure...
In powershell:
Remove-Item
Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\CACBC777BA2175A47A35A4D7324B483D
see https://stackoverflow.com/a/33839884/3353857

Can't install Visual Studio - stuck on Visual Studio Hub Services

Now I have some big problems with installing Visual Studio Community.
These problems came when I got back to Windows 7 from Win10 (because I had some problems).
When I launched the actual Visual Studio for the first time on Win7, it loaded good, but I didn't have any templates. So I decided to reinstall it.
Uninstall went good, but when I tried to install it again, it just stopped at Microsoft Visual Studio Hub Services or something like that. It just really stopped, when I let it go, the progress bar never moved. Then it also said that it couldn't find it or something similar.
And then the fun starts. I tried to do it several times, same. Then I downloaded the Visual Studio 2013 Community, and it stopped on Build x86. Same like the Hub Services at the 2015 version. I gave up at this moment. But after that, I went angry and removed the all Visual Studio folders in the Program Files.
But later on, I found the Visual Studio 2015 Express for Desktop, I downloaded it and that time it said right at the beginning: A Prerelease version of Visual Studio Community is currently installed. Please uninstall it prior to proceeding with your current installation.
I listened to it, went to Remove and Add Programs thing (don't know what name is it in english) and yeah, there was a version of that Visual Studio I removed. I tried to uninstall it, but it just said something again: The installation source for this product is not available. Make sure that the source exists and that you can access it.. And that's basically all.
So I would like to ask, how to fix this thing. It's because of that movement from Win10 to Win7? Or because of the VS folder deletement in Program Files? Any answers are very welcome!
EDIT: Main problem is that it stops at Microsoft Visual Studio Hub Services, I managed to uninstall the 2015 Community version, but then it stops and just didn't move, the only way was to remove the process to shut down the installing window and cancel the installing.
EDIT 2: Well, kinda shy of my grammar back then, fixed some bigger mistakes.
When Visual studio is installed, several other programs get installed. So when you try to uninstall visual studio, you should uninstall all other bunch of programs which were installed along with actual visual studio(which is a bit burden). It take so much time for me to uninstall all the programs from my computer. So while re installing please make sure you uninstall all the other installed apps also.
[EDIT: you may want to scroll to the bottom for the nuclear option which I wish I'd discovered earlier!]
I've downgraded two computers from Windows 10 to 7, both with VS2015 on them. One worked and the other had its VS2015 break horribly. I also deleted the VS2015 directory and registry data that mentioned VS2015 and all sorts, and I had even more problems than you describe :) I think the difference is that I installed some new things (node.js and TypeScript) under Windows 10, and they inserted things into VS2015 which were no longer properly installed after the downgrade.
Here are my discoveries in a hopefully useful order:
When it hangs, what it's actually doing is trying to display this prompt asking you to supply the path to an installer it couldn't find.
You usually get to see these prompts if you 'Run as Administrator' the (main) installer (rather than letting it obtain Administrator privileges itself). Process Explorer helps shed light on this: if the main installer's window is associated with the child process, then the dialogues are visible. If the root process, they're not.
The prompt relates to old versions of packages that the installer wants to uninstall prior to installing a new one, and for some reason the installer doesn't know how to re-download those packages. It is usually looking under C:\ProgramData\Package Cache for them.
If you aren't seeing the dialogue, you can view logs in C:\Users\<you>\AppData\Local\Temp. Use the 'Details' view and sort this folder by date modified, to help you find the right one. Each sub-installer tends to make a new file so you may have to poke around a bit. Changing dates or file sizes also tell you that it's doing something.
Messages like this tend to be associated with the attempt to show a dialogue:
MSI (s) (24:D8) [13:00:25:033]: SOURCEMGMT: Trying source C:\ProgramData\Package Cache\{388D7468-1CCA-40C8-9F08-4C20E972E922}v14.0.25123\packages\BuildTools_MSBuildResMsi_amd64\.
MSI (s) (24:D8) [13:00:25:033]: Note: 1: 2203 2: C:\ProgramData\Package Cache\{388D7468-1CCA-40C8-9F08-4C20E972E922}v14.0.25123\packages\BuildTools_MSBuildResMsi_amd64\BuildTools_MSBuildResMsi.msi 3: -2147287037
MSI (s) (24:D8) [13:00:25:033]: SOURCEMGMT: Source is invalid due to missing/inaccessible package.
So, what to do about these missing packages?
If you have another computer with a working Visual Studio 2015 installation, you can copy the entirety of Package Cache from there to your bad computer (no need to merge folders that already exist) and that will hopefully catch many of them.
For the rest, I tried a few third-party uninstallers, and Revo Uninstaller helped. Go into its settings and enable 'Show System Components'. Then, whenever you identify a problematic package, you'll usually be able to find it in Revo Uninstaller. If you uninstall it, you'll see the usual prompt (cancel it), and after it fails, Revo's 'Moderate' registry cleanup option does the trick ('Safe' didn't). If you use the Pro version then you can multi-select and use the 'Quick Uninstall' batch option, which isn't quite automated - yes, I'm afraid it will be tedious - but with some patience, you can get through everything.
Identifying the problematic packages is still a manual process, but the good news is that you can cancel many of the prompts during a run of the installer without it aborting, so you can collect a lot of package names as you go. You can also look for patterns in version numbers; for me, a lot of them were 14.0.15123` or something like that.
For me, just one package didn't show up in Revo Uninstaller, and I searched the registry myself and deleted some occurrences. I'm not sure if that or the subsequent install of the new package was what did it, but even that one went away.
So, after all that, I'm pleased to report that Visual Studio 2015 has got through the 'Repair' operation with no further errors. I still need to reboot before I can see if it runs without a hitch...
[EDIT: Nuclear option follows]
It didn't. Many of the standard windows (code editor and error list to name a couple) failed to load with the error "An item with the same key has already been added". On the plus side, at least Visual Studio didn't suddenly exit moments after opening. So that's an improvement and 2-3 days well spent :)
After that:
I found this answer and tried the TotalUninstaller linked therein.
Then I deleted more of the installation where that uninstaller reported it couldn't delete a non-empty directory.
Then I was going to reinstall from scratch, but would you believe it - it gave me Modify/Repair/Uninstall options! So I ran the Uninstall. (Maybe Repair would have worked, who knows?)
Then I reinstalled from scratch.
There was just one more failed uninstall of an old thing (Microsoft Web Deploy), but it didn't even report a warning at the end because of it, and now my Visual Studio finally seems to be intact - fingers crossed! (I may never test that web deploy thing anyway - I mainly use it with Unity. Of course I had to install the Unity tools again.)
So yeah. I have no idea if this works by itself or if you also have to do all the other stuff. If you try it and find out, let us know.
Since you are still seeing Visual Studio in Remove and Add Programs, your environment may not be entirely clean and you will have to first completely remove Visual Studio from the system. This should be independent of whether you're using Windows 7 or 10.
You may need to do further research, but here are some initial pointers:
https://msdn.microsoft.com/en-US/library/Aa983433(v=VS.90).aspx
https://support.microsoft.com/en-us/mats/program_install_and_uninstall
Beyond trying those things and then re-attempting the install, please look for any logs generated from the failures. For example, in your %temp% folder.
In my case , I just restart the PC and after it boots up the VISUAL STUDIO 2015 will automatic come back and keep running. I did it with 2 PCs of users and with version Professional. Hope this helps.
Note : Please make sure to close all VS running on your PC before running install 2015 (in my case is VS Pro 2013) and make sure Windows updates have finished running (if they have).
Uninstall any version of visual studio 2015 you already might have installed.
Then, delete this key: I had a similiar issue and found finally as cause entries under
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\DevDiv\vs\Servicing\14.0. .

Visual Studio 2005 build problem

Cheers,
I have Microsoft VS 2005 installed (full version). And when I'm trying to build or debug my solution (with 10 projects) a windows installer window opens and says:
The feature you are trying to use is on cd-rom or other removable....
So I then put my VS2005 CD and VS does his thing and than my build and debug processes are working. But when I shut down VS and open it again and when I want again to build my solution it asks me the same thing.
I deleted VS2005 and installed it again (again full version) and it asks me the same thing. I am really crazy right now.. why VS just don't do "update" or something, I don't want to insert CD every time I start VS.
tnx
When Visual Studio was installed on your system, you might have chosen a typical installation or a custom installation that did not include everything available to it. This is appropriate in some cases (low disk space, you know only a certain subset is all that is aver or should ever be used).
Try reinstalling, and make sure its a complete install. And don't have it delete unused pieces.

Resources