VirtualBox

Changeset 108355 in vbox


Ignore:
Timestamp:
Feb 24, 2025 3:20:00 PM (2 weeks ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
167715
Message:

Unattended: bugref:10864. For Windows11 the product key is required.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r108046 r108355  
    50375037  <interface
    50385038    name="IUnattended" extends="$unknown"
    5039     uuid="a71e5822-365b-49ba-bd14-c8d616e6740d"
     5039    uuid="39d1f56c-c1c2-40df-84e9-468062d84768"
    50405040    wsmap="managed"
    50415041    rest="managed"
     
    51355135        distribution, only the installation of additions pointed to by
    51365136        <link to="IUnattended::additionsIsoPath"/>.
     5137      </desc>
     5138    </attribute>
     5139
     5140    <attribute name="productKeyRequired" type="boolean"  readonly="yes">
     5141      <desc>
     5142        Indicates whether the product key is required for the installation.
    51375143      </desc>
    51385144    </attribute>
  • trunk/src/VBox/Main/include/UnattendedImpl.h

    r106062 r108355  
    158158
    159159    bool            mfDoneDetectIsoOS;         /**< Set by detectIsoOS(), cleared by setIsoPath(). */
     160    bool            mfProductKeyRequired;
    160161    Utf8Str         mStrDetectedOSTypeId;
    161162    Utf8Str         mStrDetectedOSVersion;
     
    214215    HRESULT getInstallGuestAdditions(BOOL *installGuestAdditions);
    215216    HRESULT setInstallGuestAdditions(BOOL installGuestAdditions);
     217    HRESULT getProductKeyRequired(BOOL *productKeyRequired);
    216218    HRESULT getValidationKitIsoPath(com::Utf8Str &aValidationKitIsoPath);
    217219    HRESULT setValidationKitIsoPath(const com::Utf8Str &aValidationKitIsoPath);
  • trunk/src/VBox/Main/src-server/UnattendedImpl.cpp

    r107873 r108355  
    2626 */
    2727
     28#include <cstdio>
     29
    2830
    2931/*********************************************************************************************************************************
     
    260262    , mfInstallGuestAdditions(false), mfInstallTestExecService(false), mfInstallUserPayload(false)
    261263    , mpTimeZoneInfo(NULL), mfIsDefaultAuxiliaryBasePath(true), midxImage(0), mfDoneDetectIsoOS(false)
    262     , mEnmOsType(VBOXOSTYPE_Unknown)
     264    , mfProductKeyRequired(false), mEnmOsType(VBOXOSTYPE_Unknown)
    263265    , mfAvoidUpdatesOverNetwork(false), mfDoneSupportedGuestOSList(false)
    264266{ }
     
    363365    mStrDetectedOSHints.setNull();
    364366    mDetectedImages.clear();
     367    mfProductKeyRequired = false;
    365368
    366369    /*
     
    497500        }
    498501    }
    499 
     502    if (mStrDetectedOSTypeId.startsWithI("windows11"))
     503        mfProductKeyRequired = true;
    500504    /* Check if detected OS type is supported (covers platform architecture). */
    501505    bool fSupported = false;
     
    26342638    if ((Machine *)ptrMachine != (Machine *)mMachine)
    26352639        return setErrorBoth(E_FAIL, VERR_WRONG_ORDER, tr("The 'machine' while we were using it - please don't do that"));
    2636 
     2640    /* Check if required product key is set. */
     2641    if (mfProductKeyRequired && mStrProductKey.isEmpty())
     2642        return setErrorBoth(E_FAIL, VERR_MISSING, tr("Product key is required for this kind of OS"));
    26372643    /*
    26382644     * Check if the specified ISOs and files exist.
     
    35983604    AssertReturn(mpInstaller == NULL, setErrorBoth(E_FAIL, VERR_WRONG_ORDER, tr("Cannot change after prepare() has been called")));
    35993605    mfInstallGuestAdditions = installGuestAdditions != FALSE;
     3606    return S_OK;
     3607}
     3608
     3609HRESULT Unattended::getProductKeyRequired(BOOL *productKeyRequired)
     3610{
     3611    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     3612    *productKeyRequired = mfProductKeyRequired;
    36003613    return S_OK;
    36013614}
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