diff --git a/scripts/install-python-deps.bat b/scripts/install-python-deps.bat new file mode 100644 index 0000000..ec0dfbe --- /dev/null +++ b/scripts/install-python-deps.bat @@ -0,0 +1,5 @@ +@echo off +echo 正在安装Python依赖... +pip install -r server/Python/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/ --trusted-host pypi.tuna.tsinghua.edu.cn +echo Python依赖安装完成! +pause \ No newline at end of file diff --git a/scripts/package.js b/scripts/package.js index 54bc2fc..387280b 100644 --- a/scripts/package.js +++ b/scripts/package.js @@ -188,16 +188,10 @@ async function createPackage() { console.log('馃摑 鍒涘缓鍚姩鑴氭湰...') // 鏍规嵁鐩爣骞冲彴鍒涘缓鍚姩鑴氭湰 if (buildTarget === 'windows') { - const startScript = `@echo off -echo 姝e湪鍚姩GSM3绠$悊闈㈡澘... -cd server -node.exe index.js -pause` - - await fs.writeFile( - path.join(packageDir, 'start.bat'), - startScript, - 'latin1' // 浣跨敤ANSI缂栫爜 + // Windows骞冲彴澶嶅埗scripts\start.bat鏂囦欢 + await fs.copy( + path.join(__dirname, 'start.bat'), + path.join(packageDir, 'start.bat') ) } else if (buildTarget === 'linux') { const startShScript = `#!/bin/bash @@ -249,24 +243,15 @@ node server/index.js` } console.log('馃悕 鍒涘缓Python渚濊禆瀹夎鑴氭湰...') - // 鍒涘缓Python渚濊禆瀹夎鑴氭湰 - const installPythonDepsScript = `@echo off -echo 姝e湪瀹夎Python渚濊禆... -cd server\\Python -pip install -r server/Python/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/ --trusted-host pypi.tuna.tsinghua.edu.cn -echo Python渚濊禆瀹夎瀹屾垚锛 -pause` - - await fs.writeFile( - path.join(packageDir, 'install-python-deps.bat'), - installPythonDepsScript, - 'latin1' // 浣跨敤ANSI缂栫爜 + // 澶嶅埗Python渚濊禆瀹夎鑴氭湰 + await fs.copy( + path.join(__dirname, 'install-python-deps.bat'), + path.join(packageDir, 'install-python-deps.bat') ) // 鍒涘缓Linux Python渚濊禆瀹夎鑴氭湰 const installPythonDepsShScript = `#!/bin/bash echo "姝e湪瀹夎Python渚濊禆..." -cd server/src/Python pip install -r server/Python/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/ --trusted-host pypi.tuna.tsinghua.edu.cn echo "Python渚濊禆瀹夎瀹屾垚锛"` diff --git a/scripts/start.bat b/scripts/start.bat new file mode 100644 index 0000000..ca778d2 --- /dev/null +++ b/scripts/start.bat @@ -0,0 +1,5 @@ +@echo off +echo 正在启动GSM3管理面板... +cd server +node.exe index.js +pause \ No newline at end of file