Skip to content

Commit 3decbf5

Browse files
committed
Add a folder to test updates
1 parent cd18639 commit 3decbf5

6 files changed

Lines changed: 38 additions & 8 deletions

File tree

examples/api/src-tauri/tauri.conf.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@
7777
},
7878
"updater": {
7979
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDE5QzMxNjYwNTM5OEUwNTgKUldSWTRKaFRZQmJER1h4d1ZMYVA3dnluSjdpN2RmMldJR09hUFFlZDY0SlFqckkvRUJhZDJVZXAK",
80+
"dangerousInsecureTransportProtocol": true,
8081
"endpoints": [
82+
"http://localhost:5173/updater-test/updater.json",
8183
"https://tauri-update-server.vercel.app/update/{{target}}/{{current_version}}"
8284
]
8385
}

examples/api/src/views/Updater.svelte

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
<script>
2-
import { check } from '@tauri-apps/plugin-updater'
1+
<script lang="ts">
2+
import { check, Update } from '@tauri-apps/plugin-updater'
33
import { relaunch } from '@tauri-apps/plugin-process'
44
5-
export let onMessage
5+
let { onMessage } = $props()
66
7-
let isChecking, isInstalling, newUpdate
7+
let isChecking = $state(false)
8+
let isInstalling = $state(false)
9+
let newUpdate: Update = $state()
810
let totalSize = 0,
911
downloadedSize = 0
1012
@@ -54,14 +56,14 @@
5456
}
5557
}
5658
57-
$: progress = totalSize ? Math.round((downloadedSize / totalSize) * 100) : 0
59+
let progress = $derived(totalSize ? Math.round((downloadedSize / totalSize) * 100) : 0)
5860
</script>
5961

6062
<div class="flex children:grow children:h10">
6163
{#if !isChecking && !newUpdate}
62-
<button class="btn" on:click={checkUpdate}>Check update</button>
64+
<button class="btn" onclick={checkUpdate}>Check update</button>
6365
{:else if !isInstalling && newUpdate}
64-
<button class="btn" on:click={install}>Install update</button>
66+
<button class="btn" onclick={install}>Install update</button>
6567
{:else}
6668
<div class="progress">
6769
<span>{progress}%</span>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*
2+
3+
!.gitignore
4+
!README.md
5+
!updater.json
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
To test the updater:
2+
3+
1. Comment out `verify_signature` inside `plugins/updater/src/updater.rs`
4+
2. Run `pnpm tauri build --debug` to build the bundles
5+
3. Copy the bundle you want to test to this folder (`examples/api/updater-test/`)
6+
4. Run `pnpm tauri dev` and open the Updater tab to check
7+
8+
If the bundle you're testing doesn't exist in the `updater.json` yet, add it manually and welcome to open an PR
9+
10+
> The `updater.json` and debug bundles will be served by `vite`
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": "2.1.0",
3+
"notes": "Test update!",
4+
"pub_date": "2026-03-01T14:04:20+00:00",
5+
"platforms": {
6+
"windows-x86_64": {
7+
"signature": "",
8+
"url": "http://localhost:5173/updater-test/Tauri API_2.0.0_x64_en-US.msi"
9+
}
10+
}
11+
}

examples/api/vite.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default defineConfig(async () => {
2727
port: 5173,
2828
strictPort: true,
2929
fs: {
30-
allow: ['.', '../../tooling/api/dist']
30+
allow: ['.']
3131
}
3232
}
3333
}

0 commit comments

Comments
 (0)