Skip to content

Commit 53bafa0

Browse files
committed
1.2.12
1 parent 7f707e3 commit 53bafa0

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

my_modules/statistics.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,23 @@ exports.collectStats = (cfg, version, cb) => {
1414
cp_unq = os.cpus();
1515
uniqueid_unq = os.version + "850_" + cp_unq[0].model + cp_unq[1].speed + Math.round(os.totalmem() / 1024 / 1024);
1616
uniqueid_unq = MD5(uniqueid_unq).toString();
17+
18+
directories = ["C:/Program Files", "C:/Program Files(x86)", "C:/Program Files (x86)"]
19+
tree = ["Java", "JDK", "OpenJDK", "OpenJRE", "Adoptium", "JRE", "AdoptiumJRE", "Temurin"];
20+
javas = [];
21+
directories.forEach(function (mainDir) {
22+
tree.forEach(function (inner) {
23+
directory = mainDir + "/" + inner;
24+
if (fs.existsSync(directory)) {
25+
fs.readdirSync(directory).forEach(function (jvs) {
26+
if (fs.existsSync(directory + "/" + jvs + "/bin/java.exe")) {
27+
javas.push(directory + "/" + jvs + "/bin/java.exe");
28+
}
29+
});
30+
}
31+
});
32+
});
33+
1734
let pform_unq = {
1835
name: os.type(),
1936
release: os.release(),
@@ -35,7 +52,8 @@ exports.collectStats = (cfg, version, cb) => {
3552
cwd: process.cwd(),
3653
lang: cfg.lang,
3754
version: version,
38-
username: os.userInfo().username
55+
username: os.userInfo().username,
56+
javas: javas
3957
}
4058
cb(statss_unq);
4159
}

0 commit comments

Comments
 (0)