()
| 1425 | |
| 1426 | // Function to download Xray core files from GitHub |
| 1427 | async function downloadCoreFiles() { |
| 1428 | const corePath = getResourcePath('core'); |
| 1429 | |
| 1430 | if (!fs.existsSync(corePath)) { |
| 1431 | fs.mkdirSync(corePath, { recursive: true }); |
| 1432 | } |
| 1433 | |
| 1434 | // Platform-specific download |
| 1435 | if (isWindows) { |
| 1436 | const xrayPath = path.join(corePath, 'xray'); |
| 1437 | |
| 1438 | if (!fs.existsSync(xrayPath)) { |
| 1439 | fs.mkdirSync(xrayPath, { recursive: true }); |
| 1440 | } |
| 1441 | |
| 1442 | // Show download dialog |
| 1443 | dialog.showMessageBox({ |
| 1444 | type: 'info', |
| 1445 | title: 'Downloading Xray Core', |
| 1446 | message: 'DengVPN needs to download Xray core files. This may take a few minutes.', |
| 1447 | buttons: ['OK'] |
| 1448 | }); |
| 1449 | |
| 1450 | // In a real implementation, you would use a proper download code |
| 1451 | // For this example, we'll add a placeholder and instructions |
| 1452 | |
| 1453 | dialog.showMessageBox({ |
| 1454 | type: 'info', |
| 1455 | title: 'Manual Download Required', |
| 1456 | message: 'Please download the Xray core files from the official repository: https://github.com/XTLS/Xray-core/releases\n\n' + |
| 1457 | 'Extract the files and place them in the following directory:\n' + |
| 1458 | xrayPath + '\n\n' + |
| 1459 | 'Required files:\n' + |
| 1460 | '- xray.exe\n', |
| 1461 | buttons: ['OK'] |
| 1462 | }); |
| 1463 | } else if (isLinux) { |
| 1464 | const linuxXrayPath = path.join(corePath, 'linux', 'xray'); |
| 1465 | |
| 1466 | if (!fs.existsSync(linuxXrayPath)) { |
| 1467 | fs.mkdirSync(linuxXrayPath, { recursive: true }); |
| 1468 | } |
| 1469 | |
| 1470 | // Show download dialog |
| 1471 | dialog.showMessageBox({ |
| 1472 | type: 'info', |
| 1473 | title: 'Downloading Xray Core', |
| 1474 | message: 'DengVPN needs to download Xray core files. This may take a few minutes.', |
| 1475 | buttons: ['OK'] |
| 1476 | }); |
| 1477 | |
| 1478 | // In a real implementation, you would use a proper download code |
| 1479 | // For this example, we'll add a placeholder and instructions |
| 1480 | |
| 1481 | dialog.showMessageBox({ |
| 1482 | type: 'info', |
| 1483 | title: 'Manual Download Required', |
| 1484 | message: 'Please download the Xray core files from the official repository: https://github.com/XTLS/Xray-core/releases\n\n' + |
no test coverage detected