Changeset 94079 in vbox for trunk/src/VBox/Main/src-server
- Timestamp:
- Mar 3, 2022 5:10:36 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/UnattendedImpl.cpp
r94078 r94079 442 442 { 443 443 DETECTBUFFER uBuf; 444 VBOXOSTYPE enmOsType = VBOXOSTYPE_Unknown;445 HRESULT hrc = i_innerDetectIsoOSWindows(hVfsIso, &uBuf , &enmOsType);446 if (hrc == S_FALSE && enmOsType == VBOXOSTYPE_Unknown)447 hrc = i_innerDetectIsoOSLinux(hVfsIso, &uBuf , &enmOsType);448 if (hrc == S_FALSE && enmOsType == VBOXOSTYPE_Unknown)449 hrc = i_innerDetectIsoOSOs2(hVfsIso, &uBuf , &enmOsType);450 if ( enmOsType != VBOXOSTYPE_Unknown)451 { 452 try { mStrDetectedOSTypeId = Global::OSTypeId( enmOsType); }444 mEnmOsType = VBOXOSTYPE_Unknown; 445 HRESULT hrc = i_innerDetectIsoOSWindows(hVfsIso, &uBuf); 446 if (hrc == S_FALSE && mEnmOsType == VBOXOSTYPE_Unknown) 447 hrc = i_innerDetectIsoOSLinux(hVfsIso, &uBuf); 448 if (hrc == S_FALSE && mEnmOsType == VBOXOSTYPE_Unknown) 449 hrc = i_innerDetectIsoOSOs2(hVfsIso, &uBuf); 450 if (mEnmOsType != VBOXOSTYPE_Unknown) 451 { 452 try { mStrDetectedOSTypeId = Global::OSTypeId(mEnmOsType); } 453 453 catch (std::bad_alloc &) { hrc = E_OUTOFMEMORY; } 454 454 } … … 571 571 * @endverbatim 572 572 * 573 * Will update mOSType as well as setting mVersion on success.573 * Will update mOSType, mEnmOsType as well as setting mVersion on success. 574 574 * 575 575 * @param pNode Points to the vesion XML node, … … 621 621 * Convert that to a version windows OS ID (newest first!). 622 622 */ 623 VBOXOSTYPE enmVersion= VBOXOSTYPE_Unknown;623 image.mEnmOsType = VBOXOSTYPE_Unknown; 624 624 if (RTStrVersionCompare(image.mVersion.c_str(), "10.0.22000.0") >= 0) 625 enmVersion= VBOXOSTYPE_Win11_x64;625 image.mEnmOsType = VBOXOSTYPE_Win11_x64; 626 626 else if (RTStrVersionCompare(image.mVersion.c_str(), "10.0") >= 0) 627 enmVersion= VBOXOSTYPE_Win10;627 image.mEnmOsType = VBOXOSTYPE_Win10; 628 628 else if (RTStrVersionCompare(image.mVersion.c_str(), "6.3") >= 0) 629 enmVersion= VBOXOSTYPE_Win81;629 image.mEnmOsType = VBOXOSTYPE_Win81; 630 630 else if (RTStrVersionCompare(image.mVersion.c_str(), "6.2") >= 0) 631 enmVersion= VBOXOSTYPE_Win8;631 image.mEnmOsType = VBOXOSTYPE_Win8; 632 632 else if (RTStrVersionCompare(image.mVersion.c_str(), "6.1") >= 0) 633 enmVersion= VBOXOSTYPE_Win7;633 image.mEnmOsType = VBOXOSTYPE_Win7; 634 634 else if (RTStrVersionCompare(image.mVersion.c_str(), "6.0") >= 0) 635 enmVersion= VBOXOSTYPE_WinVista;635 image.mEnmOsType = VBOXOSTYPE_WinVista; 636 636 if (image.mFlavor.contains("server", Utf8Str::CaseInsensitive)) 637 637 { 638 638 if (RTStrVersionCompare(image.mVersion.c_str(), "10.0.20348") >= 0) 639 enmVersion= VBOXOSTYPE_Win2k22_x64;639 image.mEnmOsType = VBOXOSTYPE_Win2k22_x64; 640 640 else if (RTStrVersionCompare(image.mVersion.c_str(), "10.0.17763") >= 0) 641 enmVersion= VBOXOSTYPE_Win2k19_x64;641 image.mEnmOsType = VBOXOSTYPE_Win2k19_x64; 642 642 else if (RTStrVersionCompare(image.mVersion.c_str(), "10.0") >= 0) 643 enmVersion= VBOXOSTYPE_Win2k16_x64;643 image.mEnmOsType = VBOXOSTYPE_Win2k16_x64; 644 644 else if (RTStrVersionCompare(image.mVersion.c_str(), "6.2") >= 0) 645 enmVersion= VBOXOSTYPE_Win2k12_x64;645 image.mEnmOsType = VBOXOSTYPE_Win2k12_x64; 646 646 else if (RTStrVersionCompare(image.mVersion.c_str(), "6.0") >= 0) 647 enmVersion= VBOXOSTYPE_Win2k8;647 image.mEnmOsType = VBOXOSTYPE_Win2k8; 648 648 } 649 if ( enmVersion!= VBOXOSTYPE_Unknown)649 if (image.mEnmOsType != VBOXOSTYPE_Unknown) 650 650 image.mOSType = (VBOXOSTYPE)( (image.mOSType & VBOXOSTYPE_ArchitectureMask) 651 | ( enmVersion& VBOXOSTYPE_OsTypeMask));651 | (image.mEnmOsType & VBOXOSTYPE_OsTypeMask)); 652 652 return; 653 653 } … … 785 785 * @param hVfsIso The ISO file system. 786 786 * @param pBuf Read buffer. 787 * @param penmOsType Where to return the OS type. This is initialized to788 * VBOXOSTYPE_Unknown.789 787 */ 790 HRESULT Unattended::i_innerDetectIsoOSWindows(RTVFS hVfsIso, DETECTBUFFER *pBuf , VBOXOSTYPE *penmOsType)788 HRESULT Unattended::i_innerDetectIsoOSWindows(RTVFS hVfsIso, DETECTBUFFER *pBuf) 791 789 { 792 790 /** @todo The 'sources/' path can differ. */ … … 880 878 { 881 879 LogRel2(("Unattended: happy with mDetectedImages[%u]\n", i)); 882 *penmOsType = mDetectedImages[i].mOSType;880 mEnmOsType = mDetectedImages[i].mOSType; 883 881 return S_OK; 884 882 } … … 920 918 if (RT_SUCCESS(vrc)) 921 919 { 922 *penmOsType = VBOXOSTYPE_WinNT_x64;920 mEnmOsType = VBOXOSTYPE_WinNT_x64; 923 921 924 922 RTINIFILE hIniFile; … … 933 931 if ( RTStrNICmp(pBuf->sz, RT_STR_TUPLE("amd64")) == 0 934 932 || RTStrNICmp(pBuf->sz, RT_STR_TUPLE("x64")) == 0 /* just in case */ ) 935 *penmOsType = VBOXOSTYPE_WinNT_x64;933 mEnmOsType = VBOXOSTYPE_WinNT_x64; 936 934 else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("x86")) == 0) 937 *penmOsType = VBOXOSTYPE_WinNT;935 mEnmOsType = VBOXOSTYPE_WinNT; 938 936 else 939 937 { 940 938 LogRel(("Unattended: sources/idwbinfo.txt: Unknown: BuildArch=%s\n", pBuf->sz)); 941 *penmOsType = VBOXOSTYPE_WinNT_x64;939 mEnmOsType = VBOXOSTYPE_WinNT_x64; 942 940 } 943 941 } … … 949 947 if ( RTStrNICmp(pBuf->sz, RT_STR_TUPLE("vista")) == 0 950 948 || RTStrNICmp(pBuf->sz, RT_STR_TUPLE("winmain_beta")) == 0) 951 *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_WinVista);949 mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_WinVista); 952 950 else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("lh_sp2rtm")) == 0) 953 951 { 954 *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_WinVista);952 mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_WinVista); 955 953 pszVersion = "sp2"; 956 954 } 957 955 else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("longhorn_rtm")) == 0) 958 956 { 959 *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_WinVista);957 mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_WinVista); 960 958 pszVersion = "sp1"; 961 959 } 962 960 else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("win7")) == 0) 963 *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win7);961 mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win7); 964 962 else if ( RTStrNICmp(pBuf->sz, RT_STR_TUPLE("winblue")) == 0 965 963 || RTStrNICmp(pBuf->sz, RT_STR_TUPLE("winmain_blue")) == 0 966 964 || RTStrNICmp(pBuf->sz, RT_STR_TUPLE("win81")) == 0 /* not seen, but just in case its out there */ ) 967 *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win81);965 mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win81); 968 966 else if ( RTStrNICmp(pBuf->sz, RT_STR_TUPLE("win8")) == 0 969 967 || RTStrNICmp(pBuf->sz, RT_STR_TUPLE("winmain_win8")) == 0 ) 970 *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win8);968 mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win8); 971 969 else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("th1")) == 0) 972 970 { 973 971 pszVersion = "1507"; // aka. GA, retroactively 1507 974 *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10);972 mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10); 975 973 } 976 974 else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("th2")) == 0) 977 975 { 978 976 pszVersion = "1511"; // aka. threshold 2 979 *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10);977 mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10); 980 978 } 981 979 else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("rs1_release")) == 0) 982 980 { 983 981 pszVersion = "1607"; // aka. anniversay update; rs=redstone 984 *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10);982 mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10); 985 983 } 986 984 else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("rs2_release")) == 0) 987 985 { 988 986 pszVersion = "1703"; // aka. creators update 989 *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10);987 mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10); 990 988 } 991 989 else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("rs3_release")) == 0) 992 990 { 993 991 pszVersion = "1709"; // aka. fall creators update 994 *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10);992 mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10); 995 993 } 996 994 else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("rs4_release")) == 0) 997 995 { 998 996 pszVersion = "1803"; 999 *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10);997 mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10); 1000 998 } 1001 999 else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("rs5_release")) == 0) 1002 1000 { 1003 1001 pszVersion = "1809"; 1004 *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10);1002 mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10); 1005 1003 } 1006 1004 else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("19h1_release")) == 0) 1007 1005 { 1008 1006 pszVersion = "1903"; 1009 *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10);1007 mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10); 1010 1008 } 1011 1009 else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("19h2_release")) == 0) 1012 1010 { 1013 1011 pszVersion = "1909"; // ?? 1014 *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10);1012 mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10); 1015 1013 } 1016 1014 else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("20h1_release")) == 0) 1017 1015 { 1018 1016 pszVersion = "2003"; // ?? 1019 *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10);1017 mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10); 1020 1018 } 1021 1019 else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("vb_release")) == 0) 1022 1020 { 1023 1021 pszVersion = "2004"; // ?? vb=Vibranium 1024 *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10);1022 mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10); 1025 1023 } 1026 1024 else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("20h2_release")) == 0) 1027 1025 { 1028 1026 pszVersion = "2009"; // ?? 1029 *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10);1027 mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10); 1030 1028 } 1031 1029 else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("21h1_release")) == 0) 1032 1030 { 1033 1031 pszVersion = "2103"; // ?? 1034 *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10);1032 mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10); 1035 1033 } 1036 1034 else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("21h2_release")) == 0) 1037 1035 { 1038 1036 pszVersion = "2109"; // ?? 1039 *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10);1037 mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10); 1040 1038 } 1041 1039 else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("co_release")) == 0) 1042 1040 { 1043 1041 pszVersion = "21H2"; // ?? 1044 *penmOsType = VBOXOSTYPE_Win11_x64;1042 mEnmOsType = VBOXOSTYPE_Win11_x64; 1045 1043 } 1046 1044 else … … 1059 1057 vrc = RTVfsFileOpen(hVfsIso, "AMD64/HIVESYS.INF", RTFILE_O_READ | RTFILE_O_DENY_NONE | RTFILE_O_OPEN, &hVfsFile); 1060 1058 if (RT_SUCCESS(vrc)) 1061 *penmOsType = VBOXOSTYPE_WinNT_x64;1059 mEnmOsType = VBOXOSTYPE_WinNT_x64; 1062 1060 else 1063 1061 { 1064 1062 vrc = RTVfsFileOpen(hVfsIso, "I386/HIVESYS.INF", RTFILE_O_READ | RTFILE_O_DENY_NONE | RTFILE_O_OPEN, &hVfsFile); 1065 1063 if (RT_SUCCESS(vrc)) 1066 *penmOsType = VBOXOSTYPE_WinNT;1064 mEnmOsType = VBOXOSTYPE_WinNT; 1067 1065 } 1068 1066 if (RT_SUCCESS(vrc)) … … 1084 1082 { 1085 1083 fClarifyProd = true; 1086 *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win2k3);1084 mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win2k3); 1087 1085 if (RTStrVersionCompare(psz, "5.2.3790.3959") >= 0) 1088 1086 pszVersion = "sp2"; … … 1092 1090 else if (RTStrVersionCompare(psz, "5.1.0") >= 0) /* XP */ 1093 1091 { 1094 *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_WinXP);1092 mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_WinXP); 1095 1093 if (RTStrVersionCompare(psz, "5.1.2600.5512") >= 0) 1096 1094 pszVersion = "sp3"; … … 1102 1100 else if (RTStrVersionCompare(psz, "5.0.0") >= 0) 1103 1101 { 1104 *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win2k);1102 mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win2k); 1105 1103 if (RTStrVersionCompare(psz, "5.0.2195.6717") >= 0) 1106 1104 pszVersion = "sp4"; … … 1125 1123 vrc = RTVfsFileOpen(hVfsIso, "AMD64/PRODSPEC.INI", RTFILE_O_READ | RTFILE_O_DENY_NONE | RTFILE_O_OPEN, &hVfsFile); 1126 1124 if (RT_SUCCESS(vrc)) 1127 *penmOsType = VBOXOSTYPE_WinNT_x64;1125 mEnmOsType = VBOXOSTYPE_WinNT_x64; 1128 1126 else 1129 1127 { 1130 1128 vrc = RTVfsFileOpen(hVfsIso, "I386/PRODSPEC.INI", RTFILE_O_READ | RTFILE_O_DENY_NONE | RTFILE_O_OPEN, &hVfsFile); 1131 1129 if (RT_SUCCESS(vrc)) 1132 *penmOsType = VBOXOSTYPE_WinNT;1130 mEnmOsType = VBOXOSTYPE_WinNT; 1133 1131 } 1134 1132 if (RT_SUCCESS(vrc)) … … 1150 1148 vrc = RTIniFileQueryValue(hIniFile, "Product Specification", "Product", pBuf->sz, sizeof(*pBuf), NULL); 1151 1149 if (RT_SUCCESS(vrc) && RTStrNICmp(pBuf->sz, RT_STR_TUPLE("Windows XP")) == 0) 1152 *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_WinXP);1150 mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_WinXP); 1153 1151 else if (RT_SUCCESS(vrc) && RTStrNICmp(pBuf->sz, RT_STR_TUPLE("Windows Server 2003")) == 0) 1154 *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win2k3);1152 mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win2k3); 1155 1153 else 1156 *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win2k);1154 mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win2k); 1157 1155 1158 1156 if (RT_SUCCESS(vrc) && (strstr(pBuf->sz, "Server") || strstr(pBuf->sz, "server"))) … … 1160 1158 } 1161 1159 else if (RTStrVersionCompare(pBuf->sz, "4.0") >= 0) /* NT4 */ 1162 *penmOsType = VBOXOSTYPE_WinNT4;1160 mEnmOsType = VBOXOSTYPE_WinNT4; 1163 1161 else 1164 1162 LogRel(("Unattended: PRODSPEC.INI: unknown: DriverVer=%s\n", pBuf->sz)); … … 1184 1182 if (RT_SUCCESS(vrc)) 1185 1183 { 1186 *penmOsType = VBOXOSTYPE_WinNT;1184 mEnmOsType = VBOXOSTYPE_WinNT; 1187 1185 1188 1186 RTINIFILE hIniFile; … … 1209 1207 LogRel(("Unattended: TXTSETUP.SIF: unknown: LoadIdentifier=%s\n", pBuf->sz)); 1210 1208 else if (RTStrVersionCompare(psz, "4.0") >= 0) 1211 *penmOsType = VBOXOSTYPE_WinNT4;1209 mEnmOsType = VBOXOSTYPE_WinNT4; 1212 1210 else if (RTStrVersionCompare(psz, "3.1") >= 0) 1213 1211 { 1214 *penmOsType = VBOXOSTYPE_WinNT3x;1212 mEnmOsType = VBOXOSTYPE_WinNT3x; 1215 1213 pszVersion = psz; 1216 1214 } … … 1434 1432 * @param hVfsIso The ISO file system. 1435 1433 * @param pBuf Read buffer. 1436 * @param penmOsType Where to return the OS type. This is initialized to1437 * VBOXOSTYPE_Unknown.1438 1434 */ 1439 HRESULT Unattended::i_innerDetectIsoOSLinux(RTVFS hVfsIso, DETECTBUFFER *pBuf , VBOXOSTYPE *penmOsType)1435 HRESULT Unattended::i_innerDetectIsoOSLinux(RTVFS hVfsIso, DETECTBUFFER *pBuf) 1440 1436 { 1441 1437 /* … … 1465 1461 { 1466 1462 LogRelFlow(("Unattended: .treeinfo: arch=%s\n", pBuf->sz)); 1467 if (detectLinuxArch(pBuf->sz, penmOsType, VBOXOSTYPE_RedHat))1463 if (detectLinuxArch(pBuf->sz, &mEnmOsType, VBOXOSTYPE_RedHat)) 1468 1464 { 1469 1465 /* Try figure the release name, it doesn't have to be redhat. */ … … 1476 1472 { 1477 1473 LogRelFlow(("Unattended: .treeinfo: name/family=%s\n", pBuf->sz)); 1478 if (!detectLinuxDistroName(pBuf->sz, penmOsType, NULL))1474 if (!detectLinuxDistroName(pBuf->sz, &mEnmOsType, NULL)) 1479 1475 { 1480 1476 LogRel(("Unattended: .treeinfo: Unknown: name/family='%s', assuming Red Hat\n", pBuf->sz)); 1481 *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_RedHat);1477 mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_RedHat); 1482 1478 } 1483 1479 } … … 1503 1499 } 1504 1500 1505 if ( *penmOsType != VBOXOSTYPE_Unknown)1501 if (mEnmOsType != VBOXOSTYPE_Unknown) 1506 1502 return S_FALSE; 1507 1503 } … … 1541 1537 /* Do we recognize the architecture? */ 1542 1538 LogRelFlow(("Unattended: .discinfo: arch=%s\n", apszLines[2])); 1543 if (detectLinuxArch(apszLines[2], penmOsType, VBOXOSTYPE_RedHat))1539 if (detectLinuxArch(apszLines[2], &mEnmOsType, VBOXOSTYPE_RedHat)) 1544 1540 { 1545 1541 /* Do we recognize the release string? */ 1546 1542 LogRelFlow(("Unattended: .discinfo: product+version=%s\n", apszLines[1])); 1547 1543 const char *pszVersion = NULL; 1548 if (!detectLinuxDistroName(apszLines[1], penmOsType, &pszVersion))1544 if (!detectLinuxDistroName(apszLines[1], &mEnmOsType, &pszVersion)) 1549 1545 LogRel(("Unattended: .discinfo: Unknown: release='%s'\n", apszLines[1])); 1550 1546 … … 1630 1626 LogRel(("Unattended: .discinfo: Unknown: arch='%s'\n", apszLines[2])); 1631 1627 1632 if ( *penmOsType != VBOXOSTYPE_Unknown)1628 if (mEnmOsType != VBOXOSTYPE_Unknown) 1633 1629 return S_FALSE; 1634 1630 } … … 1721 1717 if (pszDiskName && pszArch) 1722 1718 { 1723 if (detectLinuxArch(pszArch, penmOsType, VBOXOSTYPE_Ubuntu))1719 if (detectLinuxArch(pszArch, &mEnmOsType, VBOXOSTYPE_Ubuntu)) 1724 1720 { 1725 1721 const char *pszVersion = NULL; 1726 if (detectLinuxDistroName(pszDiskName, penmOsType, &pszVersion))1722 if (detectLinuxDistroName(pszDiskName, &mEnmOsType, &pszVersion)) 1727 1723 { 1728 1724 LogRelFlow(("Unattended: README.diskdefines: version=%s\n", pszVersion)); … … 1739 1735 LogRel(("Unattended: README.diskdefines: Did not find both DISKNAME and ARCH. :-/\n")); 1740 1736 1741 if ( *penmOsType != VBOXOSTYPE_Unknown)1737 if (mEnmOsType != VBOXOSTYPE_Unknown) 1742 1738 return S_FALSE; 1743 1739 } … … 1783 1779 if (pszDiskName && pszArch) 1784 1780 { 1785 if (!detectLinuxArchII(pszArch, penmOsType, VBOXOSTYPE_Ubuntu))1781 if (!detectLinuxArchII(pszArch, &mEnmOsType, VBOXOSTYPE_Ubuntu)) 1786 1782 LogRel(("Unattended: README.diskdefines: Unknown: arch='%s'\n", pszArch)); 1787 1783 1788 1784 const char *pszVersion = NULL; 1789 if (detectLinuxDistroName(pszDiskName, penmOsType, &pszVersion))1785 if (detectLinuxDistroName(pszDiskName, &mEnmOsType, &pszVersion)) 1790 1786 { 1791 1787 LogRelFlow(("Unattended: README.diskdefines: version=%s\n", pszVersion)); … … 1799 1795 LogRel(("Unattended: README.diskdefines: Did not find both DISKNAME and ARCH. :-/\n")); 1800 1796 1801 if ( *penmOsType != VBOXOSTYPE_Unknown)1797 if (mEnmOsType != VBOXOSTYPE_Unknown) 1802 1798 return S_FALSE; 1803 1799 } … … 1818 1814 * @param hVfsIso The ISO file system. 1819 1815 * @param pBuf Read buffer. 1820 * @param penmOsType Where to return the OS type. This is initialized to1821 * VBOXOSTYPE_Unknown.1822 1816 */ 1823 HRESULT Unattended::i_innerDetectIsoOSOs2(RTVFS hVfsIso, DETECTBUFFER *pBuf , VBOXOSTYPE *penmOsType)1817 HRESULT Unattended::i_innerDetectIsoOSOs2(RTVFS hVfsIso, DETECTBUFFER *pBuf) 1824 1818 { 1825 1819 /* … … 1879 1873 * So, it's some kind of OS/2 2.x or later ISO alright. 1880 1874 */ 1881 *penmOsType = VBOXOSTYPE_OS2;1875 mEnmOsType = VBOXOSTYPE_OS2; 1882 1876 mStrDetectedOSHints.printf("OS2SE20.SRC=%.*s", cchOs2Image, pBuf->sz); 1883 1877 … … 1887 1881 * ArcaOS 5.0.7 EN 1888 1882 * Built 2021-12-07 18:34:34 1889 * We drop the "ArcaOS" bit, as it's covered by penmOsType. Then we pull up1883 * We drop the "ArcaOS" bit, as it's covered by mEnmOsType. Then we pull up 1890 1884 * the second line. 1891 1885 * … … 1901 1895 && RTFS_IS_DIRECTORY(ObjInfo.Attr.fMode)) 1902 1896 { 1903 *penmOsType = VBOXOSTYPE_ArcaOS;1897 mEnmOsType = VBOXOSTYPE_ArcaOS; 1904 1898 1905 1899 /* Read the version file: */ … … 1966 1960 && RTFS_IS_DIRECTORY(ObjInfo.Attr.fMode)) 1967 1961 { 1968 *penmOsType = VBOXOSTYPE_ECS;1962 mEnmOsType = VBOXOSTYPE_ECS; 1969 1963 1970 1964 /* Read the version file: */ … … 2063 2057 } 2064 2058 if (RTStrVersionCompare(mStrDetectedOSVersion.c_str(), "4.50") >= 0) 2065 *penmOsType = VBOXOSTYPE_OS2Warp45;2059 mEnmOsType = VBOXOSTYPE_OS2Warp45; 2066 2060 else if (RTStrVersionCompare(mStrDetectedOSVersion.c_str(), "4.00") >= 0) 2067 *penmOsType = VBOXOSTYPE_OS2Warp4;2061 mEnmOsType = VBOXOSTYPE_OS2Warp4; 2068 2062 else if (RTStrVersionCompare(mStrDetectedOSVersion.c_str(), "3.00") >= 0) 2069 *penmOsType = VBOXOSTYPE_OS2Warp3;2063 mEnmOsType = VBOXOSTYPE_OS2Warp3; 2070 2064 } 2071 2065 else … … 2090 2084 * Only tested ACP2, so only return S_OK for it. 2091 2085 */ 2092 if ( *penmOsType == VBOXOSTYPE_OS2Warp452086 if ( mEnmOsType == VBOXOSTYPE_OS2Warp45 2093 2087 && RTStrVersionCompare(mStrDetectedOSVersion.c_str(), "4.52") >= 0 2094 2088 && mStrDetectedOSFlavor.contains("Server", RTCString::CaseInsensitive)) … … 3569 3563 return S_OK; 3570 3564 } 3565 /* We cannot install Ubuntus older than 11.04. */ 3566 if (mEnmOsType == VBOXOSTYPE_Ubuntu || mEnmOsType == VBOXOSTYPE_Ubuntu_x64) 3567 { 3568 if (RTStrVersionCompare(mStrDetectedOSVersion.c_str(), "11.04") < 0) 3569 { 3570 *aIsUnattendedInstallSupported = false; 3571 return S_OK; 3572 } 3573 } 3574 *aIsUnattendedInstallSupported = true; 3571 3575 return S_OK; 3572 3576 } … … 3831 3835 fRet = false; 3832 3836 3837 mEnmOsType = rImage.mEnmOsType; 3838 3833 3839 return fRet; 3834 3840 }
Note:
See TracChangeset
for help on using the changeset viewer.