add .net8 check when patch is enabled

This commit is contained in:
2024-04-14 17:16:46 +02:00
parent 6f2764a047
commit 528af70446
2 changed files with 36 additions and 0 deletions

20
electron/netUtils.js Normal file
View File

@@ -0,0 +1,20 @@
const { exec } = require("child_process");
async function isNet8Installed() {
return new Promise((resolve, reject) => {
exec("dotnet --version", (error, stdout, stderr) => {
if (error) {
resolve(false);
return;
}
if (stderr) {
resolve(false);
return;
}
const version = stdout.trim();
resolve(version.startsWith("8."));
})
});
}
module.exports = { isNet8Installed };