VirtualBox

Changeset 66157 in vbox


Ignore:
Timestamp:
Mar 17, 2017 3:47:45 PM (8 years ago)
Author:
vboxsync
Message:

VBoxManage: when installing the ExtPack, show the license and ask the user for confirmation (if required)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp

    r66068 r66157  
    11621162        CHECK_ERROR2I_RET(ptrExtPackMgr, OpenExtPackFile(bstrTarball.raw(), ptrExtPackFile.asOutParam()), RTEXITCODE_FAILURE);
    11631163        CHECK_ERROR2I_RET(ptrExtPackFile, COMGETTER(Name)(bstrName.asOutParam()), RTEXITCODE_FAILURE);
     1164        BOOL fShowLicense = true;
     1165        CHECK_ERROR2I_RET(ptrExtPackFile, COMGETTER(ShowLicense)(&fShowLicense), RTEXITCODE_FAILURE);
     1166        if (fShowLicense)
     1167        {
     1168            Bstr bstrLicense;
     1169            CHECK_ERROR2I_RET(ptrExtPackFile,
     1170                              QueryLicense(Bstr("").raw() /* PreferredLocale */,
     1171                                           Bstr("").raw() /* PreferredLanguage */,
     1172                                           Bstr("txt").raw() /* Format */,
     1173                                           bstrLicense.asOutParam()), RTEXITCODE_FAILURE);
     1174            RTPrintf("%ls\n", bstrLicense.raw());
     1175            RTPrintf("Do you agree to these license terms and conditions (y/n)? " );
     1176            ch = RTStrmGetCh(g_pStdIn);
     1177            RTPrintf("\n");
     1178            if (ch != 'y' && ch != 'Y')
     1179            {
     1180                RTPrintf("Installation of \"%ls\" aborted.\n", bstrName.raw());
     1181                return RTEXITCODE_SUCCESS;
     1182            }
     1183        }
    11641184        ComPtr<IProgress> ptrProgress;
    11651185        CHECK_ERROR2I_RET(ptrExtPackFile, Install(fReplace, NULL, ptrProgress.asOutParam()), RTEXITCODE_FAILURE);
Note: See TracChangeset for help on using the changeset viewer.

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