improve linux compatibility

This commit is contained in:
FTCHD
2025-02-14 09:56:23 +02:00
parent 018c728568
commit 9dad86bd25
4 changed files with 27 additions and 2 deletions
+4
View File
@@ -193,6 +193,10 @@ export async function provisionRclone() {
const appLocalDataDirPath = await appLocalDataDir()
console.log('appLocalDataDirPath', appLocalDataDirPath)
await invoke('allow_dir', {
path: appLocalDataDirPath,
})
const appLocalDataDirPathExists = await exists(appLocalDataDirPath)
console.log('appLocalDataDirPathExists', appLocalDataDirPathExists)
+3
View File
@@ -10,6 +10,7 @@ import {
getCurrentWindow,
} from '@tauri-apps/api/window'
import { ask } from '@tauri-apps/plugin-dialog'
import { platform } from '@tauri-apps/plugin-os'
import { exit } from '@tauri-apps/plugin-process'
import { buildMenu } from './menu'
import { resetMainWindow } from './window'
@@ -84,6 +85,8 @@ export async function initTray(): Promise<void> {
}
export async function initLoadingTray() {
if (platform() === 'linux') return
const globeIconPath = await resolveResource('icons/favicon/frame_00_delay-0.1s.png')
const quitItem = await MenuItem.new({
+2 -1
View File
@@ -1,6 +1,7 @@
import { getCurrentWindow } from '@tauri-apps/api/window'
import { ask, message } from '@tauri-apps/plugin-dialog'
import { debug, error, info, trace, warn } from '@tauri-apps/plugin-log'
import { platform } from '@tauri-apps/plugin-os'
import { exit } from '@tauri-apps/plugin-process'
import type { Command } from '@tauri-apps/plugin-shell'
import { validateLicense } from './lib/license'
@@ -41,7 +42,7 @@ async function waitForHydration() {
async function validateInstance() {
const isOnline = navigator.onLine
if (!isOnline) {
if (!isOnline && platform() !== 'linux') {
await ask(
'You are not connected to the internet. Please check your connection and try again.',
{
+18 -1
View File
@@ -12,6 +12,23 @@ use std::path::Path;
use zip::ZipArchive;
use tauri_plugin_sentry::{minidump, sentry};
use tauri::{AppHandle, Runtime};
use tauri_plugin_fs::FsExt;
#[tauri::command]
fn allow_file<R: Runtime>(
app: AppHandle<R>,
path: &str) -> () {
app.fs_scope().allow_file(path);
}
#[tauri::command]
fn allow_dir<R: Runtime>(
app: AppHandle<R>,
path: &str) -> () {
app.fs_scope().allow_directory(path, true);
}
#[tauri::command]
fn unzip_file(zip_path: &str, output_folder: &str) -> Result<(), String> {
// Open the zip file
@@ -104,7 +121,7 @@ pub fn run() {
.plugin(tauri_plugin_log::Builder::new().build())
.plugin(tauri_plugin_shell::init())
.plugin(tauri_plugin_opener::init())
.invoke_handler(tauri::generate_handler![unzip_file, get_arch, get_uid])
.invoke_handler(tauri::generate_handler![unzip_file, get_arch, get_uid, allow_file, allow_dir])
.setup(|_app| Ok(()))
// .setup(|app| {
// if cfg!(debug_assertions) {