Bug #47282 Integration with visual studio 2008 fails on install (solution provided)
Submitted: 11 Sep 2009 19:42 Modified: 6 Nov 2009 12:44
Reporter: Gert van de Venis Email Updates:
Status: Can't repeat Impact on me:
None 
Category:Connector / NET Severity:S3 (Non-critical)
Version:6.1.2 OS:Windows (Vista)
Assigned to: Vladislav Vaintroub CPU Architecture:Any
Tags: 2008, fails, integration, Visual Studio, VS2008

[11 Sep 2009 19:42] Gert van de Venis
Description:
Hi there,

I spent almost 1 and a half day searching the forums for the solution to this problem:

After installing the .net connector i couldn't get it to show up in visual studio 2008 dataprovider list. Searching the forums didn't help, so that's why i decided to take on the challenge myself. This is what i found out:

After inspecting the windows installer "mysql.data.msi" file with a little tool called "Orca", i found out that the registry value that should return the installation path of visual studio 2008 is off. E.g: The installation program refers to the following registry key: "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Setup\VS" and value: "EnvironmentDirectory"
This is incorrect! the correct valuename is "ProgramDir"!

How to repeat:
Install using the windows installer package and wheep!

Workaround for this should be obvious but i'll nevertheless provide it here: 
- Start Regedit and browse to the regkey: "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Setup\VS"
- Copy the path in the stringvalue "ProgramDir" 
- Create a new stringValue and name it "EnvironmentDirectory"
- Paste the path copied in step 1 as its value.
- Now run the installation package as you would normally and you should be set! 

Suggested fix:
Change the reference in the installer to point to the correct registryvalue e.g.: "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Setup\VS\" ValueName: "ProductDir"
[14 Sep 2009 7:47] Tonci Grgin
W2K8SEx64 registry file

Attachment: VS9reg.txt (text/plain), 1.96 KiB.

[14 Sep 2009 7:48] Tonci Grgin
Hi Gert and thanks for your report.

Even though it might appear clear to you, I'd like some more explanation...

Same registry stuff is used by all c/NET installers (just checked with Orca) and I have perfectly happy c/NET 6.0.4 on my W2K8x64 box with both VS2005Pro and VS2008Pro installed.

> This is what i found out: After inspecting the windows installer "mysql.data.msi" file with a little tool called "Orca", i found out that the registry value that should return the installation path of visual studio 2008 is off. E.g: The installation program refers to the following registry key:
"HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Setup\VS" and value:
"EnvironmentDirectory"
This is incorrect! the correct valuename is "ProgramDir"!

Well, said value works for me... Can you point me to Microsoft docs stating this is wrong?

> Install using the windows installer package and wheep!

As I said, works for me...

> "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Setup\VS\"

Now, there is *no* "ProgramDir" entry in my registry... However, being x64 box, my registry path is slightly different:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\9.0\Setup\VS
and contains "EnvironmentDirectory" (and "ProductDir" and so on, check attachment).
"EnvironmentDirectory" is pointing to IDE files location where c/NET should integrate so I do not think this is the problem in our installer but rather in your config...
[15 Sep 2009 19:35] Gert van de Venis
Well,

<QUOTE>
Now, there is *no* "ProgramDir" entry in my registry... However, being x64 box, my registry path is slightly different:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\9.0\Setup\VS
and contains "EnvironmentDirectory" (and "ProductDir" and so on, check attachment).
</QUOTE>

As i said, there is no "EnvironmentDirectory" on my computers (check attatched file). (yes i experienced this problem on two separate computers. both with Vista Home Premium SP2 NL)
To be sure i also installed the whole thing on clean install of Windows XP Pro in a vmware box, but then it suddenly worked without any trouble :-~ GRRR!

<QUOTE>
"EnvironmentDirectory" is pointing to IDE files location where c/NET should integrate so I do not think this is the problem in our installer but rather in your config...
</QUOTE>

This i don't understand. Inspecting the msi file learned me that the integration files are installed in the INSTALLDIR of the .net connector and not as you state above in the IDE Files location. The actual location of this dll on disk after installation confirms this finding, on all my installations. 

So whether my configuration is off or your installer is wrong doesn't matter imho, but it shouldn't be too hard to do a check on the existence of the "EnvironmentDirectory" or the "ProgramDir". 

Still don't understand why this location is needed though. Except from not installing it works OK without it. Can you shed some light on this maybe?
[15 Sep 2009 19:41] Gert van de Venis
Registry Exportfile VistaHomePremiumSP2NL

Attachment: regExportVS9.txt (text/plain), 2.63 KiB.

[16 Sep 2009 8:57] Tonci Grgin
Well, I am not about to argue over MS registry entries as that is completely pointless and hopeless, at least to my opinion. As you're running OS that should be supported I'll ask colleagues to take a closer look into this.
[4 Nov 2009 20:03] Vladislav Vaintroub
Well, I do not really know what do with it. On my installation(s) there is always an EnvironmentDirectory registry value that points to the place where devenv.com is located

C:\Program Files (x86)\Microsoft Visual Studio 9.0\\Common7\IDE
And, there is always ProductDir that points to 2 directory level above that
C:\Program Files (x86)\Microsoft Visual Studio 9.0\

Having a path to devenv.com is important, because as part of installation this devenv.com is executed with /setup parameter.

So the question to Gert is : are you able to reproduce it on a clean VM  with clean VS2008 installation? I currently suspect it is a glitch in VS installation, but if I can get instructions on how to repaet, I'll surely take a look.
[4 Nov 2009 20:13] Vladislav Vaintroub
The lookup for EnvironmentDirectory we use is mentioned in the blog entry of Aaron Stebner http://blogs.msdn.com/astebner/archive/2009/04/09/9541845.aspx
This blog is a very authoritative source about  VS installation "everything".
[5 Nov 2009 8:30] Gert van de Venis
Hi Vladislav,

I'm very sorry, but i can't get it reproduced on a clean installation in a clean environment (VM). However this is what i suspect:

On both the machines where i encountered the problem i did a re-installation of windows (or parts of it), while keeping the program files directory (wich is on a separate drive in both cases btw). In both cases VS was installed before the re-installation of windows. Perhaps the presence of some of the VS files on the computer at the time of its installation has something to do with this weird problem. I'm sorry i couldn't be of more help, but if i find anything i let you know.

Because i managed to work around this problem and I somehow seem to be the only person in the world having this issue, I changed the severety to non-critical...

Thanks for taking me serious and success with solving the issue ;-)
[5 Nov 2009 9:53] Vladislav Vaintroub
Gert, thanks for following up. Do you think it would be acceptable to close the problem for now, and reopen if/once you know more ( then, if you can describe the issue such that it can be reproduced on other machine, I could look to file a VS bug on Microsoft connect).

Still surprising that even after reinstall of Windows you got (at least half-)working VS. I normally expect all programs to disappear.
[6 Nov 2009 11:56] Gert van de Venis
QUOTE: "Still surprising that even after reinstall of Windows you got (at least
half-)working VS. I normally expect all programs to disappear."

Well, i do not have a standard installation of windows. I moved my userprofile directory (c:\users) and "c:\program files" folder to a separate drive, so i can easily install windows, without loosing all my settings. After re-installing windows i then re-installed VS in the same folder as before... Possibly this is the cause of the issues i have...

QUOTE: "Do you think it would be acceptable to
close the problem for now, and reopen if/once you know more" 

That would be the best thing to do right now. If i find the time i'll dive into it once more, but i doubd if it's worth the time investment... Thanks anyway for your help sofar...