-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedgemanifestxml.cpp
More file actions
43 lines (34 loc) · 1.17 KB
/
edgemanifestxml.cpp
File metadata and controls
43 lines (34 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
#include <AppxPackaging.h>
#include <shtypes.h>
#include <atlbase.h>
void load(std::filesystem::path const & file)
{
auto const & xmlFile = file.wstring();
auto && pStream = CComPtr<IStream>();
auto hr = SHCreateStreamOnFileEx(
xmlFile.c_str(),
STGM_FAILIFTHERE,
0,
FALSE,
NULL,
&pStream
);
MX_THROW_ON_FALSE(SUCCEEDED(hr), ErrorType::HResult, hr);
auto && pAppxFactory = CComPtr<IAppxFactory>();
hr = pAppxFactory.CoCreateInstance(__uuidof(AppxFactory));
MX_THROW_ON_FALSE(SUCCEEDED(hr), ErrorType::HResult, hr);
auto && pAppxManifestReader = CComPtr<IAppxManifestReader>();
hr = pAppxFactory->CreateManifestReader(
pStream,
&pAppxManifestReader
);
MX_THROW_ON_FALSE(SUCCEEDED(hr), ErrorType::HResult, hr);
auto && pAppxManifestPackageId = CComPtr<IAppxManifestPackageId>();
hr = pAppxManifestReader->GetPackageId(&pAppxManifestPackageId);
MX_THROW_ON_FALSE(SUCCEEDED(hr), ErrorType::HResult, hr);
auto appxVersion = UINT64{ 0 };
hr = pAppxManifestPackageId->GetVersion(&appxVersion);
MX_THROW_ON_FALSE(SUCCEEDED(hr), ErrorType::HResult, hr);
}
*/