Add Python installation and setup functionality

This commit is contained in:
kwaroran
2024-01-12 12:02:06 +09:00
parent 11ae0266d9
commit b4b461288d
5 changed files with 333 additions and 1 deletions

View File

@@ -152,4 +152,29 @@ export async function runLocalModel(prompt:string){
})
console.log(gen)
}
export async function installPython(){
const appDir = await path.appDataDir()
const completedPath = await path.join(appDir, 'python', 'completed.txt')
if(await exists(completedPath)){
alertMd("Python is already installed")
return
}
alertWait("Installing Python")
await invoke("install_python", {
path: appDir
})
alertWait("Installing Pip")
await invoke("install_pip", {
path: appDir
})
alertWait("Rewriting requirements")
await invoke('post_py_install', {
path: appDir
})
alertClear()
}