move Python files and update Tauri configuration
This commit is contained in:
@@ -29,7 +29,7 @@
|
|||||||
},
|
},
|
||||||
"fs":{
|
"fs":{
|
||||||
"all": true,
|
"all": true,
|
||||||
"scope": ["$APPDATA","$APPDATA/*","$APPDATA/**/*", "$DOWNLOAD/*", "/data/**/*"]
|
"scope": ["$APPDATA","$APPDATA/*","$APPDATA/**/*", "$DOWNLOAD/*", "/data/**/*", "$RESOURCE/*"]
|
||||||
},
|
},
|
||||||
"path":{
|
"path":{
|
||||||
"all": true
|
"all": true
|
||||||
@@ -87,7 +87,10 @@
|
|||||||
"icons/icon.ico"
|
"icons/icon.ico"
|
||||||
],
|
],
|
||||||
"identifier": "co.aiclient.risu",
|
"identifier": "co.aiclient.risu",
|
||||||
"targets": "all"
|
"targets": "all",
|
||||||
|
"resources": [
|
||||||
|
"src-python/*"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"security": {
|
"security": {
|
||||||
"csp": null
|
"csp": null
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { exists } from "@tauri-apps/api/fs";
|
|||||||
import { alertClear, alertError, alertMd, alertWait } from "src/ts/alert";
|
import { alertClear, alertError, alertMd, alertWait } from "src/ts/alert";
|
||||||
import { get } from "svelte/store";
|
import { get } from "svelte/store";
|
||||||
import { DataBase } from "src/ts/storage/database";
|
import { DataBase } from "src/ts/storage/database";
|
||||||
|
import { resolveResource } from '@tauri-apps/api/path'
|
||||||
let serverRunning = false;
|
let serverRunning = false;
|
||||||
|
|
||||||
export function checkLocalModel():Promise<string>{
|
export function checkLocalModel():Promise<string>{
|
||||||
@@ -157,6 +158,7 @@ export async function runLocalModel(prompt:string){
|
|||||||
export async function installPython(){
|
export async function installPython(){
|
||||||
const appDir = await path.appDataDir()
|
const appDir = await path.appDataDir()
|
||||||
const completedPath = await path.join(appDir, 'python', 'completed.txt')
|
const completedPath = await path.join(appDir, 'python', 'completed.txt')
|
||||||
|
console.log(await resolveResource('/src-python/'))
|
||||||
if(await exists(completedPath)){
|
if(await exists(completedPath)){
|
||||||
alertMd("Python is already installed")
|
alertMd("Python is already installed")
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user