|
@@ -58,11 +58,11 @@ let loadingWindow
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+let serveUrl = "./resources/exe"
|
|
|
+let serveUrlJar = '\\resources\\exe'
|
|
|
|
|
|
-let serveUrl = "./exe"
|
|
|
-let serveUrlJar = '\\exe'
|
|
|
+
|
|
|
+
|
|
|
|
|
|
* Set `__static` path to static files in production
|
|
|
* https:
|
|
@@ -363,6 +363,27 @@ const starServer = function () {
|
|
|
}
|
|
|
|
|
|
|
|
|
+const starBluetoothServer = function () {
|
|
|
+ let syncData = cmd.runSync('netstat -ano|findstr 8000')
|
|
|
+ if (syncData.data === null || syncData.data.trim().toUpperCase().indexOf('LISTENING') <= 0) {
|
|
|
+ let cp = require('child_process')
|
|
|
+
|
|
|
+
|
|
|
+ let path = process.cwd() + serveUrlJar+'/ct1';
|
|
|
+ cp.spawn('start', ['/b', 'blueMain.exe'], { cwd: path, shell: true, windowsHide: true })
|
|
|
+ do {
|
|
|
+ syncData = cmd.runSync('netstat -ano|findstr 8000')
|
|
|
+
|
|
|
+ } while (syncData.data === null || syncData.data.trim().toUpperCase().indexOf('LISTENING') <= 0)
|
|
|
+ console.log('OK')
|
|
|
+ } else {
|
|
|
+ console.log('8000')
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+starBluetoothServer();
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -481,6 +502,13 @@ ipcMain.on('window-close', function () {
|
|
|
stopPid(syncData)
|
|
|
}
|
|
|
}
|
|
|
+ let syncBlueData = cmd.runSync("netstat -ano|findstr 8000");
|
|
|
+
|
|
|
+ if (syncBlueData.data != null) {
|
|
|
+ if (syncBlueData.data.includes("LISTENING")) {
|
|
|
+ stopPid(syncBlueData)
|
|
|
+ }
|
|
|
+ }
|
|
|
wssSwitch = false
|
|
|
cmd.runSync('taskkill /f /im javaw.exe')
|
|
|
app.quit()
|