diff --git a/indra/newview/llvelopack.cpp b/indra/newview/llvelopack.cpp
index 28e989c4ba..0cb0dd25c8 100644
--- a/indra/newview/llvelopack.cpp
+++ b/indra/newview/llvelopack.cpp
@@ -276,6 +276,10 @@ static bool custom_download_asset(void* user_data,
static const wchar_t* PROTOCOL_SECONDLIFE = L"secondlife";
static const wchar_t* PROTOCOL_GRID_INFO = L"x-grid-location-info";
+// Support for Opensim protocols
+static const wchar_t* PROTOCOL_HOP_OPENSIM = L"hop";
+static const wchar_t* PROTOCOL_GRID_INFO_OPENSIM = L"x-grid-info";
+//
static std::wstring get_viewer_exe_name()
{
return ll_convert(gDirUtilp->getExecutableFilename());
@@ -403,6 +407,22 @@ static void register_protocol_handler(const std::wstring& protocol,
(BYTE*)cmd_value.c_str(), (DWORD)((cmd_value.size() + 1) * sizeof(wchar_t)));
RegCloseKey(hkey);
}
+
+ // [FIRE-30446] Set FriendlyAppName for protocols
+ std::wstring friendlyappname_key_path = key_path + L"\\shell\\open";
+ if (RegCreateKeyExW(HKEY_CURRENT_USER, friendlyappname_key_path.c_str(), 0, NULL,
+ REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hkey, NULL) == ERROR_SUCCESS)
+ {
+ #ifdef OPENSIM
+ std::wstring friendlyappname_value = get_app_name_oneword() + L" for OpenSimulator";
+ #else
+ std::wstring friendlyappname_value = get_app_name_oneword();
+ #endif
+ RegSetValueExW(hkey, L"FriendlyAppName", 0, REG_SZ,
+ (BYTE*)friendlyappname_value.c_str(), (DWORD)((friendlyappname_value.size() + 1) * sizeof(wchar_t)));
+ RegCloseKey(hkey);
+ }
+ //
}
void clear_nsis_links()
@@ -656,7 +676,15 @@ static void on_after_install(void* user_data, const char* app_version)
std::wstring exe_path = install_dir + L"\\" + get_viewer_exe_name();
register_protocol_handler(PROTOCOL_SECONDLIFE, L"URL:Second Life", exe_path);
+ // Support for OpenSim protocols
+#ifndef OPENSIM
register_protocol_handler(PROTOCOL_GRID_INFO, L"URL:Second Life", exe_path);
+#else
+ register_protocol_handler(PROTOCOL_GRID_INFO, L"URL:Hypergrid", exe_path);
+#endif
+ register_protocol_handler(PROTOCOL_HOP_OPENSIM, L"URL:Hypergrid", exe_path);
+ register_protocol_handler(PROTOCOL_GRID_INFO_OPENSIM, L"URL:Hypergrid", exe_path);
+ //
create_shortcuts(install_dir, app_name);
}
@@ -666,6 +694,10 @@ static void on_before_uninstall(void* user_data, const char* app_version)
unregister_protocol_handler(PROTOCOL_SECONDLIFE);
unregister_protocol_handler(PROTOCOL_GRID_INFO);
+ // Support for OpenSim protocols
+ unregister_protocol_handler(PROTOCOL_HOP_OPENSIM);
+ unregister_protocol_handler(PROTOCOL_GRID_INFO_OPENSIM);
+ //
unregister_uninstall_info();
remove_shortcuts(app_name);
}