registerScheme static method

Future<void> registerScheme()

Registers the custom Config.scheme.

Implementation

static Future<void> registerScheme() async {
  if (PlatformUtils.isWindows) {
    final RegistryKey regKey = Registry.currentUser.createKey(
      'Software\\Classes\\${Config.scheme}',
    );

    regKey.createValue(const RegistryValue.string('URL Protocol', ''));

    regKey
        .createKey('shell\\open\\command')
        .createValue(
          RegistryValue.string('', '"${Platform.resolvedExecutable}" "%1"'),
        );
  }
}