Home | History | Annotate | Download | only in bootstrap

Lines Matching refs:hr

271         HRESULT hr = S_OK;
288 hr = BalGetNumericVariable(L"InstallAllUsers", &installAllUsers);
289 ExitOnFailure(hr, L"Failed to get install scope");
291 hr = _engine->SetVariableNumeric(L"CompileAll", installAllUsers);
292 ExitOnFailure(hr, L"Failed to update CompileAll");
294 hr = EnsureTargetDir();
295 ExitOnFailure(hr, L"Failed to set TargetDir");
326 hr = EnsureTargetDir();
327 ExitOnFailure(hr, L"Failed to set TargetDir");
329 hr = BalGetStringVariable(L"TargetDir", &targetDir);
330 if (SUCCEEDED(hr)) {
370 hr = BalGetStringVariable(
375 if (SUCCEEDED(hr) && defaultDir) {
384 hr = BalGetStringVariable(
388 if (SUCCEEDED(hr) && defaultDir && defaultDir[0] && SUCCEEDED(BalFormatString(defaultDir, &formatted))) {
480 HRESULT hr;
503 hr = BalGetStringVariable(L"TargetDir", &targetDir);
504 if (SUCCEEDED(hr) && targetDir && targetDir[0]) {
507 } else if (SUCCEEDED(hr)) {
512 hr = BalGetStringVariable(L"DefaultCustomTargetDir", &defaultTargetDir);
513 if (SUCCEEDED(hr) && defaultTargetDir && !defaultTargetDir[0]) {
517 hr = BalGetStringVariable(
522 if (SUCCEEDED(hr) && defaultTargetDir) {
540 HRESULT hr = S_OK;
550 hr = LocGetString(_wixLoc, L"#(loc.SuccessInstallMessage)", &successText);
553 hr = LocGetString(_wixLoc, L"#(loc.SuccessModifyMessage)", &successText);
556 hr = LocGetString(_wixLoc, L"#(loc.SuccessRepairMessage)", &successText);
559 hr = LocGetString(_wixLoc, L"#(loc.SuccessRemoveMessage)", &successText);
661 HRESULT hr = BalGetStringVariable(L"TargetDir", &targetDir);
662 if (FAILED(hr) || !targetDir || !targetDir[0]) {
690 HRESULT hr = S_OK;
696 ExitWithLastError(hr, "Failed to create UI thread.");
700 return hr;
731 auto hr = LoadAssociateFilesStateFromKey(_engine, fPerMachine ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER);
732 if (hr == S_OK) {
734 } else if (FAILED(hr)) {
735 BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Failed to load AssociateFiles state: error code 0x%08X", hr);
814 auto hr = LoadAssociateFilesStateFromKey(_engine, hkey);
815 if (hr == S_OK) {
817 } else if (FAILED(hr)) {
818 BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Failed to load AssociateFiles state: error code 0x%08X", hr);
866 HRESULT hr = S_OK;
940 HRESULT hr = BalInfoFindPackageById(&_bundle.packages, wzPackageId, &pPackage);
941 LPCWSTR wz = (SUCCEEDED(hr) && pPackage->sczDisplayName) ? pPackage->sczDisplayName : wzPackageId;
1024 HRESULT hr = _engine->SendEmbeddedError(dwCode, wzError, dwUIHint, &nResult);
1025 if (FAILED(hr)) {
1039 HRESULT hr = StrAllocFromError(&sczError, dwCode, nullptr);
1040 if (FAILED(hr) || !sczError || !*sczError) {
1241 HRESULT hr = _engine->SetLocalSource(wzPackageOrContainerId, wzPayloadId, ofn.lpstrFile);
1242 nResult = SUCCEEDED(hr) ? IDRETRY : IDERROR;
1285 HRESULT hr = S_OK;
1292 hr = ::CoInitialize(nullptr);
1293 BalExitOnFailure(hr, "Failed to initialize COM.");
1296 hr = ThemeInitialize(pThis->_hModule);
1297 BalExitOnFailure(hr, "Failed to initialize theme manager.");
1299 hr = pThis->InitializeData();
1300 BalExitOnFailure(hr, "Failed to initialize data in bootstrapper application.");
1304 hr = pThis->CreateMainWindow();
1305 BalExitOnFailure(hr, "Failed to create main window.");
1310 pThis->SetState(PYBA_STATE_FAILED, hr);
1314 pThis->SetState(PYBA_STATE_INITIALIZED, hr);
1321 hr = E_UNEXPECTED;
1322 BalExitOnFailure(hr, "Unexpected return value from message pump.");
1332 hr = pThis->_hrFinal;
1334 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
1342 DWORD dwQuit = HRESULT_CODE(hr);
1358 return hr;
1366 HRESULT hr = S_OK;
1379 hr = BalFormatString(L"[WixBundleOriginalSourceFolder]unattend.xml", &sczUnattendXmlPath);
1380 BalExitOnFailure(hr, "Failed to calculate path to unattend.xml");
1384 hr = S_FALSE;
1388 hr = XmlLoadDocumentFromFile(sczUnattendXmlPath, &pixdUnattend);
1389 BalExitOnFailure1(hr, "Failed to read %ls", sczUnattendXmlPath);
1392 hr = XmlSelectNodes(pixdUnattend, L"/Options/Option", &pNodes);
1393 if (S_FALSE == hr) {
1394 ExitFunction1(hr = S_OK);
1396 BalExitOnFailure(hr, "Failed to select option nodes.");
1398 hr = pNodes->get_length((long*)&cNodes);
1399 BalExitOnFailure(hr, "Failed to get option node count.");
1404 hr = XmlNextElement(pNodes, &pNode, nullptr);
1405 BalExitOnFailure(hr, "Failed to get next node.");
1408 hr = XmlGetAttributeEx(pNode, L"Name", &scz);
1409 BalExitOnFailure(hr, "Failed to get @Name.");
1412 hr = XmlGetAttribute(pNode, L"Value", &bstrValue);
1413 if (FAILED(hr) || !bstrValue || !*bstrValue) {
1414 hr = XmlGetText(pNode, &bstrValue);
1417 BalExitOnFailure(hr, "Failed to get @Value.");
1444 return hr;
1452 HRESULT hr = S_OK;
1456 hr = BalManifestLoad(_hModule, &pixdManifest);
1457 BalExitOnFailure(hr, "Failed to load bootstrapper application manifest.");
1459 hr = ParseOverridableVariablesFromXml(pixdManifest);
1460 BalExitOnFailure(hr, "Failed to read overridable variables.");
1462 hr = ParseVariablesFromUnattendXml();
1463 ExitOnFailure(hr, "Failed to read unattend.ini file.");
1465 hr = ProcessCommandLine(&_language);
1466 ExitOnFailure(hr, "Unknown commandline parameters.");
1468 hr = PathRelativeToModule(&sczModulePath, nullptr, _hModule);
1469 BalExitOnFailure(hr, "Failed to get module path.");
1471 hr = LoadLocalization(sczModulePath, _language);
1472 ExitOnFailure(hr, "Failed to load localization.");
1474 hr = LoadTheme(sczModulePath, _language);
1475 ExitOnFailure(hr, "Failed to load theme.");
1477 hr = BalInfoParseFromXml(&_bundle, pixdManifest);
1478 BalExitOnFailure(hr, "Failed to load bundle information.");
1480 hr = BalConditionsParseFromXml(&_conditions, pixdManifest, _wixLoc);
1481 BalExitOnFailure(hr, "Failed to load conditions from XML.");
1483 hr = LoadBootstrapperBAFunctions();
1484 BalExitOnFailure(hr, "Failed to load bootstrapper functions.");
1486 hr = UpdateUIStrings(_command.action);
1487 BalExitOnFailure(hr, "Failed to load UI strings.");
1499 return hr;
1507 HRESULT hr = S_OK;
1515 ExitOnNullWithLastError(argv, hr, "Failed to get command line.");
1521 hr = E_INVALIDARG;
1522 BalExitOnFailure(hr, "Must specify a language.");
1527 hr = StrAllocString(psczLanguage, &argv[i][0], 0);
1528 BalExitOnFailure(hr, "Failed to copy language.");
1536 hr = StrAllocString(&sczVariableName, argv[i], pwc - argv[i]);
1537 BalExitOnFailure(hr, "Failed to copy variable name.");
1539 hr = DictKeyExists(_overridableVariables, sczVariableName);
1540 if (E_NOTFOUND == hr) {
1542 hr = S_OK;
1545 ExitOnFailure(hr, "Failed to check the dictionary of overridable variables.");
1547 hr = StrAllocString(&sczVariableValue, ++pwc, 0);
1548 BalExitOnFailure(hr, "Failed to copy variable value.");
1551 hr = _engine->SetVariableNumeric(sczVariableName, value);
1553 hr = _engine->SetVariableString(sczVariableName, sczVariableValue);
1555 BalExitOnFailure(hr, "Failed to set variable.");
1571 return hr;
1575 HRESULT hr = S_OK;
1579 hr = LocProbeForFile(wzModulePath, wzLocFileName, wzLanguage, &sczLocPath);
1580 BalExitOnFailure2(hr, "Failed to probe for loc file: %ls in path: %ls", wzLocFileName, wzModulePath);
1582 hr = LocLoadFromFile(sczLocPath, &_wixLoc);
1583 BalExitOnFailure1(hr, "Failed to load loc file from path: %ls", sczLocPath);
1589 hr = StrAllocString(&_confirmCloseMessage, L"#(loc.ConfirmCancelMessage)", 0);
1590 ExitOnFailure(hr, "Failed to initialize confirm message loc identifier.");
1592 hr = LocLocalizeString(_wixLoc, &_confirmCloseMessage);
1593 BalExitOnFailure1(hr, "Failed to localize confirm close message: %ls", _confirmCloseMessage);
1598 return hr;
1603 HRESULT hr = S_OK;
1608 hr = LocProbeForFile(wzModulePath, wzThemeFileName, wzLanguage, &sczThemePath);
1609 BalExitOnFailure2(hr, "Failed to probe for theme file: %ls in path: %ls", wzThemeFileName, wzModulePath);
1611 hr = ThemeLoadFromFile(sczThemePath, &_theme);
1612 BalExitOnFailure1(hr, "Failed to load theme from path: %ls", sczThemePath);
1614 hr = ThemeLocalize(_theme, _wixLoc);
1615 BalExitOnFailure1(hr, "Failed to localize theme: %ls", sczThemePath);
1621 hr = BalFormatString(_theme->sczCaption, &sczCaption);
1622 if (SUCCEEDED(hr)) {
1630 return hr;
1635 HRESULT hr = S_OK;
1643 hr = XmlSelectNodes(pixdManifest, L"/BootstrapperApplicationData/WixStdbaOverridableVariable", &pNodes);
1644 if (S_FALSE == hr) {
1645 ExitFunction1(hr = S_OK);
1647 ExitOnFailure(hr, "Failed to select overridable variable nodes.");
1649 hr = pNodes->get_length((long*)&cNodes);
1650 ExitOnFailure(hr, "Failed to get overridable variable node count.");
1653 hr = DictCreateStringList(&_overridableVariables, 32, DICT_FLAG_NONE);
1654 ExitOnFailure(hr, "Failed to create the string dictionary.");
1657 hr = XmlNextElement(pNodes, &pNode, nullptr);
1658 ExitOnFailure(hr, "Failed to get next node.");
1661 hr = XmlGetAttributeEx(pNode, L"Name", &scz);
1662 ExitOnFailure(hr, "Failed to get @Name.");
1664 hr = XmlGetYesNoAttribute(pNode, L"Hidden", &hidden);
1667 hr = DictAddKey(_overridableVariables, scz);
1668 ExitOnFailure1(hr, "Failed to add \"%ls\" to the string dictionary.", scz);
1680 return hr;
1688 HRESULT hr = S_OK;
1692 hr = PathForCurrentProcess(&sczCurrentPath, nullptr);
1693 BalExitOnFailure(hr, "Failed to get bundle path.");
1695 hr = FileVersion(sczCurrentPath, &uliVersion.HighPart, &uliVersion.LowPart);
1696 BalExitOnFailure(hr, "Failed to get bundle file version.");
1698 hr = _engine->SetVariableVersion(PYBA_VARIABLE_BUNDLE_FILE_VERSION, uliVersion.QuadPart);
1699 BalExitOnFailure(hr, "Failed to set WixBundleFileVersion variable.");
1704 return hr;
1712 HRESULT hr = S_OK;
1752 ExitWithLastError(hr, "Failed to register window.");
1794 ExitOnNullWithLastError(_hWnd, hr, "Failed to create window.");
1796 hr = S_OK;
1799 return hr;
1807 HRESULT hr = S_OK;
1809 hr = ::CoCreateInstance(CLSID_TaskbarList, nullptr, CLSCTX_ALL, __uuidof(ITaskbarList3), reinterpret_cast<LPVOID*>(&_taskbarList));
1810 if (REGDB_E_CLASSNOTREG == hr) {
1812 ExitFunction1(hr = S_OK);
1814 BalExitOnFailure(hr, "Failed to create ITaskbarList3. Continuing.");
1817 BalExitOnNullWithLastError(_taskbarButtonCreatedMessage, hr, "Failed to get TaskbarButtonCreated message. Continuing.");
1982 HRESULT hr = S_OK;
1984 hr = ThemeLoadControls(_theme, hWnd, CONTROL_ID_NAMES, countof(CONTROL_ID_NAMES));
1985 BalExitOnFailure(hr, "Failed to load theme controls.");
2013 return SUCCEEDED(hr);
2089 HRESULT hr = S_OK;
2093 hr = _baFunction->OnDetect();
2094 BalExitOnFailure(hr, "Failed calling detect BA function.");
2097 SetState(PYBA_STATE_DETECTING, hr);
2107 hr = _engine->Detect();
2108 BalExitOnFailure(hr, "Failed to start detecting chain.");
2111 if (FAILED(hr)) {
2112 SetState(PYBA_STATE_DETECTING, hr);
2119 HRESULT hr = S_OK;
2146 hr = StrAllocFormatted(&locName, L"#(loc.%ls)", likeInstalling);
2147 if (SUCCEEDED(hr)) {
2148 hr = LocGetString(_wixLoc, locName, &locText);
2153 SUCCEEDED(hr) && locText ? locText->wzText : likeInstalling
2160 hr = StrAllocFormatted(&locName, L"#(loc.%ls)", likeInstallation);
2161 if (SUCCEEDED(hr)) {
2162 hr = LocGetString(_wixLoc, locName, &locText);
2167 SUCCEEDED(hr) && locText ? locText->wzText : likeInstallation
2170 return hr;
2177 HRESULT hr = S_OK;
2181 hr = UpdateUIStrings(action);
2182 BalExitOnFailure(hr, "Failed to update strings");
2189 hr = HRESULT_FROM_WIN32(ERROR_PRODUCT_VERSION);
2190 BalExitOnFailure(hr, "Cannot install a product when a newer version is installed.");
2194 SetState(PYBA_STATE_PLANNING, hr);
2201 hr = _engine->Plan(action);
2202 BalExitOnFailure(hr, "Failed to start planning packages.");
2205 if (FAILED(hr)) {
2206 SetState(PYBA_STATE_PLANNING, hr);
2217 HRESULT hr = S_OK;
2219 SetState(PYBA_STATE_APPLYING, hr);
2220 SetProgressState(hr);
2223 hr = _engine->Apply(_hWnd);
2224 BalExitOnFailure(hr, "Failed to start applying packages.");
2229 if (FAILED(hr)) {
2230 SetState(PYBA_STATE_APPLYING, hr);
2293 HRESULT hr = BalGetNumericVariable(pControl->sczName, &llValue);
2296 if (!SUCCEEDED(hr)) {
2303 SUCCEEDED(hr) && llValue ? BST_CHECKED : BST_UNCHECKED,
2311 HRESULT hr = StrAllocFormatted(&controlName, L"%lsState", pControl->sczName);
2312 if (SUCCEEDED(hr)) {
2314 hr = BalGetStringVariable(controlName, &controlState);
2315 if (SUCCEEDED(hr) && controlState && *controlState) {
2346 hr = StrAllocFormatted(&controlName, L"#(loc.%lsNote)", pControl->sczName);
2347 if (SUCCEEDED(hr)) {
2349 hr = LocGetString(_wixLoc, controlName, &locText);
2350 if (SUCCEEDED(hr) && locText && locText->wzText && locText->wzText[0]) {
2352 hr = BalFormatString(locText->wzText, &text);
2353 if (SUCCEEDED(hr) && text && text[0]) {
2362 hr = S_OK;
2375 HRESULT hr = BalFormatString(pControl->sczText, &text);
2376 if (SUCCEEDED(hr)) {
2441 HRESULT hr = S_OK;
2444 hr = BalGetStringVariable(_bundle.sczLogVariable, &sczLogFile);
2445 BalExitOnFailure1(hr, "Failed to get log file variable '%ls'.", _bundle.sczLogVariable);
2447 hr = ShelExec(L"notepad.exe", sczLogFile, L"open", nullptr, SW_SHOWDEFAULT, _hWnd, nullptr);
2448 BalExitOnFailure1(hr, "Failed to open log file target: %ls", sczLogFile);
2654 HRESULT hr = BalGetNumericVariable(L"WixBundleElevated", &elevated);
2655 if (SUCCEEDED(hr) && elevated) {
2661 hr = LocGetString(_wixLoc, L"#(loc.ElevateForCRTInstall)", &locStr);
2662 if (FAILED(hr)) {
2663 BalLogError(hr, "Failed to get ElevateForCRTInstall string");
2670 HRESULT hr = S_OK;
2676 hr = BalConditionEvaluate(pCondition, _engine, &result, &_failedMessage);
2677 BalExitOnFailure(hr, "Failed to evaluate condition.");
2683 hr = E_WIXSTDBA_CONDITION_FAILED;
2685 BalExitOnFailure1(hr, "Bundle condition evaluated to false: %ls", pCondition->sczCondition);
2692 return hr;
2697 HRESULT hr = S_OK;
2700 hr = _taskbarList->SetProgressValue(_hWnd, dwOverallPercentage, 100UL);
2701 BalExitOnFailure1(hr, "Failed to set taskbar button progress to: %d%%.", dwOverallPercentage);
2710 HRESULT hr = S_OK;
2713 hr = _taskbarList->SetProgressState(_hWnd, tbpFlags);
2714 BalExitOnFailure1(hr, "Failed to set taskbar button state.", tbpFlags);
2736 HRESULT hr = S_OK;
2739 hr = PathRelativeToModule(&sczBafPath, L"bafunctions.dll", _hModule);
2740 BalExitOnFailure(hr, "Failed to get path to BA function DLL.");
2749 BalExitOnNullWithLastError1(pfnBAFunctionCreate, hr, "Failed to get CreateBootstrapperBAFunction entry-point from: %ls", sczBafPath);
2751 hr = pfnBAFunctionCreate(_engine, _hBAFModule, &_baFunction);
2752 BalExitOnFailure(hr, "Failed to create BA function.");
2767 return hr;
2902 HRESULT hr;
2915 hr = S_FALSE;
2917 hr = S_OK;
2919 hr = HRESULT_FROM_WIN32(res);
2923 return hr;
2930 HRESULT hr;
2943 hr = pEngine->GetVariableString(L"OptionalFeaturesRegistryKey", subkeyFmt, &subkeyLen);
2944 BalExitOnFailure(hr, "Failed to locate registry key");
2946 hr = pEngine->FormatString(subkeyFmt, subkey, &subkeyLen);
2947 BalExitOnFailure1(hr, "Failed to format %ls", subkeyFmt);
2951 hr = LoadOptionalFeatureStatesFromKey(pEngine, hkHive, subkey);
2952 BalExitOnFailure1(hr, "Failed to read from HKCU\\%ls", subkey);
2953 if (hr == S_FALSE) {
2956 hr = LoadOptionalFeatureStatesFromKey(pEngine, hkHive, subkey);
2957 BalExitOnFailure1(hr, "Failed to read from HKLM\\%ls", subkey);
2958 if (hr == S_OK) {
2965 if (hr == S_OK) {
2975 hr = pEngine->GetVariableString(L"TargetDirRegistryKey", subkeyFmt, &subkeyLen);
2976 BalExitOnFailure(hr, "Failed to locate registry key");
2978 hr = pEngine->FormatString(subkeyFmt, subkey, &subkeyLen);
2979 BalExitOnFailure1(hr, "Failed to format %ls", subkeyFmt);
2990 HRESULT hr = BalGetStringVariable(L"TargetDir", &targetDir);
2991 if (FAILED(hr) || !targetDir || !targetDir[0]) {
2995 hr = BalGetNumericVariable(L"InstallAllUsers", &installAllUsers);
2996 ExitOnFailure(hr, L"Failed to get install scope");
2998 hr = BalGetStringVariable(
3002 BalExitOnFailure(hr, "Failed to get the default install directory");
3008 hr = BalFormatString(defaultDir, &targetDir);
3009 BalExitOnFailure1(hr, "Failed to format '%ls'", defaultDir);
3011 hr = _engine->SetVariableString(L"TargetDir", targetDir);
3012 BalExitOnFailure(hr, "Failed to set install target directory");
3017 return hr;
3087 HRESULT hr = BalGetNumericVariable(L"WixBundleInstalled", &llInstalled);
3088 if (SUCCEEDED(hr) && BOOTSTRAPPER_RESUME_TYPE_REBOOT != _command.resumeType && 0 < llInstalled && BOOTSTRAPPER_ACTION_INSTALL == _command.action) {
3103 HRESULT hr = BalGetStringVariable(L"WixBundleForcedRestartPackage", &_nextPackageAfterRestart);
3104 if (FAILED(hr) || !_nextPackageAfterRestart || !*_nextPackageAfterRestart) {
3247 HRESULT hr = S_OK;
3250 hr = E_INVALIDARG;
3251 ExitWithLastError(hr, "Failed to create UI thread.");
3257 ExitOnNull(pApplication, hr, E_OUTOFMEMORY, "Failed to create new standard bootstrapper application object.");
3264 return hr;