diff --git a/frontend/electron/main.ts b/frontend/electron/main.ts
index 72bcb66..184fca2 100644
--- a/frontend/electron/main.ts
+++ b/frontend/electron/main.ts
@@ -516,6 +516,47 @@ ipcMain.handle('check-environment', async () => {
return checkEnvironment(appRoot)
})
+// 关键文件检查 - 每次都重新检查exe文件是否存在
+ipcMain.handle('check-critical-files', async () => {
+ try {
+ const appRoot = getAppRoot()
+
+ // 检查Python可执行文件
+ const pythonPath = path.join(appRoot, 'environment', 'python', 'python.exe')
+ const pythonExists = fs.existsSync(pythonPath)
+
+ // 检查pip(通常与Python一起安装)
+ const pipPath = path.join(appRoot, 'environment', 'python', 'Scripts', 'pip.exe')
+ const pipExists = fs.existsSync(pipPath)
+
+ // 检查Git可执行文件
+ const gitPath = path.join(appRoot, 'environment', 'git', 'bin', 'git.exe')
+ const gitExists = fs.existsSync(gitPath)
+
+ // 检查后端主文件
+ const mainPyPath = path.join(appRoot, 'main.py')
+ const mainPyExists = fs.existsSync(mainPyPath)
+
+ const result = {
+ pythonExists,
+ pipExists,
+ gitExists,
+ mainPyExists
+ }
+
+ log.info('关键文件检查结果:', result)
+ return result
+ } catch (error) {
+ log.error('检查关键文件失败:', error)
+ return {
+ pythonExists: false,
+ pipExists: false,
+ gitExists: false,
+ mainPyExists: false
+ }
+ }
+})
+
// Python相关
ipcMain.handle('download-python', async (_event, mirror = 'tsinghua') => {
const appRoot = getAppRoot()
@@ -547,6 +588,17 @@ ipcMain.handle('download-git', async () => {
return downloadGit(appRoot)
})
+ipcMain.handle('check-git-update', async () => {
+ try {
+ // 这里可以实现检查Git仓库更新的逻辑
+ // 暂时返回false,表示没有更新
+ return { hasUpdate: false }
+ } catch (error) {
+ log.error('检查Git更新失败:', error)
+ return { hasUpdate: false, error: error instanceof Error ? error.message : String(error) }
+ }
+})
+
ipcMain.handle(
'clone-backend',
async (_event, repoUrl = 'https://github.com/AUTO-MAS-Project/AUTO-MAS.git') => {
diff --git a/frontend/electron/preload.ts b/frontend/electron/preload.ts
index 3866a77..c7331ed 100644
--- a/frontend/electron/preload.ts
+++ b/frontend/electron/preload.ts
@@ -19,9 +19,11 @@ contextBridge.exposeInMainWorld('electronAPI', {
// 初始化相关API
checkEnvironment: () => ipcRenderer.invoke('check-environment'),
+ checkCriticalFiles: () => ipcRenderer.invoke('check-critical-files'),
downloadPython: (mirror?: string) => ipcRenderer.invoke('download-python', mirror),
installPip: () => ipcRenderer.invoke('install-pip'),
downloadGit: () => ipcRenderer.invoke('download-git'),
+ checkGitUpdate: () => ipcRenderer.invoke('check-git-update'),
installDependencies: (mirror?: string) => ipcRenderer.invoke('install-dependencies', mirror),
cloneBackend: (repoUrl?: string) => ipcRenderer.invoke('clone-backend', repoUrl),
updateBackend: (repoUrl?: string) => ipcRenderer.invoke('update-backend', repoUrl),
diff --git a/frontend/src/components/initialization/AutoMode.vue b/frontend/src/components/initialization/AutoMode.vue
index 0f61829..55e4e9a 100644
--- a/frontend/src/components/initialization/AutoMode.vue
+++ b/frontend/src/components/initialization/AutoMode.vue
@@ -32,7 +32,7 @@
-
+
+
+
+
+
\ No newline at end of file
diff --git a/frontend/src/components/initialization/ManualMode.vue b/frontend/src/components/initialization/ManualMode.vue
index 020240c..8147af0 100644
--- a/frontend/src/components/initialization/ManualMode.vue
+++ b/frontend/src/components/initialization/ManualMode.vue
@@ -48,7 +48,7 @@
-
+
@@ -136,7 +136,7 @@