add optional logging, cleanup fixes #15
|
@ -1,8 +1,8 @@
|
||||||
const { exec } = require("child_process");
|
const { exec } = require("child_process");
|
||||||
|
|
||||||
async function isNet8Installed() {
|
async function isNet8Installed() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve) => {
|
||||||
exec("dotnet --version", (error, stdout, stderr) => {
|
exec("dotnet --list-runtimes", (error, stdout, stderr) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
resolve(false);
|
resolve(false);
|
||||||
return;
|
return;
|
||||||
|
@ -12,7 +12,13 @@ async function isNet8Installed() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const version = stdout.trim();
|
const version = stdout.trim();
|
||||||
resolve(version.startsWith("8."));
|
for (const line of version.split('\n')) {
|
||||||
|
if (line.startsWith("Microsoft.WindowsDesktop.App 8.")) {
|
||||||
|
resolve(true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resolve(false);
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user