Lines Matching refs:hr
272 HRESULT hr = S_OK;
285 hr = BalGetNumericVariable(L"InstallAllUsers", &installAllUsers);
286 ExitOnFailure(hr, L"Failed to get install scope");
288 hr = _engine->SetVariableNumeric(L"CompileAll", installAllUsers);
289 ExitOnFailure(hr, L"Failed to update CompileAll");
291 hr = EnsureTargetDir();
292 ExitOnFailure(hr, L"Failed to set TargetDir");
323 hr = EnsureTargetDir();
324 ExitOnFailure(hr, L"Failed to set TargetDir");
326 hr = BalGetStringVariable(L"TargetDir", &targetDir);
327 if (SUCCEEDED(hr)) {
363 hr = BalGetStringVariable(
368 if (SUCCEEDED(hr) && defaultDir) {
377 hr = BalGetStringVariable(
381 if (SUCCEEDED(hr) && defaultDir && defaultDir[0] && SUCCEEDED(BalFormatString(defaultDir, &formatted))) {
473 HRESULT hr;
496 hr = BalGetStringVariable(L"TargetDir", &targetDir);
497 if (SUCCEEDED(hr) && targetDir && targetDir[0]) {
500 } else if (SUCCEEDED(hr)) {
505 hr = BalGetStringVariable(L"DefaultCustomTargetDir", &defaultTargetDir);
506 if (SUCCEEDED(hr) && defaultTargetDir && !defaultTargetDir[0]) {
510 hr = BalGetStringVariable(
515 if (SUCCEEDED(hr) && defaultTargetDir) {
533 HRESULT hr = S_OK;
543 hr = LocGetString(_wixLoc, L"#(loc.SuccessInstallMessage)", &successText);
546 hr = LocGetString(_wixLoc, L"#(loc.SuccessModifyMessage)", &successText);
549 hr = LocGetString(_wixLoc, L"#(loc.SuccessRepairMessage)", &successText);
552 hr = LocGetString(_wixLoc, L"#(loc.SuccessRemoveMessage)", &successText);
654 HRESULT hr = BalGetStringVariable(L"TargetDir", &targetDir);
655 if (FAILED(hr) || !targetDir || !targetDir[0]) {
683 HRESULT hr = S_OK;
689 ExitWithLastError(hr, "Failed to create UI thread.");
693 return hr;
724 auto hr = LoadAssociateFilesStateFromKey(_engine, fPerMachine ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER);
725 if (hr == S_OK) {
727 } else if (hr == S_FALSE) {
729 } else if (FAILED(hr)) {
730 BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Failed to load AssociateFiles state: error code 0x%08X", hr);
819 auto hr = LoadAssociateFilesStateFromKey(_engine, hkey);
820 if (hr == S_OK) {
822 } else if (hr == S_FALSE) {
824 } else if (FAILED(hr)) {
825 BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Failed to load AssociateFiles state: error code 0x%08X", hr);
891 HRESULT hr = S_OK;
965 HRESULT hr = BalInfoFindPackageById(&_bundle.packages, wzPackageId, &pPackage);
966 LPCWSTR wz = (SUCCEEDED(hr) && pPackage->sczDisplayName) ? pPackage->sczDisplayName : wzPackageId;
1049 HRESULT hr = _engine->SendEmbeddedError(dwCode, wzError, dwUIHint, &nResult);
1050 if (FAILED(hr)) {
1064 HRESULT hr = StrAllocFromError(&sczError, dwCode, nullptr);
1065 if (FAILED(hr) || !sczError || !*sczError) {
1266 HRESULT hr = _engine->SetLocalSource(wzPackageOrContainerId, wzPayloadId, ofn.lpstrFile);
1267 nResult = SUCCEEDED(hr) ? IDRETRY : IDERROR;
1310 HRESULT hr = S_OK;
1317 hr = ::CoInitialize(nullptr);
1318 BalExitOnFailure(hr, "Failed to initialize COM.");
1321 hr = ThemeInitialize(pThis->_hModule);
1322 BalExitOnFailure(hr, "Failed to initialize theme manager.");
1324 hr = pThis->InitializeData();
1325 BalExitOnFailure(hr, "Failed to initialize data in bootstrapper application.");
1329 hr = pThis->CreateMainWindow();
1330 BalExitOnFailure(hr, "Failed to create main window.");
1335 pThis->SetState(PYBA_STATE_FAILED, hr);
1339 pThis->SetState(PYBA_STATE_INITIALIZED, hr);
1346 hr = E_UNEXPECTED;
1347 BalExitOnFailure(hr, "Unexpected return value from message pump.");
1357 hr = pThis->_hrFinal;
1359 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
1367 DWORD dwQuit = HRESULT_CODE(hr);
1383 return hr;
1391 HRESULT hr = S_OK;
1404 hr = BalFormatString(L"[WixBundleOriginalSourceFolder]unattend.xml", &sczUnattendXmlPath);
1405 BalExitOnFailure(hr, "Failed to calculate path to unattend.xml");
1409 hr = S_FALSE;
1413 hr = XmlLoadDocumentFromFile(sczUnattendXmlPath, &pixdUnattend);
1414 BalExitOnFailure1(hr, "Failed to read %ls", sczUnattendXmlPath);
1417 hr = XmlSelectNodes(pixdUnattend, L"/Options/Option", &pNodes);
1418 if (S_FALSE == hr) {
1419 ExitFunction1(hr = S_OK);
1421 BalExitOnFailure(hr, "Failed to select option nodes.");
1423 hr = pNodes->get_length((long*)&cNodes);
1424 BalExitOnFailure(hr, "Failed to get option node count.");
1429 hr = XmlNextElement(pNodes, &pNode, nullptr);
1430 BalExitOnFailure(hr, "Failed to get next node.");
1433 hr = XmlGetAttributeEx(pNode, L"Name", &scz);
1434 BalExitOnFailure(hr, "Failed to get @Name.");
1437 hr = XmlGetAttribute(pNode, L"Value", &bstrValue);
1438 if (FAILED(hr) || !bstrValue || !*bstrValue) {
1439 hr = XmlGetText(pNode, &bstrValue);
1442 BalExitOnFailure(hr, "Failed to get @Value.");
1469 return hr;
1477 HRESULT hr = S_OK;
1481 hr = BalManifestLoad(_hModule, &pixdManifest);
1482 BalExitOnFailure(hr, "Failed to load bootstrapper application manifest.");
1484 hr = ParseOverridableVariablesFromXml(pixdManifest);
1485 BalExitOnFailure(hr, "Failed to read overridable variables.");
1491 hr = ParseVariablesFromUnattendXml();
1492 ExitOnFailure(hr, "Failed to read unattend.ini file.");
1494 hr = ProcessCommandLine(&_language);
1495 ExitOnFailure(hr, "Unknown commandline parameters.");
1497 hr = PathRelativeToModule(&sczModulePath, nullptr, _hModule);
1498 BalExitOnFailure(hr, "Failed to get module path.");
1500 hr = LoadLocalization(sczModulePath, _language);
1501 ExitOnFailure(hr, "Failed to load localization.");
1503 hr = LoadTheme(sczModulePath, _language);
1504 ExitOnFailure(hr, "Failed to load theme.");
1506 hr = BalInfoParseFromXml(&_bundle, pixdManifest);
1507 BalExitOnFailure(hr, "Failed to load bundle information.");
1509 hr = BalConditionsParseFromXml(&_conditions, pixdManifest, _wixLoc);
1510 BalExitOnFailure(hr, "Failed to load conditions from XML.");
1512 hr = LoadBootstrapperBAFunctions();
1513 BalExitOnFailure(hr, "Failed to load bootstrapper functions.");
1515 hr = UpdateUIStrings(_command.action);
1516 BalExitOnFailure(hr, "Failed to load UI strings.");
1524 return hr;
1532 HRESULT hr = S_OK;
1540 ExitOnNullWithLastError(argv, hr, "Failed to get command line.");
1546 hr = E_INVALIDARG;
1547 BalExitOnFailure(hr, "Must specify a language.");
1552 hr = StrAllocString(psczLanguage, &argv[i][0], 0);
1553 BalExitOnFailure(hr, "Failed to copy language.");
1561 hr = StrAllocString(&sczVariableName, argv[i], pwc - argv[i]);
1562 BalExitOnFailure(hr, "Failed to copy variable name.");
1564 hr = DictKeyExists(_overridableVariables, sczVariableName);
1565 if (E_NOTFOUND == hr) {
1567 hr = S_OK;
1570 ExitOnFailure(hr, "Failed to check the dictionary of overridable variables.");
1572 hr = StrAllocString(&sczVariableValue, ++pwc, 0);
1573 BalExitOnFailure(hr, "Failed to copy variable value.");
1576 hr = _engine->SetVariableNumeric(sczVariableName, value);
1578 hr = _engine->SetVariableString(sczVariableName, sczVariableValue);
1580 BalExitOnFailure(hr, "Failed to set variable.");
1596 return hr;
1600 HRESULT hr = S_OK;
1604 hr = LocProbeForFile(wzModulePath, wzLocFileName, wzLanguage, &sczLocPath);
1605 BalExitOnFailure2(hr, "Failed to probe for loc file: %ls in path: %ls", wzLocFileName, wzModulePath);
1607 hr = LocLoadFromFile(sczLocPath, &_wixLoc);
1608 BalExitOnFailure1(hr, "Failed to load loc file from path: %ls", sczLocPath);
1614 hr = StrAllocString(&_confirmCloseMessage, L"#(loc.ConfirmCancelMessage)", 0);
1615 ExitOnFailure(hr, "Failed to initialize confirm message loc identifier.");
1617 hr = LocLocalizeString(_wixLoc, &_confirmCloseMessage);
1618 BalExitOnFailure1(hr, "Failed to localize confirm close message: %ls", _confirmCloseMessage);
1623 return hr;
1628 HRESULT hr = S_OK;
1633 hr = LocProbeForFile(wzModulePath, wzThemeFileName, wzLanguage, &sczThemePath);
1634 BalExitOnFailure2(hr, "Failed to probe for theme file: %ls in path: %ls", wzThemeFileName, wzModulePath);
1636 hr = ThemeLoadFromFile(sczThemePath, &_theme);
1637 BalExitOnFailure1(hr, "Failed to load theme from path: %ls", sczThemePath);
1639 hr = ThemeLocalize(_theme, _wixLoc);
1640 BalExitOnFailure1(hr, "Failed to localize theme: %ls", sczThemePath);
1646 hr = BalFormatString(_theme->sczCaption, &sczCaption);
1647 if (SUCCEEDED(hr)) {
1655 return hr;
1660 HRESULT hr = S_OK;
1668 hr = XmlSelectNodes(pixdManifest, L"/BootstrapperApplicationData/WixStdbaOverridableVariable", &pNodes);
1669 if (S_FALSE == hr) {
1670 ExitFunction1(hr = S_OK);
1672 ExitOnFailure(hr, "Failed to select overridable variable nodes.");
1674 hr = pNodes->get_length((long*)&cNodes);
1675 ExitOnFailure(hr, "Failed to get overridable variable node count.");
1678 hr = DictCreateStringList(&_overridableVariables, 32, DICT_FLAG_NONE);
1679 ExitOnFailure(hr, "Failed to create the string dictionary.");
1682 hr = XmlNextElement(pNodes, &pNode, nullptr);
1683 ExitOnFailure(hr, "Failed to get next node.");
1686 hr = XmlGetAttributeEx(pNode, L"Name", &scz);
1687 ExitOnFailure(hr, "Failed to get @Name.");
1689 hr = XmlGetYesNoAttribute(pNode, L"Hidden", &hidden);
1692 hr = DictAddKey(_overridableVariables, scz);
1693 ExitOnFailure1(hr, "Failed to add \"%ls\" to the string dictionary.", scz);
1705 return hr;
1713 HRESULT hr = S_OK;
1717 hr = PathForCurrentProcess(&sczCurrentPath, nullptr);
1718 BalExitOnFailure(hr, "Failed to get bundle path.");
1720 hr = FileVersion(sczCurrentPath, &uliVersion.HighPart, &uliVersion.LowPart);
1721 BalExitOnFailure(hr, "Failed to get bundle file version.");
1723 hr = _engine->SetVariableVersion(PYBA_VARIABLE_BUNDLE_FILE_VERSION, uliVersion.QuadPart);
1724 BalExitOnFailure(hr, "Failed to set WixBundleFileVersion variable.");
1729 return hr;
1737 HRESULT hr = S_OK;
1777 ExitWithLastError(hr, "Failed to register window.");
1819 ExitOnNullWithLastError(_hWnd, hr, "Failed to create window.");
1821 hr = S_OK;
1824 return hr;
1832 HRESULT hr = S_OK;
1834 hr = ::CoCreateInstance(CLSID_TaskbarList, nullptr, CLSCTX_ALL, __uuidof(ITaskbarList3), reinterpret_cast<LPVOID*>(&_taskbarList));
1835 if (REGDB_E_CLASSNOTREG == hr) {
1837 ExitFunction1(hr = S_OK);
1839 BalExitOnFailure(hr, "Failed to create ITaskbarList3. Continuing.");
1842 BalExitOnNullWithLastError(_taskbarButtonCreatedMessage, hr, "Failed to get TaskbarButtonCreated message. Continuing.");
2007 HRESULT hr = S_OK;
2009 hr = ThemeLoadControls(_theme, hWnd, CONTROL_ID_NAMES, countof(CONTROL_ID_NAMES));
2010 BalExitOnFailure(hr, "Failed to load theme controls.");
2038 return SUCCEEDED(hr);
2114 HRESULT hr = S_OK;
2118 hr = _baFunction->OnDetect();
2119 BalExitOnFailure(hr, "Failed calling detect BA function.");
2122 SetState(PYBA_STATE_DETECTING, hr);
2132 hr = _engine->Detect();
2133 BalExitOnFailure(hr, "Failed to start detecting chain.");
2136 if (FAILED(hr)) {
2137 SetState(PYBA_STATE_DETECTING, hr);
2144 HRESULT hr = S_OK;
2171 hr = StrAllocFormatted(&locName, L"#(loc.%ls)", likeInstalling);
2172 if (SUCCEEDED(hr)) {
2173 hr = LocGetString(_wixLoc, locName, &locText);
2178 SUCCEEDED(hr) && locText ? locText->wzText : likeInstalling
2185 hr = StrAllocFormatted(&locName, L"#(loc.%ls)", likeInstallation);
2186 if (SUCCEEDED(hr)) {
2187 hr = LocGetString(_wixLoc, locName, &locText);
2192 SUCCEEDED(hr) && locText ? locText->wzText : likeInstallation
2195 return hr;
2202 HRESULT hr = S_OK;
2206 hr = UpdateUIStrings(action);
2207 BalExitOnFailure(hr, "Failed to update strings");
2214 hr = HRESULT_FROM_WIN32(ERROR_PRODUCT_VERSION);
2215 BalExitOnFailure(hr, "Cannot install a product when a newer version is installed.");
2219 SetState(PYBA_STATE_PLANNING, hr);
2226 hr = _engine->Plan(action);
2227 BalExitOnFailure(hr, "Failed to start planning packages.");
2230 if (FAILED(hr)) {
2231 SetState(PYBA_STATE_PLANNING, hr);
2242 HRESULT hr = S_OK;
2244 SetState(PYBA_STATE_APPLYING, hr);
2245 SetProgressState(hr);
2248 hr = _engine->Apply(_hWnd);
2249 BalExitOnFailure(hr, "Failed to start applying packages.");
2254 if (FAILED(hr)) {
2255 SetState(PYBA_STATE_APPLYING, hr);
2318 HRESULT hr = BalGetNumericVariable(pControl->sczName, &llValue);
2321 if (!SUCCEEDED(hr)) {
2328 SUCCEEDED(hr) && llValue ? BST_CHECKED : BST_UNCHECKED,
2336 HRESULT hr = StrAllocFormatted(&controlName, L"%lsState", pControl->sczName);
2337 if (SUCCEEDED(hr)) {
2339 hr = BalGetStringVariable(controlName, &controlState);
2340 if (SUCCEEDED(hr) && controlState && *controlState) {
2371 hr = StrAllocFormatted(&controlName, L"#(loc.%lsNote)", pControl->sczName);
2372 if (SUCCEEDED(hr)) {
2374 hr = LocGetString(_wixLoc, controlName, &locText);
2375 if (SUCCEEDED(hr) && locText && locText->wzText && locText->wzText[0]) {
2377 hr = BalFormatString(locText->wzText, &text);
2378 if (SUCCEEDED(hr) && text && text[0]) {
2387 hr = S_OK;
2400 HRESULT hr = BalFormatString(pControl->sczText, &text);
2401 if (SUCCEEDED(hr)) {
2466 HRESULT hr = S_OK;
2469 hr = BalGetStringVariable(_bundle.sczLogVariable, &sczLogFile);
2470 BalExitOnFailure1(hr, "Failed to get log file variable '%ls'.", _bundle.sczLogVariable);
2472 hr = ShelExec(L"notepad.exe", sczLogFile, L"open", nullptr, SW_SHOWDEFAULT, _hWnd, nullptr);
2473 BalExitOnFailure1(hr, "Failed to open log file target: %ls", sczLogFile);
2671 HRESULT hr = S_OK;
2677 hr = BalConditionEvaluate(pCondition, _engine, &result, &_failedMessage);
2678 BalExitOnFailure(hr, "Failed to evaluate condition.");
2684 hr = E_WIXSTDBA_CONDITION_FAILED;
2686 BalExitOnFailure1(hr, "Bundle condition evaluated to false: %ls", pCondition->sczCondition);
2693 return hr;
2698 HRESULT hr = S_OK;
2701 hr = _taskbarList->SetProgressValue(_hWnd, dwOverallPercentage, 100UL);
2702 BalExitOnFailure1(hr, "Failed to set taskbar button progress to: %d%%.", dwOverallPercentage);
2711 HRESULT hr = S_OK;
2714 hr = _taskbarList->SetProgressState(_hWnd, tbpFlags);
2715 BalExitOnFailure1(hr, "Failed to set taskbar button state.", tbpFlags);
2737 HRESULT hr = S_OK;
2740 hr = PathRelativeToModule(&sczBafPath, L"bafunctions.dll", _hModule);
2741 BalExitOnFailure(hr, "Failed to get path to BA function DLL.");
2750 BalExitOnNullWithLastError1(pfnBAFunctionCreate, hr, "Failed to get CreateBootstrapperBAFunction entry-point from: %ls", sczBafPath);
2752 hr = pfnBAFunctionCreate(_engine, _hBAFModule, &_baFunction);
2753 BalExitOnFailure(hr, "Failed to create BA function.");
2768 return hr;
2914 HRESULT hr;
2927 hr = S_FALSE;
2929 hr = S_OK;
2931 hr = HRESULT_FROM_WIN32(res);
2935 return hr;
2942 HRESULT hr;
2950 hr = pEngine->GetVariableString(L"OptionalFeaturesRegistryKey", subkeyFmt, &subkeyLen);
2951 BalExitOnFailure(hr, "Failed to locate registry key");
2953 hr = pEngine->FormatString(subkeyFmt, subkey, &subkeyLen);
2954 BalExitOnFailure1(hr, "Failed to format %ls", subkeyFmt);
2958 hr = LoadOptionalFeatureStatesFromKey(pEngine, hkHive, subkey);
2959 BalExitOnFailure1(hr, "Failed to read from HKCU\\%ls", subkey);
2960 if (hr == S_FALSE) {
2963 hr = LoadOptionalFeatureStatesFromKey(pEngine, hkHive, subkey);
2964 BalExitOnFailure1(hr, "Failed to read from HKLM\\%ls", subkey);
2965 if (hr == S_OK) {
2972 if (hr == S_OK) {
2982 hr = pEngine->GetVariableString(L"TargetDirRegistryKey", subkeyFmt, &subkeyLen);
2983 BalExitOnFailure(hr, "Failed to locate registry key");
2985 hr = pEngine->FormatString(subkeyFmt, subkey, &subkeyLen);
2986 BalExitOnFailure1(hr, "Failed to format %ls", subkeyFmt);
2997 HRESULT hr = BalGetStringVariable(L"TargetDir", &targetDir);
2998 if (FAILED(hr) || !targetDir || !targetDir[0]) {
3002 hr = BalGetNumericVariable(L"InstallAllUsers", &installAllUsers);
3003 ExitOnFailure(hr, L"Failed to get install scope");
3005 hr = BalGetStringVariable(
3009 BalExitOnFailure(hr, "Failed to get the default install directory");
3015 hr = BalFormatString(defaultDir, &targetDir);
3016 BalExitOnFailure1(hr, "Failed to format '%ls'", defaultDir);
3018 hr = _engine->SetVariableString(L"TargetDir", targetDir);
3019 BalExitOnFailure(hr, "Failed to set install target directory");
3024 return hr;
3086 HRESULT hr = BalGetNumericVariable(L"WixBundleInstalled", &llInstalled);
3087 if (SUCCEEDED(hr) && BOOTSTRAPPER_RESUME_TYPE_REBOOT != _command.resumeType && 0 < llInstalled && BOOTSTRAPPER_ACTION_INSTALL == _command.action) {
3102 HRESULT hr = BalGetStringVariable(L"WixBundleForcedRestartPackage", &_nextPackageAfterRestart);
3103 if (FAILED(hr) || !_nextPackageAfterRestart || !*_nextPackageAfterRestart) {
3246 HRESULT hr = S_OK;
3249 hr = E_INVALIDARG;
3250 ExitWithLastError(hr, "Failed to create UI thread.");
3256 ExitOnNull(pApplication, hr, E_OUTOFMEMORY, "Failed to create new standard bootstrapper application object.");
3263 return hr;