8
8
#include < guiddef.h>
9
9
10
10
#include " base/containers/cxx20_erase.h"
11
+ #include " brave/components/brave_vpn/common/buildflags/buildflags.h"
12
+ #include " build/build_config.h"
11
13
#include " chrome/install_static/install_util.h"
12
14
13
15
namespace brave_vpn {
14
16
15
17
namespace {
18
+ // Registry path to Wireguard vpn service storage.
19
+ constexpr wchar_t kBraveVpnWireguardServiceRegistryStoragePath [] =
20
+ L" Software\\ BraveSoftware\\ Vpn\\ " ;
21
+
22
+ // The service installed to %(VersionDir)s\BraveVpnWireguardService
23
+ constexpr wchar_t kBraveVpnWireguardServiceSubFolder [] =
24
+ L" BraveVpnWireguardService" ;
25
+
26
+ #if BUILDFLAG(CHANNEL_NIGHTLY)
27
+ constexpr wchar_t kBraveWireguardTunnelServiceName [] =
28
+ L" BraveVpnNightlyWireguardTunnelService" ;
29
+ // 8C2EE50E-9130-4B30-84C1-34753BF26E1B
30
+ constexpr IID kBraveWireguardServiceIID = {
31
+ 0x8c2ee50e ,
32
+ 0x9130 ,
33
+ 0x4b30 ,
34
+ {0x84 , 0xc1 , 0x34 , 0x75 , 0x3b , 0xf2 , 0x6e , 0x18 }};
35
+ // A8D57D90-7A29-4405-91D7-A712F347E426
36
+ constexpr CLSID kBraveWireguardServiceCLSID = {
37
+ 0xa8d57d90 ,
38
+ 0x7a29 ,
39
+ 0x4405 ,
40
+ {0x91 , 0xd7 , 0xa7 , 0x12 , 0xf3 , 0x47 , 0xe4 , 0x26 }};
41
+ #elif BUILDFLAG(CHANNEL_BETA)
42
+ constexpr wchar_t kBraveWireguardTunnelServiceName [] =
43
+ L" BraveVpnBetaWireguardTunnelService" ;
44
+ // FB4C65B6-98B4-426B-8B11-5DB735526A84
45
+ constexpr IID kBraveWireguardServiceIID = {
46
+ 0xfb4c65b6 ,
47
+ 0x98b4 ,
48
+ 0x426b ,
49
+ {0x8b , 0x11 , 0x5d , 0xb7 , 0x35 , 0x52 , 0x6a , 0x84 }};
50
+ // 93175676-5FAC-4D73-B1E1-5485003C9427
51
+ constexpr CLSID kBraveWireguardServiceCLSID = {
52
+ 0x93175676 ,
53
+ 0x5fac ,
54
+ 0x4d73 ,
55
+ {0xb1 , 0xe1 , 0x54 , 0x85 , 0x00 , 0x3c , 0x94 , 0x27 }};
56
+ #elif BUILDFLAG(CHANNEL_DEV)
57
+ constexpr wchar_t kBraveWireguardTunnelServiceName [] =
58
+ L" BraveVpnDevWireguardTunnelService" ;
59
+ // E278A30A-CA8C-4885-A468-67741705A518
60
+ constexpr IID kBraveWireguardServiceIID = {
61
+ 0xe278a30a ,
62
+ 0xca8c ,
63
+ 0x4885 ,
64
+ {0xa4 , 0x68 , 0x67 , 0x74 , 0x17 , 0x05 , 0xa5 , 0x18 }};
65
+ // 52C95DE1-D7D9-4C03-A275-8A4517AFAE08
66
+ constexpr CLSID kBraveWireguardServiceCLSID = {
67
+ 0x52c95de1 ,
68
+ 0xd7d9 ,
69
+ 0x4c03 ,
70
+ {0xa2 , 0x75 , 0x8a , 0x45 , 0x17 , 0xaf , 0xae , 0x08 }};
71
+ #elif BUILDFLAG(CHANNEL_DEVELOPMENT)
72
+ constexpr wchar_t kBraveWireguardTunnelServiceName [] =
73
+ L" BraveVpnDevelopmentWireguardTunnelService" ;
74
+ // 048EC63C-E2F2-4288-BEA0-DB58AD9CC20E
75
+ constexpr IID kBraveWireguardServiceIID = {
76
+ 0x048ec63c ,
77
+ 0xe2f2 ,
78
+ 0x4288 ,
79
+ {0xbe , 0xa0 , 0xd8 , 0x58 , 0xad , 0x9c , 0xc2 , 0x0e }};
80
+ // 57B73EDD-CBE4-46CA-8ACB-11D90840AF6E
81
+ constexpr CLSID kBraveWireguardServiceCLSID = {
82
+ 0x57b73edd ,
83
+ 0xcbe4 ,
84
+ 0x46ca ,
85
+ {0x8a , 0xcb , 0x11 , 0xd9 , 0x08 , 0x40 , 0xaf , 0x6e }};
86
+ #else
87
+ constexpr wchar_t kBraveWireguardTunnelServiceName [] =
88
+ L" BraveVpnWireguardTunnelService" ;
89
+
16
90
// 053057AB-CF06-4E6C-BBAD-F8DA6436D933
17
91
constexpr IID kBraveWireguardServiceIID = {
18
92
0x053057ab ,
@@ -25,12 +99,15 @@ constexpr CLSID kBraveWireguardServiceCLSID = {
25
99
0xb213 ,
26
100
0x4a8e ,
27
101
{0x98 , 0xad , 0x9d , 0x64 , 0xd8 , 0x91 , 0x39 , 0x68 }};
28
-
29
- constexpr wchar_t kBraveWireguardTunnelServiceName [] =
30
- L" BraveWireGuardTunnelService" ;
102
+ #endif
31
103
32
104
} // namespace
33
105
106
+ std::wstring GetBraveVpnWireguardServiceRegistryStoragePath () {
107
+ return kBraveVpnWireguardServiceRegistryStoragePath +
108
+ GetBraveVpnWireguardServiceName ();
109
+ }
110
+
34
111
// Returns the Brave Vpn Service CLSID, IID, Name, and Display Name
35
112
// respectively.
36
113
const CLSID& GetBraveVpnWireguardServiceClsid () {
@@ -56,4 +133,12 @@ std::wstring GetBraveVpnWireguardServiceName() {
56
133
std::wstring GetBraveVpnWireguardTunnelServiceName () {
57
134
return kBraveWireguardTunnelServiceName ;
58
135
}
136
+
137
+ base::FilePath GetBraveVPNWireguardServiceInstallationPath (
138
+ const base::FilePath& target_path,
139
+ const base::Version& version) {
140
+ return target_path.AppendASCII (version.GetString ())
141
+ .Append (brave_vpn::kBraveVpnWireguardServiceSubFolder )
142
+ .Append (brave_vpn::kBraveVpnWireguardServiceExecutable );
143
+ }
59
144
} // namespace brave_vpn
0 commit comments