From 281b402b20fcf6b06c71cb91d09ed22e602b9df3 Mon Sep 17 00:00:00 2001 From: oshtz Date: Mon, 22 Dec 2025 13:47:03 +0200 Subject: [PATCH] feat: update version to 0.0.6 and improve updater file handling --- README.md | 2 +- package-lock.json | 4 ++-- package.json | 2 +- src-tauri/Cargo.lock | 2 +- src-tauri/Cargo.toml | 2 +- src-tauri/tauri.conf.json | 6 ++++-- src/services/updater.ts | 17 +++++++++-------- 7 files changed, 19 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 7c74e51..e5207d9 100644 --- a/README.md +++ b/README.md @@ -129,7 +129,7 @@ Enter your OpenRouter API key in the Settings tab. ### Updates - The app checks for updates on startup. -- Click the version button in the header (e.g. `v0.0.5`) to view update status, release notes, or manually re-check. +- Click the version button in the header (e.g. `v0.0.6`) to view update status, release notes, or manually re-check. - Updates are pulled from GitHub Releases and expect a `Benchmaker-Portable.exe` asset on the latest tag. ## Development diff --git a/package-lock.json b/package-lock.json index b62348f..2c13c46 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "benchmaker", - "version": "0.0.5", + "version": "0.0.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "benchmaker", - "version": "0.0.5", + "version": "0.0.6", "dependencies": { "@monaco-editor/react": "^4.7.0", "@radix-ui/react-alert-dialog": "^1.1.15", diff --git a/package.json b/package.json index a186cd0..ef9fe60 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "benchmaker", - "version": "0.0.5", + "version": "0.0.6", "type": "module", "scripts": { "dev": "vite", diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 97fc38d..39a5a99 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -109,7 +109,7 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "benchmaker" -version = "0.0.5" +version = "0.0.6" dependencies = [ "rusqlite", "serde", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index f423740..8f08c58 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "benchmaker" -version = "0.0.5" +version = "0.0.6" description = "Benchmaker" authors = ["you"] edition = "2021" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 9739407..404ef2d 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -7,7 +7,7 @@ }, "package": { "productName": "Benchmaker", - "version": "0.0.5" + "version": "0.0.6" }, "tauri": { "allowlist": { @@ -39,7 +39,9 @@ "writeFile": true, "createDir": true, "scope": [ - "$TEMP/**" + "$APPLOCALDATA", + "$APPLOCALDATA/**", + "$APPLOCALDATA/*" ] } }, diff --git a/src/services/updater.ts b/src/services/updater.ts index d146519..cfcae40 100644 --- a/src/services/updater.ts +++ b/src/services/updater.ts @@ -135,18 +135,19 @@ export async function downloadUpdate(update: UpdateInfo): Promise { } const binary = await downloadBinary(update.downloadUrl) - const { tempdir } = await import('@tauri-apps/api/os') - const { join } = await import('@tauri-apps/api/path') - const { createDir, writeBinaryFile } = await import('@tauri-apps/api/fs') + const { appLocalDataDir, join } = await import('@tauri-apps/api/path') + const { createDir, writeBinaryFile, BaseDirectory } = await import('@tauri-apps/api/fs') - const baseDir = await tempdir() - const updateDir = await join(baseDir, UPDATE_DIR_NAME) - await createDir(updateDir, { recursive: true }) + const updateDir = UPDATE_DIR_NAME + await createDir(updateDir, { dir: BaseDirectory.AppLocalData, recursive: true }) const fileName = `Benchmaker-${update.version}.exe` - const updatePath = await join(updateDir, fileName) + const updatePath = await join(await appLocalDataDir(), updateDir, fileName) - await writeBinaryFile({ path: updatePath, contents: binary }) + await writeBinaryFile( + { path: `${updateDir}/${fileName}`, contents: binary }, + { dir: BaseDirectory.AppLocalData } + ) return updatePath }