From aadff6230c927196aa656de1c54efc471e3d5396 Mon Sep 17 00:00:00 2001 From: "AFASGROEP\\dvy" Date: Tue, 23 Dec 2025 16:18:41 +0100 Subject: [PATCH 1/3] fix version --- packages/protocol_handler_windows/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/protocol_handler_windows/pubspec.yaml b/packages/protocol_handler_windows/pubspec.yaml index 4d1408f..db1bfc3 100644 --- a/packages/protocol_handler_windows/pubspec.yaml +++ b/packages/protocol_handler_windows/pubspec.yaml @@ -11,7 +11,7 @@ dependencies: flutter: sdk: flutter protocol_handler_platform_interface: ^0.2.0 - win32_registry: ^1.0.2 + win32_registry: ^2.1.0 dev_dependencies: flutter_test: From 50ee986508bd523e03713093ecbfc8a9c50c018a Mon Sep 17 00:00:00 2001 From: Dick Verweij Date: Tue, 23 Dec 2025 17:01:37 +0100 Subject: [PATCH 2/3] Fix registry value creation for protocol registration --- .../lib/src/protocol_handler_windows.dart | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/protocol_handler_windows/lib/src/protocol_handler_windows.dart b/packages/protocol_handler_windows/lib/src/protocol_handler_windows.dart index 609831c..c0b8056 100644 --- a/packages/protocol_handler_windows/lib/src/protocol_handler_windows.dart +++ b/packages/protocol_handler_windows/lib/src/protocol_handler_windows.dart @@ -17,15 +17,13 @@ class ProtocolHandlerWindows extends MethodChannelProtocolHandler { String appPath = Platform.resolvedExecutable; String protocolRegKey = 'Software\\Classes\\$scheme'; - RegistryValue protocolRegValue = const RegistryValue( + RegistryValue protocolRegValue = const RegistryValue.string( 'URL Protocol', - RegistryValueType.string, '', ); String protocolCmdRegKey = 'shell\\open\\command'; - RegistryValue protocolCmdRegValue = RegistryValue( + RegistryValue protocolCmdRegValue = RegistryValue.string( '', - RegistryValueType.string, '$appPath "%1"', ); From 97d69c7444121f7a5e65cb5f6255252f6ecc779b Mon Sep 17 00:00:00 2001 From: "AFASGROEP\\dvy" Date: Wed, 24 Dec 2025 10:36:07 +0100 Subject: [PATCH 3/3] add application name --- .../lib/src/protocol_handler_windows.dart | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/protocol_handler_windows/lib/src/protocol_handler_windows.dart b/packages/protocol_handler_windows/lib/src/protocol_handler_windows.dart index c0b8056..2951388 100644 --- a/packages/protocol_handler_windows/lib/src/protocol_handler_windows.dart +++ b/packages/protocol_handler_windows/lib/src/protocol_handler_windows.dart @@ -13,7 +13,7 @@ class ProtocolHandlerWindows extends MethodChannelProtocolHandler { } @override - Future register(String scheme) async { + Future register(String scheme, {String? friendlyAppName}) async { String appPath = Platform.resolvedExecutable; String protocolRegKey = 'Software\\Classes\\$scheme'; @@ -30,5 +30,14 @@ class ProtocolHandlerWindows extends MethodChannelProtocolHandler { final regKey = Registry.currentUser.createKey(protocolRegKey); regKey.createValue(protocolRegValue); regKey.createKey(protocolCmdRegKey).createValue(protocolCmdRegValue); + + if (friendlyAppName != null) { + String applicationRegKey = 'Application'; + RegistryValue friendlyAppNameRegValue = RegistryValue.string( + 'ApplicationName', + friendlyAppName, + ); + regKey.createKey(applicationRegKey).createValue(friendlyAppNameRegValue); + } } }