Bug in w32_getreg.c

Added by Philipp Teschner about 10 years ago

Currently w32_getreg only works if you are looking up HKEY_LOCAL_MACHINE keys. Otherwise it goes into an infinite loop:

    while (keydefs->keyname) {
        if (!strcmp(pathlist->string, keydefs->keyname)) {
            key = keydefs->keyval;
            pathlist = list_next(pathlist);
            break;
        }
    }

Should be something like:

    while (keydefs->keyname) {
        if (!strcmp(pathlist->string, keydefs->keyname)) {
            key = keydefs->keyval;
            pathlist = list_next(pathlist);
            break;
        }
        ++keydefs;
    }

    if (!keydefs->keyname) return 0;

I found this while trying to get JamPlus working with the Visual Studio 2010 beta which seems to have moved the install directory registry setting to: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0_Confg\InstallDir. At least this seems to be true on Windows 7.

Phil


Replies (5)

RE: Bug in w32_getreg.c - Added by Joshua Jensen about 10 years ago

Thanks for the patch! I have applied it to the current build.

If you feel so inclined, I would love to integrate the Visual Studio 2010 updates you are making. If not, I'll be downloading the beta in the near future, and I'll bring JamPlus (and Workspace Whiz) up on it then.

Josh

RE: Bug in w32_getreg.c - Added by Philipp Teschner about 10 years ago

I am away from the system that has the changes on it right now. Once I get back (Wednesday) I can send you the modifications I made.

It turns out that the registry location for Visual Studio 2010 hasn't changed but the current jmake and jambase code does not work correctly for 64-bit windows systems. On 64-bit systems the registry location for all Visual Studio installations is:

HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\VisualStudio\[Version]\InstallDir

On top of that the jmake.cmd file had some problems with the (x86) in the install path. I fixed both of those issues and jam now bootstraps correctly on 64-bit machines as well.

Other than that I just had to add rules for vs2010 anywhere that I saw vs2008 in the jamebase and rules files. Once I did that everything seemed to work. I did not do any work on generating the new project files though.

Phil

RE: Bug in w32_getreg.c - Added by Joshua Jensen about 10 years ago

That's odd. I'm running Windows 7 64-bit, and I am not having any issues.

Are you using JamPlus 0.3 or the latest Git (or nightly) build?

Josh

RE: Bug in w32_getreg.c - Added by Philipp Teschner about 10 years ago

I am using JamPlus 0.3. When I run jmake.cmd I get the following error on any of my 64-bit installations (i.e. with Visual Studio installed in "C:\Program Files (x86)\...")

>jmake.cmd
\Microsoft was unexpected at this time.

I received that error on 3 of my 4 test machines:

  • Windows 7 64-bit (Visual Studio 2010)
  • Windows Vista 64-bit (Visual Studio 2010 & 2008)
  • Windows XP 64-bit (Visual Studio 2005)

It ran perfectly fine on my 32-bit machine:

  • Windows XP 32-bit (Visual Studio 2005)

The "fixed" jmake.cmd file simply includes more use of the quote character so that the path isn't prematurely expanded. Once compiled the rest of jam seems to hum along just nicely.

jmake-update.cmd - Updated jmake.cmd file for 64-bit machines. Note I added an option for for verbose output (/v or /V) for my own debugging purposes probably not needed in general. (3.47 KB)

Jambase.jam - The small amount of changes I had to get the tests to compile under VS 2010 (63.5 KB)

RE: Bug in w32_getreg.c - Added by Joshua Jensen about 10 years ago

Thank you for the updates! I have applied them to the master branch.

Josh

(1-5/5)