FIX: register source in HKEY_CURRENT_USER
Change-Id: I7e9cd0b4a85b5c6bfc68c93e7037c70e98119a2e Jira: STUDIO-4854 (cherry picked from commit 9977c3702ba08287a9623bd1b43a42a953bcdda7)
This commit is contained in:
parent
20f86fac4e
commit
fd25b604a6
|
@ -71,8 +71,10 @@ void wxMediaCtrl2::Load(wxURI url)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
wxRegKey key1(wxRegKey::HKCR, L"CLSID\\" CLSID_BAMBU_SOURCE L"\\InProcServer32");
|
wxRegKey key11(wxRegKey::HKCU, L"SOFTWARE\\Classes\\CLSID\\" CLSID_BAMBU_SOURCE L"\\InProcServer32");
|
||||||
wxString path = key1.Exists() ? key1.QueryDefaultValue() : wxString{};
|
wxRegKey key12(wxRegKey::HKCR, L"CLSID\\" CLSID_BAMBU_SOURCE L"\\InProcServer32");
|
||||||
|
wxString path = key11.Exists() ? key11.QueryDefaultValue()
|
||||||
|
: key12.Exists() ? key12.QueryDefaultValue() : wxString{};
|
||||||
wxRegKey key2(wxRegKey::HKCR, "bambu");
|
wxRegKey key2(wxRegKey::HKCR, "bambu");
|
||||||
wxString clsid;
|
wxString clsid;
|
||||||
if (key2.Exists())
|
if (key2.Exists())
|
||||||
|
@ -108,7 +110,7 @@ void wxMediaCtrl2::Load(wxURI url)
|
||||||
if (path != dll_path) {
|
if (path != dll_path) {
|
||||||
static bool notified = false;
|
static bool notified = false;
|
||||||
if (!notified) CallAfter([dll_path] {
|
if (!notified) CallAfter([dll_path] {
|
||||||
int res = wxMessageBox(_L("Using a BambuSource from a different install, video play may not work correctly!"), _L("Warning"), wxOK | wxICON_WARNING);
|
int res = wxMessageBox(_L("Using a BambuSource from a different install, video play may not work correctly! Press Yes to re-register it."), _L("Warning"), wxYES_NO | wxICON_WARNING);
|
||||||
if (res == wxYES) {
|
if (res == wxYES) {
|
||||||
SHELLEXECUTEINFO info{sizeof(info), 0, NULL, L"runas", L"regsvr32", dll_path.wstring().c_str(), SW_HIDE};
|
SHELLEXECUTEINFO info{sizeof(info), 0, NULL, L"runas", L"regsvr32", dll_path.wstring().c_str(), SW_HIDE};
|
||||||
::ShellExecuteEx(&info);
|
::ShellExecuteEx(&info);
|
||||||
|
|
Loading…
Reference in New Issue