VirtualBox

Changeset 96619 in vbox


Ignore:
Timestamp:
Sep 6, 2022 9:12:59 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
153499
Message:

Main/Unattended: Added is-install-supported checks for windows and OS/2. bugref:9781

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/UnattendedImpl.cpp

    r96407 r96619  
    37153715HRESULT Unattended::getIsUnattendedInstallSupported(BOOL *aIsUnattendedInstallSupported)
    37163716{
     3717    /*
     3718     * Take the initial position that it's not supported, so we can return
     3719     * right away when we decide it's not possible.
     3720     */
     3721    *aIsUnattendedInstallSupported = false;
     3722
    37173723    /* Unattended is disabled by default if we could not detect OS type. */
    3718     if (mStrDetectedOSTypeId.isEmpty() || mStrDetectedOSVersion.isEmpty())
    3719     {
    3720         *aIsUnattendedInstallSupported = false;
     3724    if (mStrDetectedOSTypeId.isEmpty())
    37213725        return S_OK;
    3722     }
     3726
     3727    const VBOXOSTYPE enmOsTypeMasked = (VBOXOSTYPE)(mEnmOsType & VBOXOSTYPE_OsTypeMask);
     3728
     3729    /* We require a version to have been detected, except for windows where the
     3730       field is generally only used for the service pack number at present and
     3731       will be empty for RTMs isos. */
     3732    if (   (   enmOsTypeMasked <= VBOXOSTYPE_WinNT
     3733            || enmOsTypeMasked >= VBOXOSTYPE_OS2)
     3734        && mStrDetectedOSVersion.isEmpty())
     3735        return S_OK;
     3736
     3737    /*
     3738     * Sort out things that we know doesn't work.  Order by VBOXOSTYPE value.
     3739     */
     3740
     3741    /* We do not support any of the DOS based windows version, nor DOS, in case
     3742       any of that gets detected (it shouldn't): */
     3743    if (enmOsTypeMasked >= VBOXOSTYPE_DOS && enmOsTypeMasked < VBOXOSTYPE_WinNT)
     3744        return S_OK;
     3745
     3746    /* Windows NT 3.x doesn't work, also skip unknown windows NT version: */
     3747    if (enmOsTypeMasked >= VBOXOSTYPE_WinNT && enmOsTypeMasked < VBOXOSTYPE_WinNT4)
     3748        return S_OK;
     3749
     3750    /* For OS/2 we only support OS2 4.5 (actually only 4.52 server has been
     3751       tested, but we'll get to the others eventually): */
     3752    if (   enmOsTypeMasked >= VBOXOSTYPE_OS2
     3753        && enmOsTypeMasked < VBOXOSTYPE_Linux
     3754        && enmOsTypeMasked != VBOXOSTYPE_OS2Warp45 /* probably works */ )
     3755        return S_OK;
     3756
     3757    /* Old Debians fail since package repos have been move to some other mirror location. */
     3758    if (   enmOsTypeMasked == VBOXOSTYPE_Debian
     3759        && RTStrVersionCompare(mStrDetectedOSVersion.c_str(), "9.0") < 0)
     3760        return S_OK;
     3761
     3762    /* Skip all OpenSUSE variants for now. */
     3763    if (enmOsTypeMasked == VBOXOSTYPE_OpenSUSE)
     3764        return S_OK;
     3765
    37233766    /* We cannot install Ubuntus older than 11.04. */
    3724     if ((mEnmOsType & VBOXOSTYPE_OsTypeMask) == VBOXOSTYPE_Ubuntu)
    3725     {
    3726         if (RTStrVersionCompare(mStrDetectedOSVersion.c_str(), "11.04") < 0)
    3727         {
    3728             *aIsUnattendedInstallSupported = false;
    3729             return S_OK;
    3730         }
    3731     }
     3767    if (   enmOsTypeMasked == VBOXOSTYPE_Ubuntu
     3768        && RTStrVersionCompare(mStrDetectedOSVersion.c_str(), "11.04") < 0)
     3769        return S_OK;
     3770
    37323771    /* Earlier than OL 6.4 cannot be installed. OL 6.x fails with unsupported hardware error (CPU family). */
    3733     if ((mEnmOsType & VBOXOSTYPE_OsTypeMask) == VBOXOSTYPE_Oracle)
    3734     {
    3735         if (RTStrVersionCompare(mStrDetectedOSVersion.c_str(), "6.4") < 0)
    3736         {
    3737             *aIsUnattendedInstallSupported = false;
    3738             return S_OK;
    3739         }
    3740     }
    3741     /* Old Debians fail since package repos have been move to some other mirror location. */
    3742     if ((mEnmOsType & VBOXOSTYPE_OsTypeMask) == VBOXOSTYPE_Debian)
    3743     {
    3744         if (RTStrVersionCompare(mStrDetectedOSVersion.c_str(), "9.0") < 0)
    3745         {
    3746             *aIsUnattendedInstallSupported = false;
    3747             return S_OK;
    3748         }
    3749     }
    3750     /* Skip all OpenSUSE variants for now. */
    3751     if ((mEnmOsType & VBOXOSTYPE_OsTypeMask) == VBOXOSTYPE_OpenSUSE)
    3752     {
    3753         *aIsUnattendedInstallSupported = false;
     3772    if (   enmOsTypeMasked == VBOXOSTYPE_Oracle
     3773        && RTStrVersionCompare(mStrDetectedOSVersion.c_str(), "6.4") < 0)
    37543774        return S_OK;
    3755     }
     3775
     3776    /*
     3777     * Assume the rest works.
     3778     */
    37563779    *aIsUnattendedInstallSupported = true;
    37573780    return S_OK;
Note: See TracChangeset for help on using the changeset viewer.

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