comparison win/edge.cpp @ 2123:589896c07c91

Win: Use GetTempPathW() to get a location for the embedded Edge (Chromium) data. This allows apps to run from \Program Files\ since the apps can't normally write to this location, prior to this change trying to open a web view would fail after install.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 25 Jun 2020 00:00:48 +0000
parents 9a5dbda8f2ab
children f9a2fc59611c
comparison
equal deleted inserted replaced
2122:7ba8c8ff548f 2123:589896c07c91
224 WebHost->put_IsVisible(TRUE); 224 WebHost->put_IsVisible(TRUE);
225 } 225 }
226 226
227 BOOL EdgeBrowser::Detect(VOID) 227 BOOL EdgeBrowser::Detect(VOID)
228 { 228 {
229 CreateCoreWebView2EnvironmentWithOptions(nullptr, nullptr, nullptr, 229 WCHAR tempdir[MAX_PATH+1];
230
231 GetTempPathW(MAX_PATH, tempdir);
232
233 CreateCoreWebView2EnvironmentWithOptions(nullptr, tempdir, nullptr,
230 Callback<ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler>( 234 Callback<ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler>(
231 [this](HRESULT result, ICoreWebView2Environment* env) -> HRESULT { 235 [this](HRESULT result, ICoreWebView2Environment* env) -> HRESULT {
232 // Successfully created Edge environment, return TRUE 236 // Successfully created Edge environment, return TRUE
233 Env = env; 237 Env = env;
234 return S_OK; 238 return S_OK;