From 8458d361a2aae8973793d23c1ee8b7687430331a Mon Sep 17 00:00:00 2001 From: tylerlacey Date: Wed, 11 Dec 2024 09:10:01 -0500 Subject: [PATCH 1/2] Update pubspec.yaml with new version of win32_registry --- pubspec.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pubspec.yaml b/pubspec.yaml index 7991f8d..01bb7ac 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,10 +15,10 @@ environment: dependencies: flutter: sdk: flutter - win32_registry: ^1.1.3 + win32_registry: ^2.0.0 dev_dependencies: dependency_validator: ^3.0.0 flutter_test: sdk: flutter - mostly_reasonable_lints: ^0.1.2 \ No newline at end of file + mostly_reasonable_lints: ^0.1.2 From 08287963008d5c51934a7c9d2ff6beca86012584 Mon Sep 17 00:00:00 2001 From: tylerlacey Date: Wed, 11 Dec 2024 09:13:36 -0500 Subject: [PATCH 2/2] Update app_auto_launcher_impl_windows.dart to use new win32_registry APIs --- lib/src/app_auto_launcher_impl_windows.dart | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/src/app_auto_launcher_impl_windows.dart b/lib/src/app_auto_launcher_impl_windows.dart index f8ea575..3e531e7 100644 --- a/lib/src/app_auto_launcher_impl_windows.dart +++ b/lib/src/app_auto_launcher_impl_windows.dart @@ -48,9 +48,8 @@ class AppAutoLauncherImplWindows extends AppAutoLauncher { @override Future enable() async { _regKey.createValue( - RegistryValue( + RegistryValue.string( appName, - RegistryValueType.string, _registryValue, ), ); @@ -60,7 +59,7 @@ class AppAutoLauncherImplWindows extends AppAutoLauncher { bytes[0] = 2; _startupApprovedRegKey - .createValue(RegistryValue(appName, RegistryValueType.binary, bytes)); + .createValue(RegistryValue.binary(appName, bytes)); return true; } @@ -76,15 +75,13 @@ class AppAutoLauncherImplWindows extends AppAutoLauncher { // Odd first byte will prevent the app from autostarting // Empty or any other value will allow the app to autostart Future _isStartupApproved() async { - final value = _startupApprovedRegKey.getValue(appName); + final data = _startupApprovedRegKey.getBinaryValue(appName); - if (value == null) { + if (data == null) { return true; } - final data = value.data; - - if (data is! Uint8List || data.isEmpty) { + if (data.isEmpty) { return true; }