Visual studio installation path grayed out

2019-01-22 01:35发布

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:

enter image description here

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?

8条回答
爷、活的狠高调
2楼-- · 2019-01-22 02:18

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.

查看更多
做自己的国王
3楼-- · 2019-01-22 02:21

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

查看更多
Anthone
4楼-- · 2019-01-22 02:23

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:

  1. If you have not uninstalled VS2015 yet, do it through Control Panel.
  2. Run the setup (ect. vs_community.exe).
  3. If you cannot install on desired drive, keep reading here :)
  4. Copy the path from where the VS2015 want you to install it on (e.g.: "D:\Programmer\Microsoft Visual Studio 14.0").
  5. Open regedit(Just press windows key, type it in, and press Enter).
  6. Warning, now you are in the windows registry, be careful or you may cause system-wide instability.
  7. 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.
  8. 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)
  9. Paste the path from step 4. here, and make sure that the 3 top boxes are checked (they should be by default).
  10. 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.
  11. 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.
  12. 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!

查看更多
Viruses.
5楼-- · 2019-01-22 02:26

This worked for me:

  1. Start procmon and run the VS installation.
  2. In procmon, find the relevant registry by looking for:

    "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\*\Components"

  3. Make sure the key you've found was successfully opened (result should be SUCCESS)

  4. Open regedit and find the relevant Components folder.
  5. Search for the key you have found.
  6. Export it for backup, and then delete it.

Hope it works for you too :-)

查看更多
手持菜刀,她持情操
6楼-- · 2019-01-22 02:30

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...

查看更多
Emotional °昔
7楼-- · 2019-01-22 02:32

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

查看更多
登录 后发表回答