VirtualBox

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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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