Kinook Software Forums

Kinook Software Forums (http://www.kinook.com/Forum/index.php)
-   [VBP] Third Party Tools (http://www.kinook.com/Forum/forumdisplay.php?f=3)
-   -   Make VS is using VS2005 not 2008 (http://www.kinook.com/Forum/showthread.php?t=3916)

jjkboswell 01-23-2009 10:05 AM

Make VS is using VS2005 not 2008
 
Hi,

I'm running VB6 Pro 6.2a and on one machine a Make VS step in my build script uses VS2008 correctly, and on another machine the same script incorrectly uses VS2005.

If I explicitly set the patch in the override for the build step, it works fine, but I shouldn't have to do that.

How does VB6 Pro 6.2a determine which VS version to use? Which macros does it use? As far as I can see, all my global macros are referencing Visual Studio 9.0 folders.

James

kinook 01-23-2009 10:17 AM

http://www.kinook.com/Forum/showthre...?threadid=3465

jjkboswell 01-23-2009 10:24 AM

Quote:

Originally posted by kinook
http://www.kinook.com/Forum/showthre...?threadid=3465
Ok, I'll be clearer, on the machine that works is VS2008 installed, on the machine that doesn't work (i.e. uses VS2005) I have both VS2008 and VS2005. So your statement:

"Prior to VBP v6.7, the Make VS.NET / 2005 / 2008 actions used the latest version of MSBuild.exe that was found. With VBP 6.7 and later, they use the version that matches the project or solution file being built (2.0 for VS 2005, 3.5 for VS 2008) if available."

doesn't help me because it is obviously not finding the "latest version of MSBuild.exe".

I still need to know "How does VB6 Pro 6.2a determine which VS version to use?", i.e. which macros/environment variables does it use to find VS?

James

kinook 01-23-2009 10:43 AM

1 Attachment(s)
It doesn't use macros or environment variables -- it locates the latest version of the .NET Framework containing MSBuild.exe (via some registry and directory lookups). I'm not sure why it's not finding it on one of your machines. You might try updating to VBP 6.7a or 7.0. If you update to v7 and the problem persists, submit the support information requested here http://www.kinook.com/Forum/showthre...?threadid=3044 along with the build output of the attached project. Thanks.

jjkboswell 01-23-2009 10:46 AM

Updating is not an option at the moment.

I'll have to hard code the paths. It would be helpful if you let me know the registry paths it looks in.

James

kinook 01-23-2009 10:59 AM

This is approximately how VBP 6.2a located msbuild (the logic has changed quite a bit since then):

Code:

string frameworkPath = GetDotNetFrameworkPath();
if (frameworkPath.Length > 0)
{
        string exe = Path.Combine(frameworkPath, "msbuild.exe");
        if (File.Exists(exe))
                return exe;
}

private static string GetDotNetFrameworkPath()
{
        RegistryKey k = Registry.ClassesRoot.OpenSubKey(@"CLSID\{43CD41AD-3B78-3531-9031-3059E0AA64EB}\InprocServer32");
        if (k != null)
        {
                string ver = "";
                double largest = 0.5;
                foreach (string subkey in k.GetSubKeyNames())
                {
                        RegistryKey s = k.OpenSubKey(subkey);
                        if (s != null)
                        {
                                object o = s.GetValue("RuntimeVersion");
                                if (o != null)
                                {
                                        double f = double.Parse(((string)o).Substring(1, 3));
                                        if (f > largest)
                                        {
                                                largest = f;
                                                ver = (string)o;
                                        }
                                }
                        }
                }

                if (ver.Length > 0)
                {
                        RegistryKey n = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\.NETFramework");
                        if (n != null)
                        {
                                object o = n.GetValue("InstallRoot");
                                if (o != null)
                                        return Path.Combine((string)o, ver);
                        }
                }
        }
        return "";
}



All times are GMT -5. The time now is 09:35 AM.


Copyright 1999-2019 Kinook Software, Inc.