OSDN Git Service

Windows 8 (Windows Developer Preview, Build 8102) temporary support
authorttp <ttp@users.sourceforge.jp>
Wed, 19 Oct 2011 15:30:47 +0000 (00:30 +0900)
committerttp <ttp@users.sourceforge.jp>
Wed, 19 Oct 2011 15:30:47 +0000 (00:30 +0900)
na-get-lib/NaGet.Packages/Platform.cs

index b70c823..47af628 100644 (file)
@@ -19,6 +19,7 @@ namespace NaGet.Packages
                WIN2003 = 152,\r
                VISTA = 160,\r
                WIN7 = 161,\r
+               WIN8 = 162,\r
        }\r
        \r
        public class Platform\r
@@ -132,6 +133,13 @@ namespace NaGet.Packages
                        }\r
                        \r
                        PlatformOSType? thisOs = GetOSType();\r
+\r
+                       // 当分の間、Windows 8 (仮称) は Windows 7 のアプリは使えるようにしておく\r
+                       if (thisOs.HasValue && thisOs.Value == PlatformOSType.WIN8) {\r
+                               return Array.BinarySearch(OsType, PlatformOSType.WIN7)\r
+                                   || Array.BinarySearch(OsType, PlatformOSType.WIN8);\r
+                       }\r
+\r
                        return thisOs != null && Array.BinarySearch(OsType, (PlatformOSType) thisOs) >= 0;\r
                }\r
                \r
@@ -175,6 +183,8 @@ namespace NaGet.Packages
                                                                return PlatformOSType.VISTA;\r
                                                        case 1:\r
                                                                return PlatformOSType.WIN7;\r
+                                                       case 2:\r
+                                                               return PlatformOSType.WIN8;\r
                                                }\r
                                        }\r
                                        break;\r