add optional logging, cleanup fixes #15

Merged
HorizonCode merged 4 commits from dev into master 2024-04-15 11:12:11 +00:00
Showing only changes of commit 8b30b7c1fa - Show all commits

View File

@ -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);
}) })
}); });
} }