Changeset 85876 in vbox for trunk/src/VBox/Main
- Timestamp:
- Aug 24, 2020 4:44:24 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 140047
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/HostUpdateImpl.cpp
r85738 r85876 257 257 HRESULT HostUpdate::i_checkForVBoxUpdate() 258 258 { 259 HRESULT rc;260 261 259 // Default to no update required 262 260 m_updateNeeded = FALSE; … … 266 264 Utf8Str strUrl("https://update.virtualbox.org/query.php/?"); 267 265 Bstr platform; 268 rc = mVirtualBox->COMGETTER(PackageType)(platform.asOutParam()); 269 if (FAILED(rc)) 270 return setErrorVrc(rc, tr("%s: IVirtualBox::packageType() failed: %Rrc"), __FUNCTION__, rc); 266 HRESULT rc = mVirtualBox->COMGETTER(PackageType)(platform.asOutParam()); 267 AssertComRCReturn(rc, rc); 271 268 strUrl.appendPrintf("platform=%ls", platform.raw()); // e.g. SOLARIS_64BITS_GENERIC 272 269 … … 274 271 Bstr versionNormalized; 275 272 rc = mVirtualBox->COMGETTER(VersionNormalized)(versionNormalized.asOutParam()); 276 if (FAILED(rc)) 277 return setErrorVrc(rc, tr("%s: IVirtualBox::versionNormalized() failed: %Rrc"), __FUNCTION__, rc); 273 AssertComRCReturn(rc, rc); 278 274 strUrl.appendPrintf("&version=%ls", versionNormalized.raw()); // e.g. 6.1.1 279 275 // strUrl.appendPrintf("&version=6.0.12"); // comment out previous line and uncomment this one for testing 280 276 281 ULONG revision ;277 ULONG revision = 0; 282 278 rc = mVirtualBox->COMGETTER(Revision)(&revision); 283 if (FAILED(rc)) 284 return setErrorVrc(rc, tr("%s: IVirtualBox::revision() failed: %Rrc"), __FUNCTION__, rc); 279 AssertComRCReturn(rc, rc); 285 280 strUrl.appendPrintf("_%u", revision); // e.g. 135618 286 281 … … 288 283 ComPtr<ISystemProperties> ptrSystemProperties; 289 284 rc = mVirtualBox->COMGETTER(SystemProperties)(ptrSystemProperties.asOutParam()); 290 if (FAILED(rc)) 291 return setErrorVrc(rc, tr("%s: IVirtualBox::systemProperties() failed: %Rrc"), __FUNCTION__, rc); 285 AssertComRCReturn(rc, rc); 292 286 293 287 // Update the VBoxUpdate setting 'VBoxUpdateLastCheckDate' … … 295 289 RTTIMESPEC TimeNow; 296 290 char szTimeStr[RTTIME_STR_LEN]; 297 298 291 RTTimeToString(RTTimeExplode(&Time, RTTimeNow(&TimeNow)), szTimeStr, sizeof(szTimeStr)); 299 292 LogRelFunc(("VBox updating UpdateDate with TimeString = %s\n", szTimeStr)); 300 293 rc = ptrSystemProperties->COMSETTER(VBoxUpdateLastCheckDate)(Bstr(szTimeStr).raw()); 301 if (FAILED(rc)) 302 return rc; // ISystemProperties::setLastCheckDate calls setError() on failure 294 AssertComRCReturn(rc, rc); 303 295 304 296 // Update the queryURL and the VBoxUpdate setting 'VBoxUpdateCount' 305 297 ULONG cVBoxUpdateCount = 0; 306 298 rc = ptrSystemProperties->COMGETTER(VBoxUpdateCount)(&cVBoxUpdateCount); 307 if (FAILED(rc)) 308 return setErrorVrc(rc, tr("%s: retrieving ISystemProperties::VBoxUpdateCount failed: %Rrc"), __FUNCTION__, rc); 299 AssertComRCReturn(rc, rc); 309 300 310 301 cVBoxUpdateCount++; 311 302 312 303 rc = ptrSystemProperties->COMSETTER(VBoxUpdateCount)(cVBoxUpdateCount); 313 if (FAILED(rc)) 314 return rc; // ISystemProperties::setVBoxUpdateCount calls setError() on failure 304 AssertComRCReturn(rc, rc); 315 305 strUrl.appendPrintf("&count=%u", cVBoxUpdateCount); 316 306 … … 318 308 VBoxUpdateTarget_T enmTarget = VBoxUpdateTarget_Stable; // default branch is 'stable' 319 309 rc = ptrSystemProperties->COMGETTER(VBoxUpdateTarget)(&enmTarget); 320 if (FAILED(rc)) 321 return setErrorVrc(rc, tr("%s: retrieving ISystemProperties::Target failed: %Rrc"), __FUNCTION__, rc); 310 AssertComRCReturn(rc, rc); 322 311 323 312 switch (enmTarget) … … 336 325 337 326 rc = ptrSystemProperties->COMSETTER(VBoxUpdateTarget)(enmTarget); 338 if (FAILED(rc)) 339 return rc; // ISystemProperties::setTarget calls setError() on failure 327 AssertComRCReturn(rc, rc); 340 328 341 329 LogRelFunc(("VBox update URL = %s\n", strUrl.c_str())); … … 346 334 Bstr version; 347 335 rc = mVirtualBox->COMGETTER(Version)(version.asOutParam()); // e.g. 6.1.0_RC1 348 if (FAILED(rc)) 349 return setErrorVrc(rc, tr("%s: IVirtualBox::version() failed: %Rrc"), __FUNCTION__, rc); 336 AssertComRCReturn(rc, rc); 350 337 351 338 Utf8StrFmt const strUserAgent("VirtualBox %ls <%s>", version.raw(), HostUpdate::i_platformInfo().c_str()); … … 596 583 ComPtr<ISystemProperties> pSystemProperties; 597 584 HRESULT rc = mVirtualBox->COMGETTER(SystemProperties)(pSystemProperties.asOutParam()); 598 if (FAILED(rc)) 599 return setErrorVrc(rc, tr("%s: IVirtualBox::systemProperties() failed: %Rrc"), __FUNCTION__, rc); 585 AssertComRCReturn(rc, rc); 600 586 601 587 BOOL fVBoxUpdateEnabled = true; 602 588 rc = pSystemProperties->COMGETTER(VBoxUpdateEnabled)(&fVBoxUpdateEnabled); 603 if (FAILED(rc)) 604 return setErrorVrc(rc, tr("%s: retrieving ISystemProperties::VBoxUpdateEnabled failed: %Rrc"), __FUNCTION__, rc); 589 AssertComRCReturn(rc, rc); 605 590 606 591 /** @todo r=bird: Not sure if this makes sense, it should at least have a
Note:
See TracChangeset
for help on using the changeset viewer.