Skip to content

Commit

Permalink
Replace wmic command for ADB drivers check (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
corbindavenport committed Jun 28, 2024
1 parent 55ddf81 commit b50b42c
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions bin/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -104,19 +104,19 @@ Future installPlatformTools(cpuArch) async {
if (io.Platform.isWindows) {
// Install Universal Adb Driver package on x86_64 Windows
if (cpuArch == 'AMD64') {
var info = await io.Process.run('wmic', ['product', 'get', 'Name']);
var parsedInfo = info.stdout.toString();
if (parsedInfo.contains('Universal Adb Driver')) {
print('[ OK ] Universal ADB Drivers already installed.');
} else {
// Prompt to install drivers
print('[WARN] Drivers may be required for ADB if they are not already installed.');
io.stdout.write('[WARN] Install drivers from adb.clockworkmod.com? [Y/N] ');
var input = io.stdin.readLineSync();
if (input?.toLowerCase() == 'y') {
await installWindowsDrivers(dir);
var info = await io.Process.run('PowerShell', ['-Command', 'Get-WmiObject -Class Win32_Product | Select-Object -Property Name']);
var parsedInfo = info.stdout.toString();
if (parsedInfo.contains('Universal Adb Driver')) {
print('[ OK ] Universal ADB Drivers already installed.');
} else {
// Prompt to install drivers
print('[WARN] Drivers may be required for ADB if they are not already installed.');
io.stdout.write('[WARN] Install drivers from adb.clockworkmod.com? [Y/N] ');
var input = io.stdin.readLineSync();
if (input?.toLowerCase() == 'y') {
await installWindowsDrivers(dir);
}
}
}
} else {
print('[WARN] Universal ADB Driver package cannot be installed on $cpuArch, some devices might not work.');
}
Expand Down

0 comments on commit b50b42c

Please sign in to comment.