Merge branch 'Fix-Drive-Detect' into 'master'

Fix drive detect

See merge request sheepitrenderfarm/client!267
This commit is contained in:
harlekin
2023-10-29 12:12:41 +00:00

View File

@@ -7,6 +7,7 @@ import oshi.hardware.HWDiskStore;
import oshi.hardware.HardwareAbstractionLayer;
import oshi.hardware.NetworkIF;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
@@ -62,7 +63,8 @@ public class BaseHWInfoImpl implements BasicHWInfoStrategy {
while (rootFound == false && iterator.hasNext()) {
var drive = iterator.next();
for (var partition : drive.getPartitions()) {
if (partition.getMountPoint().equals(rootMountpoint)) {
if (partition.getMountPoint().equals(rootMountpoint) || //Check "/" or "C:"
(Platform.isWindows() && partition.getMountPoint().equals(rootMountpoint + File.separator))) { //Check also "C:\" on Windows
hddSerial = drive.getSerial();
rootFound = true;
break;