mirror of
https://github.com/godotengine/godot.git
synced 2024-11-21 11:32:13 +00:00
Merge pull request #94976 from bruvzg/win_app_name
[Windows] Improve editor grouping, set friendly name registry key for exported projects.
This commit is contained in:
commit
1d57b81d26
@ -5543,7 +5543,7 @@ DisplayServer::WindowID DisplayServerWindows::_create_window(WindowMode p_mode,
|
|||||||
PROPVARIANT val;
|
PROPVARIANT val;
|
||||||
String appname;
|
String appname;
|
||||||
if (Engine::get_singleton()->is_editor_hint()) {
|
if (Engine::get_singleton()->is_editor_hint()) {
|
||||||
appname = "Godot.GodotEditor." + String(VERSION_BRANCH);
|
appname = "Godot.GodotEditor." + String(VERSION_FULL_CONFIG);
|
||||||
} else {
|
} else {
|
||||||
String name = GLOBAL_GET("application/config/name");
|
String name = GLOBAL_GET("application/config/name");
|
||||||
String version = GLOBAL_GET("application/config/version");
|
String version = GLOBAL_GET("application/config/version");
|
||||||
@ -6071,7 +6071,7 @@ DisplayServerWindows::DisplayServerWindows(const String &p_rendering_driver, Win
|
|||||||
|
|
||||||
String appname;
|
String appname;
|
||||||
if (Engine::get_singleton()->is_editor_hint()) {
|
if (Engine::get_singleton()->is_editor_hint()) {
|
||||||
appname = "Godot.GodotEditor." + String(VERSION_BRANCH);
|
appname = "Godot.GodotEditor." + String(VERSION_FULL_CONFIG);
|
||||||
} else {
|
} else {
|
||||||
String name = GLOBAL_GET("application/config/name");
|
String name = GLOBAL_GET("application/config/name");
|
||||||
String version = GLOBAL_GET("application/config/version");
|
String version = GLOBAL_GET("application/config/version");
|
||||||
@ -6086,6 +6086,17 @@ DisplayServerWindows::DisplayServerWindows(const String &p_rendering_driver, Win
|
|||||||
}
|
}
|
||||||
clean_app_name = clean_app_name.substr(0, 120 - version.length()).trim_suffix(".");
|
clean_app_name = clean_app_name.substr(0, 120 - version.length()).trim_suffix(".");
|
||||||
appname = "Godot." + clean_app_name + "." + version;
|
appname = "Godot." + clean_app_name + "." + version;
|
||||||
|
|
||||||
|
#ifndef TOOLS_ENABLED
|
||||||
|
// Set for exported projects only.
|
||||||
|
HKEY key;
|
||||||
|
if (RegOpenKeyW(HKEY_CURRENT_USER_LOCAL_SETTINGS, L"Software\\Microsoft\\Windows\\Shell\\MuiCache", &key) == ERROR_SUCCESS) {
|
||||||
|
Char16String cs_name = name.utf16();
|
||||||
|
String value_name = OS::get_singleton()->get_executable_path().replace("/", "\\") + ".FriendlyAppName";
|
||||||
|
RegSetValueExW(key, (LPCWSTR)value_name.utf16().get_data(), 0, REG_SZ, (const BYTE *)cs_name.get_data(), cs_name.size() * sizeof(WCHAR));
|
||||||
|
RegCloseKey(key);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
SetCurrentProcessExplicitAppUserModelID((PCWSTR)appname.utf16().get_data());
|
SetCurrentProcessExplicitAppUserModelID((PCWSTR)appname.utf16().get_data());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user