NPanday
  1. NPanday
  2. NPANDAY-412

Execuable path for Windows 7 SDK is not auto-detected when npanday-settings.xml is generated, resgen.exe not found

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.4-incubating
    • Fix Version/s: 1.4-incubating
    • Component/s: Maven Plugins
    • Labels:
      None
    • Environment:

      Description

      The executable paths in npanday-settings.xml make it unnecessary to manually modify the command shell path for executables such as mcs.exe, xsd.exe, etc.

      However, resgen.exe is also needed during the NPanday project lifecycle, but is distributed with Windows SDK rather than .Net SDK. To address this, the executable path can be updated for each vendor entry to include a reference to the Window SDK location such that resgen.exe can be found via executablePath at runtime.

      When npanday-settings.xml is generated, these executablePath entries are not present, causing issues when resgen.exe cannot be located, while all the other executables can be located successfully.

      See below for an example:

      <?xml version="1.0" encoding="utf-8"?>
      <npandaySettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <operatingSystem>Microsoft Windows NT 6.1.7600.0</operatingSystem>
        <defaultSetup>
          <vendorName>MICROSOFT</vendorName>
          <vendorVersion>2.0.50727</vendorVersion>
          <frameworkVersion>2.0.50727</frameworkVersion>
        </defaultSetup>
        <vendors>
          <vendor>
            <vendorName>MICROSOFT</vendorName>
            <vendorVersion>2.0.50727</vendorVersion>
            <frameworks>
              <framework>
                <frameworkVersion>2.0.50727</frameworkVersion>
                <installRoot>C:\Windows\Microsoft.NET\Framework64\v2.0.50727</installRoot>
                <executablePaths>
                  <executablePath>C:\Program Files\\Microsoft SDKs\Windows\v6.0A\bin</executablePath>
                </executablePaths>
              </framework>
            </frameworks>
          </vendor>
      ...
        </vendors>
      </npandaySettings>
      
      1. NPANDAY-412a.patch
        2 kB
        John R. Fallows
      2. NPANDAY-412.patch
        2 kB
        Lars Corneliussen

        Issue Links

          Activity

          John R. Fallows created issue -
          Lars Corneliussen made changes -
          Field Original Value New Value
          Link This issue relates to NPANDAY-123 [ NPANDAY-123 ]
          Hide
          Lars Corneliussen added a comment -

          We have done some major changes in the current release. Still out for testing.

          Show
          Lars Corneliussen added a comment - We have done some major changes in the current release. Still out for testing.
          Hide
          Lars Corneliussen added a comment -

          On my machine this specific portion looks like this:

              <vendor>
                <vendorName>MICROSOFT</vendorName>
                <vendorVersion>2.0.50727</vendorVersion>
                <frameworks>
                  <framework>
                    <frameworkVersion>2.0.50727</frameworkVersion>
                    <installRoot>C:\Windows\Microsoft.NET\Framework64\v2.0.50727</installRoot>
                    <sdkInstallRoot>C:\Program Files\Microsoft.NET\SDK\v2.0 64bit\</sdkInstallRoot>
                    <executablePaths>
                      <executablePath>C:\Program Files\Microsoft.NET\SDK\v2.0 64bit\bin</executablePath>
                    </executablePaths>
                  </framework>
                </frameworks>
              </vendor>
          

          But how is that related to Windows 7 SDK? Windows 7 SDK only installs .NET SDK 3.5 + 4.0 (in my case 7.0a)

              <vendor>
                <vendorName>MICROSOFT</vendorName>
                <vendorVersion>3.5</vendorVersion>
                <frameworks>
                  <framework>
                    <frameworkVersion>3.5</frameworkVersion>
                    <installRoot>C:\Windows\Microsoft.NET\Framework64\v3.5</installRoot>
                    <sdkInstallRoot>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\</sdkInstallRoot>
                  </framework>
                </frameworks>
              </vendor>
              <vendor>
                <vendorName>MICROSOFT</vendorName>
                <vendorVersion>4.0</vendorVersion>
                <frameworks>
                  <framework>
                    <frameworkVersion>4.0</frameworkVersion>
                    <installRoot>C:\Windows\Microsoft.NET\Framework64\v4.0.30319</installRoot>
                    <sdkInstallRoot>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\</sdkInstallRoot>
                  </framework>
                </frameworks>
              </vendor>
          

          These are the paths we look up for .NET 2.0 in the registry. Can you check out where your key is located in the registry?

          DotnetSdkLocator.cs
          SOFTWARE\Microsoft\.NETFramework\sdkInstallRootv2.0
          SOFTWARE\Microsoft\SDKs\.NETFramework\v2.0\InstallationFolder")
          

          Codefile: https://svn.apache.org/repos/asf/incubator/npanday/trunk/plugins/netplugins/NPanday.Plugin.Settings/src/main/csharp/NPanday/Plugin/Settings/DotnetSdkLocator.cs

          Show
          Lars Corneliussen added a comment - On my machine this specific portion looks like this: <vendor> <vendorName>MICROSOFT</vendorName> <vendorVersion>2.0.50727</vendorVersion> <frameworks> <framework> <frameworkVersion>2.0.50727</frameworkVersion> <installRoot>C:\Windows\Microsoft.NET\Framework64\v2.0.50727</installRoot> <sdkInstallRoot>C:\Program Files\Microsoft.NET\SDK\v2.0 64bit\</sdkInstallRoot> <executablePaths> <executablePath>C:\Program Files\Microsoft.NET\SDK\v2.0 64bit\bin</executablePath> </executablePaths> </framework> </frameworks> </vendor> But how is that related to Windows 7 SDK? Windows 7 SDK only installs .NET SDK 3.5 + 4.0 (in my case 7.0a) <vendor> <vendorName>MICROSOFT</vendorName> <vendorVersion>3.5</vendorVersion> <frameworks> <framework> <frameworkVersion>3.5</frameworkVersion> <installRoot>C:\Windows\Microsoft.NET\Framework64\v3.5</installRoot> <sdkInstallRoot>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\</sdkInstallRoot> </framework> </frameworks> </vendor> <vendor> <vendorName>MICROSOFT</vendorName> <vendorVersion>4.0</vendorVersion> <frameworks> <framework> <frameworkVersion>4.0</frameworkVersion> <installRoot>C:\Windows\Microsoft.NET\Framework64\v4.0.30319</installRoot> <sdkInstallRoot>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\</sdkInstallRoot> </framework> </frameworks> </vendor> These are the paths we look up for .NET 2.0 in the registry. Can you check out where your key is located in the registry? DotnetSdkLocator.cs SOFTWARE\Microsoft\.NETFramework\sdkInstallRootv2.0 SOFTWARE\Microsoft\SDKs\.NETFramework\v2.0\InstallationFolder") Codefile: https://svn.apache.org/repos/asf/incubator/npanday/trunk/plugins/netplugins/NPanday.Plugin.Settings/src/main/csharp/NPanday/Plugin/Settings/DotnetSdkLocator.cs
          Lars Corneliussen made changes -
          Assignee Lars Corneliussen [ lcorneliussen ]
          Fix Version/s 1.3.1-incubating [ 12316271 ]
          Lars Corneliussen made changes -
          Link This issue is part of NPANDAY-123 [ NPANDAY-123 ]
          Lars Corneliussen made changes -
          Link This issue relates to NPANDAY-123 [ NPANDAY-123 ]
          Hide
          John R. Fallows added a comment -

          Although I had .Net v2.0.50727 (runtime) and .Net 3.5SP1 (runtime and SDK) installed, I did not have .Net v2.0.50727 (SDK) installed, which contains the missing resgen.exe. Neither of the two registry keys listed above were present in my system.

          Note: just as a point of information, ResGen.exe is also distributed with the Windows 7 SDK.

          C:\Users\jfallows>dir "C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\ResGen.exe
           Directory of C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin
          
          11/07/2007  12:01 PM            62,456 ResGen.exe
          

          However, the recommendation to use .Net 2.0 instead seems better, and ResGen.exe was installed as part of the .Net v2.0.50727 SDK from http://www.microsoft.com/downloads/en/details.aspx?FamilyID=FE6F2099-B7B4-4F47-A244-C96D69C35DEC.

          C:\Users\jfallows>dir "C:\Program Files (x86)\Microsoft.NET\SDK\v2.0\Bin\ResGen.exe"
           Volume in drive C has no label.
           Volume Serial Number is DC46-219D
          
           Directory of c:\Program Files (x86)\Microsoft.NET\SDK\v2.0\Bin
          
          09/23/2005  06:56 AM            49,152 ResGen.exe
          

          After installing .Net v2.0.50727, the automatically regenerated npanday-settings.xml did not automatically include the path references to the newly installed .Net v2.0.50727 SDK either.

          Finally, I rebuilt NPanday trunk in an Administrator VS2008 command prompt to make sure I have the absolute latest code executing to generate npanday-settings.xml.

          The automatically regenerated npanday-settings.xml still did not contain any path references to the v2.0 SDK. Therefore this caused a build failure when resgen.exe could not be located.

          In order to get everything working again, I needed to manually add the v2.0 SDK path (as shown below) allowing resgen.exe to be located successfully.

          <?xml version="1.0" encoding="utf-8"?>
          <npandaySettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            <operatingSystem>Microsoft Windows NT 6.1.7600.0</operatingSystem>
            <defaultSetup>
              <vendorName>MICROSOFT</vendorName>
              <vendorVersion>2.0.50727</vendorVersion>
              <frameworkVersion>2.0.50727</frameworkVersion>
            </defaultSetup>
            <vendors>
              <vendor>
                <vendorName>MICROSOFT</vendorName>
                <vendorVersion>2.0.50727</vendorVersion>
                <frameworks>
                  <framework>
                    <frameworkVersion>2.0.50727</frameworkVersion>
                    <installRoot>C:\Windows\Microsoft.NET\Framework64\v2.0.50727</installRoot>
                    <executablePaths>
                      <executablePath>c:\Program Files (x86)\Microsoft.NET\SDK\v2.0\Bin</executablePath>
                    </executablePaths>
                  </framework>
                </frameworks>
              </vendor>
              <vendor>
                <vendorName>MICROSOFT</vendorName>
                <vendorVersion>3.0</vendorVersion>
                <frameworks>
                  <framework>
                    <frameworkVersion>3.0</frameworkVersion>
                    <installRoot>C:\Windows\Microsoft.NET\Framework64\v3.0</installRoot>
                    <executablePaths>
                      <executablePath>C:\Windows\Microsoft.NET\Framework64\v2.0.50727</executablePath>
                      <executablePath>c:\Program Files (x86)\Microsoft.NET\SDK\v2.0\Bin</executablePath>
                    </executablePaths>
                  </framework>
                </frameworks>
              </vendor>
              <vendor>
                <vendorName>MICROSOFT</vendorName>
                <vendorVersion>3.5</vendorVersion>
                <frameworks>
                  <framework>
                    <frameworkVersion>3.5</frameworkVersion>
                    <installRoot>C:\Windows\Microsoft.NET\Framework64\v3.5</installRoot>
                    <executablePaths>
                      <executablePath>C:\Windows\Microsoft.NET\Framework64\v2.0.50727</executablePath>
                      <executablePath>c:\Program Files (x86)\Microsoft.NET\SDK\v2.0\Bin</executablePath>
                    </executablePaths>
                  </framework>
                </frameworks>
              </vendor>
            </vendors>
          </npandaySettings>
          

          Searching the registry did not produce any keys that would indicate the install root for the v2.0 SDK.

          Show
          John R. Fallows added a comment - Although I had .Net v2.0.50727 (runtime) and .Net 3.5SP1 (runtime and SDK) installed, I did not have .Net v2.0.50727 (SDK) installed, which contains the missing resgen.exe. Neither of the two registry keys listed above were present in my system. Note: just as a point of information, ResGen.exe is also distributed with the Windows 7 SDK. C:\Users\jfallows>dir "C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\ResGen.exe Directory of C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin 11/07/2007 12:01 PM 62,456 ResGen.exe However, the recommendation to use .Net 2.0 instead seems better, and ResGen.exe was installed as part of the .Net v2.0.50727 SDK from http://www.microsoft.com/downloads/en/details.aspx?FamilyID=FE6F2099-B7B4-4F47-A244-C96D69C35DEC . C:\Users\jfallows>dir "C:\Program Files (x86)\Microsoft.NET\SDK\v2.0\Bin\ResGen.exe" Volume in drive C has no label. Volume Serial Number is DC46-219D Directory of c:\Program Files (x86)\Microsoft.NET\SDK\v2.0\Bin 09/23/2005 06:56 AM 49,152 ResGen.exe After installing .Net v2.0.50727, the automatically regenerated npanday-settings.xml did not automatically include the path references to the newly installed .Net v2.0.50727 SDK either. Finally, I rebuilt NPanday trunk in an Administrator VS2008 command prompt to make sure I have the absolute latest code executing to generate npanday-settings.xml. The automatically regenerated npanday-settings.xml still did not contain any path references to the v2.0 SDK. Therefore this caused a build failure when resgen.exe could not be located. In order to get everything working again, I needed to manually add the v2.0 SDK path (as shown below) allowing resgen.exe to be located successfully. <?xml version= "1.0" encoding= "utf-8" ?> <npandaySettings xmlns:xsi= "http: //www.w3.org/2001/XMLSchema-instance" xmlns:xsd= "http://www.w3.org/2001/XMLSchema" > <operatingSystem>Microsoft Windows NT 6.1.7600.0</operatingSystem> <defaultSetup> <vendorName>MICROSOFT</vendorName> <vendorVersion>2.0.50727</vendorVersion> <frameworkVersion>2.0.50727</frameworkVersion> </defaultSetup> <vendors> <vendor> <vendorName>MICROSOFT</vendorName> <vendorVersion>2.0.50727</vendorVersion> <frameworks> <framework> <frameworkVersion>2.0.50727</frameworkVersion> <installRoot>C:\Windows\Microsoft.NET\Framework64\v2.0.50727</installRoot> <executablePaths> <executablePath>c:\Program Files (x86)\Microsoft.NET\SDK\v2.0\Bin</executablePath> </executablePaths> </framework> </frameworks> </vendor> <vendor> <vendorName>MICROSOFT</vendorName> <vendorVersion>3.0</vendorVersion> <frameworks> <framework> <frameworkVersion>3.0</frameworkVersion> <installRoot>C:\Windows\Microsoft.NET\Framework64\v3.0</installRoot> <executablePaths> <executablePath>C:\Windows\Microsoft.NET\Framework64\v2.0.50727</executablePath> <executablePath>c:\Program Files (x86)\Microsoft.NET\SDK\v2.0\Bin</executablePath> </executablePaths> </framework> </frameworks> </vendor> <vendor> <vendorName>MICROSOFT</vendorName> <vendorVersion>3.5</vendorVersion> <frameworks> <framework> <frameworkVersion>3.5</frameworkVersion> <installRoot>C:\Windows\Microsoft.NET\Framework64\v3.5</installRoot> <executablePaths> <executablePath>C:\Windows\Microsoft.NET\Framework64\v2.0.50727</executablePath> <executablePath>c:\Program Files (x86)\Microsoft.NET\SDK\v2.0\Bin</executablePath> </executablePaths> </framework> </frameworks> </vendor> </vendors> </npandaySettings> Searching the registry did not produce any keys that would indicate the install root for the v2.0 SDK.
          Hide
          Lars Corneliussen added a comment -

          Hi,

          ok. Then I'll add theese paths for finding the .NET 2 SDK (first containing xsd wins):

          %ProgramFiles(x86)%\Microsoft.NET\SDK\v2.0
          %ProgramFiles%\Microsoft.NET\SDK\v2.0
          

          Do you have other SDKs installed in c:\Program Files (x86)\Microsoft.NET\SDK?

          Show
          Lars Corneliussen added a comment - Hi, ok. Then I'll add theese paths for finding the .NET 2 SDK (first containing xsd wins): %ProgramFiles(x86)%\Microsoft.NET\SDK\v2.0 %ProgramFiles%\Microsoft.NET\SDK\v2.0 Do you have other SDKs installed in c:\Program Files (x86)\Microsoft.NET\SDK?
          Hide
          John R. Fallows added a comment -

          Just v2.0.

          Show
          John R. Fallows added a comment - Just v2.0.
          Lars Corneliussen made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Hide
          Lars Corneliussen added a comment -

          Its to late. I have to go to bed.
          Could you try this patch?

          We already updated the groupId from 'npanday.' to 'org.apache.npanday.' - so you have to run the bootstrap commands again, when building from trunk.

          Show
          Lars Corneliussen added a comment - Its to late. I have to go to bed. Could you try this patch? We already updated the groupId from 'npanday. ' to 'org.apache.npanday. ' - so you have to run the bootstrap commands again, when building from trunk.
          Lars Corneliussen made changes -
          Attachment NPANDAY-412.patch [ 12478002 ]
          Hide
          John R. Fallows added a comment -

          After making a few minor changes to the patch (NPANDAY-412a attached), the build successfully detects resgen.exe as desired. I thought it best for you to review the changes first, rather than me checking in directly.

          Show
          John R. Fallows added a comment - After making a few minor changes to the patch ( NPANDAY-412 a attached), the build successfully detects resgen.exe as desired. I thought it best for you to review the changes first, rather than me checking in directly.
          John R. Fallows made changes -
          Attachment NPANDAY-412a.patch [ 12478025 ]
          Lars Corneliussen made changes -
          Comment [ I can't see a difference in the two patches attatched... ]
          Hide
          Lars Corneliussen added a comment -

          I'll apply the patch now.

          Show
          Lars Corneliussen added a comment - I'll apply the patch now.
          Hide
          Lars Corneliussen added a comment -

          Fixed in trunk

          Show
          Lars Corneliussen added a comment - Fixed in trunk
          Lars Corneliussen made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]

            People

            • Assignee:
              Lars Corneliussen
              Reporter:
              John R. Fallows
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development