VirtualBox

Changeset 35523 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Jan 13, 2011 1:12:03 PM (14 years ago)
Author:
vboxsync
Message:

Main,VBoxManage: Implemented the progress objects for ExtPackManager::Uninstall and ExtPackFile::Install. Fixed a bug in ExtPackFile wrt cleaning up on failure.

File:
1 edited

Legend:

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

    r35517 r35523  
    859859        ComPtr<IProgress> ptrProgress;
    860860        CHECK_ERROR2_RET(ptrExtPackFile, Install(fReplace, NULL, ptrProgress.asOutParam()), RTEXITCODE_FAILURE);
    861         if (!ptrProgress.isNull())
    862             CHECK_ERROR2_RET(ptrProgress, WaitForCompletion(-1), RTEXITCODE_FAILURE);
     861        hrc = showProgress(ptrProgress);
     862        if (FAILED(hrc))
     863        {
     864            com::ProgressErrorInfo ErrInfo(ptrProgress);
     865            if (ErrInfo.isBasicAvailable())
     866                RTMsgError("Failed to install \"%s\": %lS", szPath, ErrInfo.getText().raw());
     867            else
     868                RTMsgError("Failed to install \"%s\": No error message available!", szPath);
     869            return RTEXITCODE_FAILURE;
     870        }
    863871        RTPrintf("Successfully installed \"%lS\".\n", bstrName.raw());
    864872    }
     
    898906        ComPtr<IProgress> ptrProgress;
    899907        CHECK_ERROR2_RET(ptrExtPackMgr, Uninstall(bstrName.raw(), fForced, NULL, ptrProgress.asOutParam()), RTEXITCODE_FAILURE);
    900         if (!ptrProgress.isNull())
    901             CHECK_ERROR2_RET(ptrProgress, WaitForCompletion(-1), RTEXITCODE_FAILURE);
     908        hrc = showProgress(ptrProgress);
     909        if (FAILED(hrc))
     910        {
     911            com::ProgressErrorInfo ErrInfo(ptrProgress);
     912            if (ErrInfo.isBasicAvailable())
     913                RTMsgError("Failed to uninstall \"%s\": %lS", pszName, ErrInfo.getText().raw());
     914            else
     915                RTMsgError("Failed to uninstall \"%s\": No error message available!", pszName);
     916            return RTEXITCODE_FAILURE;
     917        }
    902918        RTPrintf("Successfully uninstalled \"%s\".\n", pszName);
    903919    }
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