VirtualBox

Changeset 93587 in vbox


Ignore:
Timestamp:
Feb 3, 2022 3:40:21 PM (3 years ago)
Author:
vboxsync
Message:

Main/Unattended: Set IMAGE/WINDOWS/EDITIONID (or IMAGE/FLAGS absent) as detectedOSFlavor for windows ISOs with install.wim/XML. bugref:9781

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/UnattendedImpl.h

    r93584 r93587  
    4040    Utf8Str  mVersion;
    4141    Utf8Str  mArch;
     42    Utf8Str  mFlavor;
    4243    RTCList<RTCString, RTCString *> mLanguages;
    4344    Utf8Str  mDefaultLanguage;
  • trunk/src/VBox/Main/src-server/UnattendedImpl.cpp

    r93585 r93587  
    197197const Utf8Str &WIMImage::formatName(Utf8Str &r_strName) const
    198198{
     199    /* We skip the mFlavor as it's typically part of the description already. */
     200
    199201    if (mVersion.isEmpty() && mArch.isEmpty() && mDefaultLanguage.isEmpty() && mLanguages.size() == 0)
    200202        return mName;
     
    719721            || (pElmWindows = pChild->findChildElement("Windows")) != NULL)
    720722        {
     723            /* Do edition/flags before the version so it can better determin
     724               the OS version enum value.  Old windows version (vista) typically
     725               doesn't have an EDITIONID element, so fall back on the FLAGS element
     726               under IMAGE as it is pretty similar (case differences). */
     727            const ElementNode *pElmEditionId;
     728            if (   (pElmEditionId = pElmWindows->findChildElement("EDITIONID")) != NULL
     729                || (pElmEditionId = pElmWindows->findChildElement("editionid")) != NULL
     730                || (pElmEditionId = pElmWindows->findChildElement("Editionid")) != NULL
     731                || (pElmEditionId = pElmWindows->findChildElement("EditionId")) != NULL
     732                || (pElmEditionId = pChild->findChildElement("FLAGS")) != NULL
     733                || (pElmEditionId = pChild->findChildElement("flags")) != NULL
     734                || (pElmEditionId = pChild->findChildElement("Flags")) != NULL)
     735                if (   pElmEditionId->getValue()
     736                    && *pElmEditionId->getValue() != '\0')
     737                    newImage.mFlavor = pElmEditionId->getValue();
     738
    721739            const ElementNode *pElmVersion;
    722740            if (   (pElmVersion = pElmWindows->findChildElement("VERSION")) != NULL
     
    740758                parseLangaguesElement(pElmLang, newImage);
    741759        }
     760
    742761
    743762        imageList.append(newImage);
     
    37793798        fRet = false;
    37803799
     3800    if (rImage.mFlavor.isNotEmpty())
     3801        mStrDetectedOSFlavor = rImage.mFlavor;
     3802    else
     3803        fRet = false;
     3804
    37813805    if (rImage.mLanguages.size() > 0)
    37823806        mDetectedOSLanguages  = rImage.mLanguages;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette