(filename)
| 105 | // - /tmp/.mount_peervizdlxvC/resources/vnc-software/ (launched from appimage or .deb package installation) |
| 106 | // - on windows: check console.log to know what __dirname and process.cwd() are |
| 107 | function findResourceFile(filename) { |
| 108 | console.log("findResourceFile __dirname = "); |
| 109 | console.log(__dirname) |
| 110 | console.log("findResourceFile process.cwd = "); |
| 111 | console.log(process.cwd()) |
| 112 | const magicName = "vnc-software" + nodePath.sep; |
| 113 | const parts = __dirname.split(nodePath.sep); |
| 114 | let appImageMount = parts.slice(0, -3).join(nodePath.sep); // /tmp/.mount_peervizdlxvC/resources/app.asar/.webpack/main becomes /tmp/.mount_peervizdlxvC/resources |
| 115 | // placesToCheck are directories that should end with a slash |
| 116 | let placesToCheck = [magicName, appImageMount + nodePath.sep + magicName, nodePath.sep]; |
| 117 | for (const str of placesToCheck) { |
| 118 | let fullName = str + filename; |
| 119 | console.log("checking exists: " + str); |
| 120 | if (existsSync(str)) { |
| 121 | console.log("exists: " + str); |
| 122 | return fullName; |
| 123 | } else { |
| 124 | console.log("no exists: " + str); |
| 125 | } |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | ipcMain.on('run-server', (event) => { |
| 130 | // Make sure this OS is supported |
no outgoing calls
no test coverage detected