JDK-6527545 : Add suport for more fine grained OS values on windows (Windows XP, Windows Vista, etc.)
  • Type: Enhancement
  • Component: deploy
  • Sub-Component: webstart
  • Affected Version: 6
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2007-02-22
  • Updated: 2011-04-21
  • Resolved: 2010-12-06
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7 b121Fixed
Related Reports
Relates :  
Description
Java Web Start recognizes as "os" only the values "Windows, SunOS, and linux".
It considers anything a match if the value of os is either null, or the return value of Config.getOSName() starts with that string., and Config.getOSName() returns just "Windows" for any windows os. - therefore, any value in the jnlp file will match if it starts with "Windows"
However, the native core requires an exact match, so resources are only considered if they say explicitly "Windows"

Since applications may need to provide differant resources for "Windows XP", 
"Windows Vista", etc, we should change behavior to match any windows platform if just "Windows" is specified, and to only match specific platform if, for example "Windows XP" is specified.
(both in native and java code, and for normal resources and for the jre.)
Java Web Start recognizes as "os" only the values "Windows, SunOS, and linux".
It considers anything a match if the value of os is either null, or the return value of Config.getOSName() starts with that string., and Config.getOSName() returns just "Windows" for any windows os. - therefore, any value in the jnlp file will match if it starts with "Windows"
However, the native core requires an exact match, so resources are only considered if they say explicitly "Windows"

Since applications may need to provide differant resources for "Windows XP", 
"Windows Vista", etc, we should change behavior to match any windows platform if just "Windows" is specified, and to only match specific platform if, for example "Windows XP" is specified.
(both in native and java code, and for normal resources and for the jre.)
note - the above discription is wrong and the implementation was fixed by bug #7014170

in implementing CR6527545, we forgot another line from the JNLP spec:

    "For the os, arch, and locale attributes several keys can be specified separated with spaces. A space that is part of a key must be preceded with a backslash (\). For example, Windows\ 95 Windows\ 98 specifies the two keys Windows 95 and Windows 98. "

Comments
EVALUATION We will add Config.getOSFullName method for the full value of os.name system property. Introducing separate new method help avoid the risk of disturbing current usage of Config.getOSName. The JNLP 6.0 specs. has specified the semantics of attribute 'os': "os attribute: Specifies the operating system for which the resources element should be considered. If the value is a prefix of the os.name system property, then the resources element can be used. If the attribute is not specified, it matches all operating systems." So we could simply avoid parsing 'os' attribute value into multiple prefixes. Simply take the whole value as a prefix to check against Config.getOSFullName().
17-11-2010

EVALUATION The problem is XMLFormat uses Config.getOSName() which returns just "Win". That is then compared to the jnlp file's given os values, if any of them start with "Win" they will match. Instead, the comparison should be the other way around, compared to the full OS name. if the full OS name ("Windows XP" or "Windows 7") starts with any of the given values, then it is a match. Then a given value of "Win" or "Windows" will match any window OS, but a given value of "Windows XP" will not match on "Windows 7" but will match on "Windows XP Professional". However problem is deeper. Currently the value of an "os" attribute a jnlp file is a space seperated list of os values, so a value of "Windows XP" is treated as 2 possible values, "Windows" and "XP", even if we use the appropriate encoding: os="Windows XP" our code in XMLUtils.getAttribute will decode too soon and we will still have multiple values "Windows" and "XP".
09-11-2010