| 85 | |
| 86 | |
| 87 | static HRESULT UnregisterSparsePackage() |
| 88 | { |
| 89 | // Cannot handle sparse packages in safe-mode |
| 90 | if (GetSystemMetrics(SM_CLEANBOOT) > 0) |
| 91 | return S_FALSE; |
| 92 | |
| 93 | const Package package = GetSparsePackage(); |
| 94 | if (package == NULL) |
| 95 | return S_FALSE; |
| 96 | |
| 97 | PackageManager packageManager; |
| 98 | winrt::hstring fullName = package.Id().FullName(); |
| 99 | auto deploymentOperation = packageManager.RemovePackageAsync(fullName, RemovalOptions::RemoveForAllUsers); |
| 100 | auto deployResult = deploymentOperation.get(); |
| 101 | |
| 102 | if (FAILED(deployResult.ExtendedErrorCode())) |
| 103 | return deployResult.ExtendedErrorCode(); |
| 104 | |
| 105 | return S_OK; |
| 106 | } |
| 107 | |
| 108 | STDAPI MediaInfo_SparsePackage::Installer::Install() |
| 109 | { |
no test coverage detected