move Python files and update Tauri configuration

This commit is contained in:
kwaroran
2024-01-12 12:21:23 +09:00
parent 70daaff160
commit 88e88b9ce6
5 changed files with 7 additions and 2 deletions

View File

@@ -29,7 +29,7 @@
},
"fs":{
"all": true,
"scope": ["$APPDATA","$APPDATA/*","$APPDATA/**/*", "$DOWNLOAD/*", "/data/**/*"]
"scope": ["$APPDATA","$APPDATA/*","$APPDATA/**/*", "$DOWNLOAD/*", "/data/**/*", "$RESOURCE/*"]
},
"path":{
"all": true
@@ -87,7 +87,10 @@
"icons/icon.ico"
],
"identifier": "co.aiclient.risu",
"targets": "all"
"targets": "all",
"resources": [
"src-python/*"
]
},
"security": {
"csp": null

View File

@@ -6,6 +6,7 @@ import { exists } from "@tauri-apps/api/fs";
import { alertClear, alertError, alertMd, alertWait } from "src/ts/alert";
import { get } from "svelte/store";
import { DataBase } from "src/ts/storage/database";
import { resolveResource } from '@tauri-apps/api/path'
let serverRunning = false;
export function checkLocalModel():Promise<string>{
@@ -157,6 +158,7 @@ export async function runLocalModel(prompt:string){
export async function installPython(){
const appDir = await path.appDataDir()
const completedPath = await path.join(appDir, 'python', 'completed.txt')
console.log(await resolveResource('/src-python/'))
if(await exists(completedPath)){
alertMd("Python is already installed")
return