Can't find install path if you use /adminfile to install VS and you deselect VC++

Dec 10, 2012 at 3:05 AM
Edited Dec 10, 2012 at 3:13 AM

First, thanks very much for making this.  After 16 years of using Visual Studio, I knew I wasn't going to be able to use all monochrome icons.

You may not know but you can install VS with an /adminfile option using a XML file, which lets you deselect things like  SQL Server and VC++.  I use this and deselect SQL and VC++ items which saves several GB space.

However, if you use this method without installing VC++, then when you use the "inject" command with your program, it says it can't find the install path for 2012.  If you re-run the VS setup and add VC++ back, then your program runs.

How are you looking for the install path??  Why does it depend on having VC++ installed??  Can you just let us tell you (command-line or config file) where the install path is, instead of your program guessing whether it's installed or not and giving up like it's doing now??


** Windows Server 2008 R2 x64 SP1
** Visual Studio 2012 Ultimate RTM

I have all of these registry keys:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\DevDiv\vs\Servicing\11.0\ultimate HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\DevDiv\vs\Servicing\11.0\premium HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\DevDiv\vs\Servicing\11.0\professional

Dec 14, 2012 at 4:21 PM

I also get this error and I installed VS2012 using the plain installer with no special command-line flags.

Jan 5, 2013 at 4:07 PM
Edited Jan 5, 2013 at 4:12 PM

I discovered what causes this problem for people using the "adminfile" option to install VS, and who choose not to install C++.

The patcher looks for an environment variable that only gets set if the Visual Studio "Common Tools" (C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools)  get installed, which they always do in a normal install, unless you choose to not install C++.

In helpers.cs (patcher source code), it determines the VS 2012 install path by first getting the tools path:

installPath = Environment.ExpandEnvironmentVariables("%VS110COMNTOOLS%");

Then, it goes up 2 folder levels and assumes that's the real VS 2012 install folder:

installPath = new DirectoryInfo(installPath).Parent.Parent.FullName;

A very simple solution would be to let users tell the patcher where the 2012 install path is (via config setting or command-line argument).

Mar 14, 2013 at 1:25 AM
I updated the code to do exactly this and uploaded a patch here.