|
@@ -114,7 +114,14 @@ ipcMain.on("change-win-size", (event, args: string) => {
|
|
|
ipcMain.on("window-min", () => {
|
|
|
win?.minimize();
|
|
|
});
|
|
|
-
|
|
|
+const isRunning = (query: string, cb: Function) => {
|
|
|
+ exec(
|
|
|
+ "cmd /c chcp 65001>nul && tasklist /FO CSV",
|
|
|
+ (err: any, stdout: any, stderr: any) => {
|
|
|
+ cb(stdout.toLowerCase().indexOf(query.toLowerCase()) > -1);
|
|
|
+ }
|
|
|
+ );
|
|
|
+};
|
|
|
function startExe(exePath: string) {
|
|
|
console.log("主进程接收到的exe路径:", exePath);
|
|
|
let checkPath = exePath.includes(".exe ")
|
|
@@ -126,6 +133,14 @@ function startExe(exePath: string) {
|
|
|
console.log("子进程关闭了!");
|
|
|
win?.show();
|
|
|
});
|
|
|
+ // exec(exePath, (error, stdout, stderr) => {
|
|
|
+ // console.log("子进程关闭了!");
|
|
|
+ // isRunning("client.exe", (status: boolean) => {
|
|
|
+ // if (!status) {
|
|
|
+ // win?.show();
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // });
|
|
|
} else {
|
|
|
dialog.showErrorBox("tip", `${checkPath}不存在!`);
|
|
|
}
|