Skip to content

Commit 0828796

Browse files
authored
Update app_auto_launcher_impl_windows.dart to use new win32_registry APIs
1 parent 8458d36 commit 0828796

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

lib/src/app_auto_launcher_impl_windows.dart

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,8 @@ class AppAutoLauncherImplWindows extends AppAutoLauncher {
4848
@override
4949
Future<bool> enable() async {
5050
_regKey.createValue(
51-
RegistryValue(
51+
RegistryValue.string(
5252
appName,
53-
RegistryValueType.string,
5453
_registryValue,
5554
),
5655
);
@@ -60,7 +59,7 @@ class AppAutoLauncherImplWindows extends AppAutoLauncher {
6059
bytes[0] = 2;
6160

6261
_startupApprovedRegKey
63-
.createValue(RegistryValue(appName, RegistryValueType.binary, bytes));
62+
.createValue(RegistryValue.binary(appName, bytes));
6463

6564
return true;
6665
}
@@ -76,15 +75,13 @@ class AppAutoLauncherImplWindows extends AppAutoLauncher {
7675
// Odd first byte will prevent the app from autostarting
7776
// Empty or any other value will allow the app to autostart
7877
Future<bool> _isStartupApproved() async {
79-
final value = _startupApprovedRegKey.getValue(appName);
78+
final data = _startupApprovedRegKey.getBinaryValue(appName);
8079

81-
if (value == null) {
80+
if (data == null) {
8281
return true;
8382
}
8483

85-
final data = value.data;
86-
87-
if (data is! Uint8List || data.isEmpty) {
84+
if (data.isEmpty) {
8885
return true;
8986
}
9087

0 commit comments

Comments
 (0)