dev #14
20
electron/netUtils.js
Normal file
20
electron/netUtils.js
Normal 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 };
|
16
main.js
16
main.js
|
@ -37,6 +37,7 @@ const { appName, appVersion } = require("./electron/appInfo");
|
|||
const { updateAvailable, releasesUrl } = require("./electron/updateCheck");
|
||||
const fkill = require("fkill");
|
||||
const { checkImageExists } = require("./electron/imageUtil");
|
||||
const { isNet8Installed } = require("./electron/netUtils");
|
||||
|
||||
// Keep a global reference of the window object, if you don't, the window will
|
||||
// be closed automatically when the JavaScript object is garbage collected.
|
||||
|
@ -209,6 +210,10 @@ function stopOsuStatus() {
|
|||
}
|
||||
|
||||
function registerIPCPipes() {
|
||||
(async () => {
|
||||
const isNet8 = await isNet8Installed();
|
||||
console.log("net8:", isNet8);
|
||||
})();
|
||||
ipcMain.handle("ezpplauncher:login", async (e, args) => {
|
||||
const hwid = getHwId();
|
||||
const timeout = new AbortController();
|
||||
|
@ -415,6 +420,17 @@ function registerIPCPipes() {
|
|||
});
|
||||
return;
|
||||
}
|
||||
if (patch) {
|
||||
if (!(await isNet8Installed())) {
|
||||
mainWindow.webContents.send("ezpplauncher:launchabort");
|
||||
mainWindow.webContents.send("ezpplauncher:alert", {
|
||||
type: "error",
|
||||
message: ".NET 8 is not installed.",
|
||||
});
|
||||
//open .net 8 download in browser
|
||||
shell.openExternal('https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-desktop-8.0.4-windows-x64-installer');
|
||||
}
|
||||
}
|
||||
mainWindow.webContents.send("ezpplauncher:launchstatus", {
|
||||
status: "Checking for osu! updates...",
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user