Files
WSL/doc/docs/api-reference/cpp/data-classes/installprogress.md
0704fa160b Update WSLC SDK API documentation (#41677)
* Update WSLC SDK API documentation

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update docs

* Update docs

* Quick fixes

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Craig Loewen <crloewen@microsoft.com>
2026-09-29 10:14:54 -04:00

889 B

InstallProgress

Progress item reported by WslcService::InstallWithDependenciesAsync(InstallOptions).

Properties

Property Type
Component() Component
Progress() uint32_t
Total() uint32_t
auto missing = WslcService::GetMissingComponents();
for (auto component : missing)
{
    if (component == Component::SdkNeedsUpdate)
    {
        // Installing components cannot resolve this compatibility error.
        co_return;
    }
}

if (missing.Size() != 0)
{
    InstallOptions options;
    options.Components(missing);
    auto install = WslcService::InstallWithDependenciesAsync(options);
    install.Progress([](auto&&, InstallProgress const& p)
    {
        printf("component=%d step=%u/%u\n",
            static_cast<int>(p.Component()),
            p.Progress(),
            p.Total());
    });
    co_await install;
}