Pass to win10 installer on 1709 or greater
@@ -58,10 +58,27 @@ int main(int argc, char * argv[])
}
}
else
+ {
+ if (IsWindows10RS3OrLater())
+ {
+ const int bufSize = 1024;
+ wchar_t path[bufSize];
+ if (!GetFullPathNameW(cli.GetPackageFilePathToInstall().c_str(), bufSize, path, nullptr))
+ {
+ return HRESULT_FROM_WIN32(GetLastError());
+ }
+
+ std::wstring protocol = std::wstring(L"ms-appinstaller:?source=");
+ protocol.append(path);
+
+ ShellExecuteW(nullptr, L"Open", protocol.c_str(), nullptr, nullptr, SW_SHOWNORMAL);
+ }
+ else
{
auto ui = new UI(packageManager, cli.GetPackageFilePathToInstall(), UIType::InstallUIAdd);
ui->ShowUI();
}
+ }
break;
}
case OperationType::Remove:
