United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6674101 service tag entry not added to the registry on Windows XP Professional x64 Edition
JDK-6674101 : service tag entry not added to the registry on Windows XP Professional x64 Edition

Details
Type:
Bug
Submit Date:
2008-03-11
Status:
Resolved
Updated Date:
2010-09-24
Project Name:
JDK
Resolved Date:
2008-09-12
Component:
install
OS:
windows_xp,windows
Sub-Component:
servicetags
CPU:
x86,generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
6u5,6u6
Fixed Versions:
6u10 (b24)

Related Reports
Duplicate:

Sub Tasks

Description
To reproduce:
1) Install service tag software from inventory.sun.com
2) Install 64-bit jdk on Windows XP 64bit OS. 
3) At the end of installation click Finish button to popup the
   registration. JDK is registered successfully.
4) Run CLI stclient -x to verify  the service tag entries. 
   There is no service tag entry created for the installed JDK.
   There is only one service tag for Microsoft Windows XP.

                                    

Comments
EVALUATION

The Service Tags software is a 32-bit application whose registry key is being stored in a different branch under HKEY_LOCAL_MACHINE\Software\WOW6432Node  (http://blogs.msdn.com/craigmcmurtry/archive/2004/12/14/301155.aspx).  When 64-bit JDK looks up the path of stclient, it looks up from the 64-bit Windows registry. It can't find stclient and thus didn't add a service tag for the 64-bit Windows registry.

This bug doesn't impact the product registration.  64-bit JDK on Windows is not discoverable due to this bug.

We'll fix this in JDK 6u10.
                                     
2008-03-12
SUGGESTED FIX

Here are the diffs the webrev is also attached, tested on win-x86 and win-x64

*** /tmp/geta10114	Wed Mar 12 16:39:42 2008
--- /tmp/getb10114	Wed Mar 12 16:39:42 2008
***************
*** 19,24 ****
--- 19,28 ----
  class Util {
      private static boolean verbose = (System.getProperty("servicetag.verbose") != null);
      private static String jrepath = null;
+     private static final String REGKEY_END = 
+ 	"microsoft\\windows\\currentversion\\app paths\\stclient.exe";
+     private static final String STCLIENT_END =  "Sun\\servicetag\\stclient.exe";
+     private static final String WIN32_STCLIENT = "c:\\Program Files (x86)\\" + STCLIENT_END;
  
      // for debugging and tracing
      static boolean isVerbose() {
***************
*** 198,209 ****
       * Gets the stclient path using a well known location from 
       * the Windows platform Registry, otherwise it will return null.
       */
!     static File getWindowsStClientFile() {
          File out = null;
!         String regKey = "software\\microsoft\\windows\\currentversion\\app paths\\stclient.exe";
          String keyName = "" ; // use the default  key
          String path = getRegistryKey(regKey, keyName);
- 
          if (path != null && (new File(path)).exists()) {
              out = new File(path);
          }
--- 202,214 ----
       * Gets the stclient path using a well known location from 
       * the Windows platform Registry, otherwise it will return null.
       */
!     private static File getWindowsStClientFile(boolean wow64) {
          File out = null;
!         String regKey = (wow64 == true) 
! 	    ? "software\\Wow6432Node\\" + REGKEY_END
! 	    : "software\\" + REGKEY_END;
          String keyName = "" ; // use the default  key
          String path = getRegistryKey(regKey, keyName);
          if (path != null && (new File(path)).exists()) {
              out = new File(path);
          }
***************
*** 213,218 ****
--- 218,258 ----
          return out;
      }
  
+     /**
+      * Finds a stclient in 32 and 64 bit environments, first by querying 
+      * the windows registry, if not then get the well known paths for 
+      * 64bit see http://support.microsoft.com/kb/896459 
+      */
+ 
+     static File getWindowsStClientFile() {
+     	File stclient = null;
+ 	
+ 	// try to get the default entry
+ 	stclient = getWindowsStClientFile(false);
+ 	if (stclient != null) {
+ 	    return stclient;
+ 	}
+ 
+ 	// we might be on x64, then try the wow64 area
+         stclient = getWindowsStClientFile(true);
+ 	if (stclient != null) {
+ 	    return stclient;
+ 	}
+ 
+ 	// try the default hard coded path, maybe wow64 registry is missing
+         stclient = new File(WIN32_STCLIENT);
+         if (stclient.canExecute()) {
+ 	    if (isVerbose()) {
+                 System.out.println("stclient(default)=" + stclient);
+             }
+ 	    return stclient;
+ 	}
+ 	if (isVerbose()) {
+             System.out.println("stclient not found");
+         }
+         return null;
+     }
+ 
      /**
       * This uses reflection to access a private java windows registry 
       * interface, any changes to that Class must be appropriately adjusted.
                                     
2008-03-12



Hardware and Software, Engineered to Work Together