WslcService¶
Static entry points over the service-level C API.
Methods
GetMissingComponents()GetVersion()InstallWithDependencies()InstallWithDependenciesAsync()
Behavior notes
GetMissingComponents()returns aComponentbitmask.GetVersion()returns aServiceVersionconstructed frommajor,minor, andrevision.InstallWithDependencies()installs dependencies synchronously.InstallWithDependenciesAsync()runs on a background thread and reportsInstallProgress.
auto missing = WslcService::GetMissingComponents();
if (missing != static_cast<Component>(0))
{
auto install = WslcService::InstallWithDependenciesAsync();
install.Progress([](auto&&, InstallProgress const& p)
{
printf("install %u/%u\n", p.Progress(), p.Total());
});
co_await install;
}