How to change Visual Studio 2012 install directory?
Asked Answered
P

10

38

I've uninstalled VS11 using the the windows installer, and deleted just about every registry key I could find relating to it, but it still pops up with this when I try to reinstall it:

And I can't click the "..." or edit the path. Right-clicking does nothing either.

What do I have to destroy to change the install directory?


Still happening in official release:

Poachy answered 9/4, 2012 at 4:46 Comment(0)
J
50

I had the same problem though instead of forcing me to install into "c:\program Files" it forced me to install to the directory which I used for the Visual Studio RC. After using Process Monitor and the setup's logfile I was able to find a registry key that needed to be deleted.

The key was located at

HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-21-776561741-789336058-725345543-318838\Components\31F687BD8A467D54C830E018D99F7F3B

The SID will most likely be different for other systems yet you might be able to find the last string (31F687BD8A467D54C830E018D99F7F3B)


In order to find the key I did the following:

  1. Downloaded ProcessMonitor from Sysinternals
  2. Started Processmonitor with filter

    Image Path ends with vs_premium.exe

  3. Started vs_premium.exe

  4. Closed the setup
  5. Waited until Processmonitor didn't fetch anymore events
  6. Opened the newest dd_vs_premium_.log file from %TEMP%
  7. Searched for something and found

    Condition 'VS_Install_path_KeyExists' evaluated to false. (i guess it will evaluate to true on affected systems. I tried this on a clean windows installation)

  8. One line above it said

    Registry key not found. Key = 'SOFTWARE\Microsoft\VisualStudio\SxS\VS7'

  9. Searched for

    Microsoft\VisualStudio\SxS\VS7

    in Processmonitor

  10. A few lines down ProcessMonitor shows me the key I had to delete

Jewelljewelle answered 28/8, 2012 at 15:11 Comment(13)
Last key doesn't exist...how'd you find that one? I've got hundreds in here.Poachy
Your process isn't very clear. I'm assuming you mean this program. If the first "filter" didn't find anything, why mention it? What do you mean "searched for 'Microsoft\VisualStudio\SxS\VS7'"? Searched for how? Filter? By what? Do I need to "add the item"?Poachy
Yes, i mean this. You add filters by using Ctrl+L, selecting the mentioned settings and clicking "add". You search for "Microsoft\VisualStudio\SxS\VS7" with Ctrl+F.Jewelljewelle
Now I understand what you mean. My key was a bit different, and it was in the S-1-5-18 folder; it couldn't find the one in the longer-named one. That's a neat tool, I learned a bunch. Thanks for writing that out.Poachy
I found the key exactly where you said it was Nick. I gotto ask, how the heck did you manage to locate this key and recognize it for what it is???Reitman
Worked great by following your instructions. My key was in the S-1-15-18 folder in the registry. Great tip, learned something new!Judicial
Worked for me too! I just ctrl+f in the regedit for 31F687BD8A467D54C830E018D99F7F3B and deleted the keysTiffaneytiffani
@NickPapagiorgio How did you know which key to delete on ProcessMonitor?Gaea
I didn't really know it. I just assumed it and I was lucky that my assumption was right.Jewelljewelle
In my case the registry key had several values that all pointed to the default path of C:\Program Files (x86)\Microsoft Visual Studio 12.0.Toxinantitoxin
OMG Thank you so much. My VS was borked. I tried to install on an external drive, and that drive got removed from my system... All is good now :)Ferrocyanide
@NickPapagiorgio I tried this for VS 2015 but I can't find the right key, would you mind taking a look? Also thank you for the answer it is very helpful I just can't quite find the right key.Nonillion
The component ID for Visual Studio Enterprise 2015 is CACBC777BA2175A47A35A4D7324B483D.Pottage
N
8

A simpler approach worked for me:

1 - Run the installer from the command line, with /uninstall /force switches, as in:

c:\vs_professional_ENU.exe /uninstall /force

2 - Re-run the installer normally.

I did this with VS2015 under Windows 10. Reference link.

Nitrification answered 17/2, 2016 at 18:26 Comment(0)
K
6

The only solution I've found is on Windows 7 to create a hard Junction link to the directory your wanting Visual Studio installed to.

For Example, My SSD drive is not my boot drive and has a drive letter of B:.

I run the following command line

mklink /J "C:\Program Files (x86)\Microsoft Visual Studio 11.0" "B:\Program Files (x86)\Microsoft Visual Studio 11.0"

To the installer and Windows it thinks it installed it to the Program Files x86 directory on C: drive when it really installed it to the Program Files x86 folder on B: drive.

Here's a link to page about creating Junction links in Windows Vista and 7. http://www.howtogeek.com/howto/windows-vista/using-symlinks-in-windows-vista/

Keikokeil answered 4/5, 2012 at 19:54 Comment(5)
Warning: Visual Studio 2012 updates don't understand this. So installing an update will delete the link and seems to break Visual Studio.Coopery
You are correct @Tuomas. I have to merge the updates into the correct location and the re-create the directory link.Keikokeil
What exactly do you mean by "break Visual Studio"? Do you just mean that the junction will be deleted or that it corrupt your drive? Cuz I'm fine with an update not installing, but if I could be spontaneously left with a useless 8 gigabytes of Visual Studio on my drive with no discernible reason as to what went happened, I'm gonna have to stay away from hard links like they're radioactive.Baribaric
@Baribaric - The answer is in the previous 2 comments. The junction link will be deleted. So you will have to create a new junction link. You really should slow down and read all the information.Keikokeil
Junction doesn't work on MSVS 2022 any more , it results in strange errors inside visual studio like : "The Global Hub Client Package didn’t load correctly." developercommunity.visualstudio.com/t/…Emma
F
4

I dont have the rep to comment on the post above. Although he is correct in the syntax of those command switches, the program is bugged, it doesnt work with selecting the CustomInstallPath. In fact, for me, it just decides to open about 50+ iterations of vs_ultimate.exe in the process list...

I will try the Hard Junction as mentioned above as I am sure that will work.

As a sidenote, if anyone is interested, you can use the switch that allows you to acquire the installation ahead of time by running vs_ultimate.exe /Layout X:\somefolder\

I did that last night and hopefully my installation will go quickly since i havea ll the info, however I think in order to force it to use the offline version, you have to run vs_ultimate.exe /noweb.

This page refers to all the switches: http://msdn.microsoft.com/en-us/library/e2h7fzkw(v=vs.110).aspx

The above pages notes that: /p CustomInstallPath "Installs all re-targetable packages in the directory that you specify." Thay may mean that silently, whatever it is able to install off of your root drive, it will, but its hard to be certain and I have limited space on my SSD.

Before I try the hard junction, I may also try the above and see what heppens, then uninstall it if need be. Will post results

Fore answered 9/6, 2012 at 23:51 Comment(1)
As a followup to the above, I can confirm that setting the CustomInstallPath parameter does not do anything. I had figured it was possible (after reading the article linked above) that some of the install would go the the custom directory but it didnt. I uninstalled and did the juntion with success. However there must be many common files that are installed in your windows directory because this only saved me 2.78 Gigs [approx.]Fore
C
3

Try launching the installer with the following option:

/p CustomInstallPath="[your_path]"

For example:

vs_ultimate.exe /p CustomInstallPath="C:\MyDirectory"

To see all options use the switch /?

Chud answered 4/5, 2012 at 19:19 Comment(1)
Seems like there is a bug in the current version of the installer. Hopefully they'll fix that.Boneblack
M
1

For me the final visual studio 2012 wanted to install into the same path as the (uninstalled) beta. I deleted most of the stuff in HKLM that had an exact match for the setup directory (ending with a \ e.g. C:\VS11Beta\) and then the setup let me choose again.

Probably not a solution for the OP(M:\Program Files sounds too generic to delete), but perhaps for others with this problem.

Mechanical answered 29/8, 2012 at 13:55 Comment(1)
Yeah... I tried the same thing and went on a rampage deleting keys, but I never found the right one.Poachy
P
1

I had previously installed the VS 2012 Test Controller. Uninstalling it allowed me to change the install path.

Provided answered 2/5, 2013 at 3:30 Comment(0)
T
1

How to change Visual Studio 2012 install directory? What do I have to destroy to change the install directory?

Answer: You can change the physical directory without the need to "destroy or change" the install directory. This is an alternative "think smarter not harder" solution proposal.

Here are the specific material details you need to continue to use your logical M:\Program Files directory and solve the physical where the files are stored problem.

It also serves the rest of the community well for cleaner more reproducible installs, less effort and risk when using Beta builds. Its less risk because it encapsulates every file in the beta install. Want to go from beta to RC, no problem, just don't mount the beta drives, use an off the shell registry cleaner and reinstall clean to fresh drives every time.

The process uses PGP disks which can be logged in and logged out of / backed up as needed.

Initially, it seemed as though it would be possible to create just two drives. not so. - Drive #1 mounted as F:\ for f:\Program Files (x86)\Microsoft Visual Studio 11.0 This is where I told Visual Studio setup to install files to. And it does function as a mountable container for 2.7 Gigs of files.

  • Drive #2 mounted as a folder on "C:\Program Files (x86)\" "Microsoft Visual Studio 11.0" The intended purpose of the mounted folder was to collect up the remainder of 5.5 Gigs of files.

The actual list of 33 created folders I had to move to additional PGP folders.

Here is the inclusive list of folders you can create before setup deploys files to them.

C:\Program Files\Microsoft SQL Server
C:\Program Files\Microsoft SQL Server Compact Edition
C:\Program Files\Application Verifier
C:\Program Files\MSBuild
C:\Program Files\Microsoft
C:\Program Files\IIS Express
C:\Program Files\IIS
C:\Program Files\Microsoft Visual Studio 11.0

C:\Program Files (x86)\IIS
C:\Program Files (x86)\IIS Express

C:\Program Files (x86)\Microsoft ASP.NET
C:\Program Files (x86)\Microsoft Help Viewer
C:\Program Files (x86)\Microsoft SDKs
C:\Program Files (x86)\Microsoft SQL Server
C:\Program Files (x86)\Microsoft SQL Server Compact Edition
C:\Program Files (x86)\Microsoft WCF Data Services
C:\Program Files (x86)\Microsoft Web Tools
C:\Program Files (x86)\MSBuild
C:\Program Files (x86)\NuGet
C:\Program Files (x86)\Windows Kits

C:\Program Files (x86)\Common Files\Merge Modules
C:\Program Files (x86)\Common Files\Microsoft
C:\Program Files (x86)\Common Files\microsoft shared\DevServer
C:\Program Files (x86)\Common Files\microsoft shared\MSDesigners8
C:\Program Files (x86)\Common Files\microsoft shared\MSEnv
C:\Program Files (x86)\Common Files\microsoft shared\MSI Tools
C:\Program Files (x86)\Common Files\microsoft shared\SQL Debugging
C:\Program Files (x86)\Common Files\microsoft shared\SQL Server Developer Tools
C:\Program Files (x86)\Common Files\microsoft shared\TextTemplating
C:\Program Files (x86)\Common Files\microsoft shared\Visual Database Tools
C:\Program Files (x86)\Common Files\microsoft shared\VS7Debug
C:\Program Files (x86)\Common Files\microsoft shared\WF
C:\Program Files (x86)\Common Files\microsoft shared\Windows Simulator

This is perfect to prevent; - Patch managers and patch management systems which inadvertently & unsupervised unmonitored, unaudited in willful ignorant bliss violate the premise of good promotion to production change control best practices

  • Developers who's code mostly works by random chance and really have no idea whats in the final product.

  • Hacker exploitation of the build environment.

Could have used True Crypt or PGP desktop. Just not whole disk encryption, have to be able to mount and unmount the resources.

I appreciate the hard junction approach, but unless you Safely ejecting & power off drives, it offers little process compliance and is neither safe or reliable as compared to safe PGP un-mounting/mounting. Developers will just power on the drives and make changes.

Regarding level of efforts to backup and restore, Backing up PGP drives as compared to hard junctioned drives is a wash about the same level of effort. But the value in not having to remember which folders are junctioned, which might need restored to restore a dev environment favors the fewer number of .PGD drives which contain all the needed folders ( ie do the remembering for you as a part of their function)

Consider this as an environment for when requirements are for mandatory non discretionary absolute auditable surety for a reproducible secure build. To meet that core objective, it has to be available only when its actually "needed" and has to be secured when its not needed.

Teleview answered 14/10, 2013 at 2:20 Comment(0)
P
0

Look into your installed programs and see if an instance of Visual Studio is already installed if so delete it and re-run the set up.

Pastille answered 5/8, 2014 at 9:23 Comment(0)
E
0

For this who still looking for a solution, What I tried and learned from this issue is that while "normal" (from control Panel) uninstall not every signatures of VS is not getting removed. So we have force uninstall from command line to remove all VS footprints. I have found the following answer in stack overflow very useful for me.

Run installer in command line (Admin) with argument:

vs_community_ENU.exe /uninstall /force

Then:

run vs_community_ENU.exe (or professional/enterprise).

How to install Visual Studio 2015 on a different drive

Esker answered 9/3, 2019 at 19:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.