Compare commits

...

750 Commits

Author SHA1 Message Date
Amr Bashir
a94e1b8595 fix(cef): copy CEF runtime files to target dir (#15211) 2026-04-09 16:07:54 +02:00
Amr Bashir
ccd978c984 fix(cef): ensure physical coordinate for setSize/setPos/setBounds operations on Windows (#15205) 2026-04-07 05:39:06 +02:00
Lucas Nogueira
37deabe7f1 fix: CEF locales copy 2026-04-04 08:08:46 -03:00
Lucas Nogueira
00eefcc71f fix: Windows bundling due to missing CEF dir copy regression 2026-04-04 07:39:18 -03:00
Lucas Nogueira
c641dfdde5 update cef 2026-04-03 06:48:51 -03:00
Lucas Nogueira
492ce3f54e chore: update CEF to 146.4.0 2026-04-02 11:02:46 -03:00
Lucas Nogueira
01cce3f4ad chore: do not enforce CN CEF 2026-04-02 10:06:13 -03:00
Lucas Nogueira
7079bf16e8 update cef 2026-04-01 17:02:19 -03:00
Lucas Fernandes Nogueira
cb1231b17a cherry-pick #14207 2026-04-01 18:27:50 +02:00
Lucas Nogueira
c990afc7a2 fix: do not enforce --no-default-features 2026-04-01 11:45:19 -03:00
amrbashir
115df34822 fix: adjust drag example for CEF after cherry picked commit 2026-03-28 02:07:27 +02:00
Amr Bashir
56bdbfdd9e feat: cover more cases for data-tauri-drag=region="deep", add example for QA (#15164) 2026-03-28 02:06:13 +02:00
Amr Bashir
b0b90feadd feat(cef): apply traffic light position on macOS after theme change (#15163) 2026-03-27 15:29:32 -03:00
Lucas Nogueira
d22195870b disable internal-toggle-devtools if devtools was disabled 2026-03-27 09:59:07 -03:00
Amr Bashir
27fcdbba9e fix(cef): ensure proper z-order for CEF child webviews on Windows (#15148) 2026-03-25 16:01:19 +02:00
Amr Bashir
ee3f3fac52 feat(cef): add application visibility control for macOS (#15113)
* feat: add application visibility control for macOS

* clippy

* clippy
2026-03-17 07:38:33 -03:00
FabianLars
ba06167f2e remove dbg logs in deb bundler 2026-03-16 16:12:16 +01:00
Amr Bashir
646fef61f2 fix: proper transparency on macOS and Windows (#15105) 2026-03-14 02:17:53 +02:00
Lucas Nogueira
b2e6c2a802 further theme fixes 2026-03-12 17:25:09 -03:00
Lucas Nogueira
3d58ae7e8b apply theme properly on macOS 2026-03-12 16:31:41 -03:00
Lucas Nogueira
ff49ed846e Merge branch 'dev' into feat/cef 2026-03-10 14:39:12 -03:00
Lucas Nogueira
3f77cc1ee6 fix: drag.js generated CSP regression from #15062 2026-03-10 14:39:01 -03:00
Lucas Nogueira
d2607689d0 Merge branch 'dev' into feat/cef 2026-03-10 09:25:55 -03:00
Amr Bashir
2dd9b15a2b feat: add data-tauri-drag-region="deep" (#15062)
* feat: add `data-tauri-drag-region="deep"`

supersedes #6362

* Update data-tauri-drag-region-deep.md

* summary is also clickable

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2026-03-10 09:25:41 -03:00
Amr Bashir
eacd36a4ea refactor(macos-sign): use base64 crate instead of Command (#15038)
* refactor(macos-sign): use base64 crate instead of Command

* add base64 crate as a dependency

* add change file

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2026-03-10 09:14:58 -03:00
Lucas Nogueira
0dcb454c24 fix CEF feature build, clippy 2026-03-10 08:54:01 -03:00
Lucas Nogueira
72e8d5e9ca Merge remote-tracking branch 'origin/dev' into feat/cef 2026-03-10 08:35:15 -03:00
Amr Bashir
9fee5b71d6 Revert "feat: add pattern-based header configuration support in HeaderConfig" (#15063)
* Revert "feat: add pattern-based header configuration support in HeaderConfig"

This reverts commit 18ff6466ca.

* clippy
2026-03-10 08:11:26 -03:00
FabianLars
a4ea971156 implement webview_version 2026-03-09 12:19:43 +01:00
Tony
6cb86c9e42 chore(deps): update @rollup/plugin-terser to v1 (#15057) 2026-03-08 10:54:28 +01:00
FabianLars
2967cf2091 revert schema version to draft-07 2026-03-06 14:07:07 +01:00
Fabian-Lars
50833703e4 ci(test-core): split cache per target (#15048) 2026-03-06 13:40:41 +01:00
FabianLars
fa2c0e91a9 don't add webkitgtk to deb/rpm deps for cef builds 2026-03-06 12:33:07 +01:00
Tony
8718d08163 enhance(cli): add context before prompting password (#15033)
* enhance(cli): add context before prompting password

* Add change file
2026-03-05 11:38:02 +08:00
Lucas Nogueira
a9525cfadf show dialog 2026-03-04 14:02:14 -03:00
Lucas Nogueira
ec9e4e8fb1 fix: properly call download handler 2026-03-04 13:45:30 -03:00
Tony
8230973ae8 chore: update js dependencies to fix audit (#15031)
* chore: update js dependencies

* Add serialize-javascript override
2026-03-04 21:10:25 +08:00
Tony
9b17a7aeae fix(ci): bump rustsec/audit-check to v2 and ignore time audit (#15030)
* fix(ci): bump rustsec/audit-check to v2

* Run on pull requests

* Add to ignore list
2026-03-04 18:11:01 +08:00
github-actions[bot]
d86827980d apply version updates (#14897)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-04 16:37:29 +08:00
Tony
3a65cc6885 fix(test): disable resolve_resource_dir on Android (#15026) 2026-03-03 22:37:10 +08:00
Tony
52cf195b78 refactor(cli): reduce some nesting code (#14844)
* refactor(cli): reduce some nesting code

* Handle all paths and config file change not first

* Bring back is_ignore
2026-03-03 21:27:55 +08:00
Tony
c3cbff3f74 fix: resource path handles ./ path differently (#14662)
* fix: resource path handles `./` path differently

* Setup CI for tauri utils

* Wrong job name

* Fix tests

* Always run tests and don't run doc tests

* Add change file

* Re-use `test-core` workflow

* Format

* Avoid path clone by calculating target first

* Test tauri-utils first with step instead of matrix

* Use `matrix.platform.command`

* Document `current_dest` and `current_pattern`

* More docs

* Merge remote-tracking branch 'upstream/dev' into refactor-resource-path-iter

* Test with doc tests

* Revert "Test with doc tests"

This reverts commit 388bee9328.

* Merge branch 'dev' into refactor-resource-path-iter

* Merge branch 'dev' into refactor-resource-path-iter
2026-03-03 21:15:44 +08:00
Tony
33754ae5e3 fix(cli): unusable empty password private keys (#15022)
* fix(cli): unusable empty password private keys

* Bump minisign to 0.9 and revert other changes

* Lock to `=0.7.3`
2026-03-03 20:23:50 +08:00
Tony
3935dee121 Add AI tool policy to contributing guide (#15002)
* Add AI tool policy to contrubuting guide

* Apply suggestions from code review

Co-authored-by: Fabian-Lars <30730186+FabianLars@users.noreply.github.com>

* nonsense -> nonsensical

---------

Co-authored-by: Fabian-Lars <30730186+FabianLars@users.noreply.github.com>
2026-03-03 17:45:42 +08:00
dependabot[bot]
33932a72b2 chore(deps-dev): bump svelte from 5.51.5 to 5.53.5 (#15015)
Bumps [svelte](https://github.com/sveltejs/svelte/tree/HEAD/packages/svelte) from 5.51.5 to 5.53.5.
- [Release notes](https://github.com/sveltejs/svelte/releases)
- [Changelog](https://github.com/sveltejs/svelte/blob/main/packages/svelte/CHANGELOG.md)
- [Commits](https://github.com/sveltejs/svelte/commits/svelte@5.53.5/packages/svelte)

---
updated-dependencies:
- dependency-name: svelte
  dependency-version: 5.53.5
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-01 11:27:29 +08:00
renovate[bot]
7d3c7593a9 chore(deps): update dependency rollup to v4.59.0 (#15001)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-28 22:07:20 +08:00
Lucas Nogueira
a2937ba743 fix example 2026-02-28 10:42:33 -03:00
Lucas Nogueira
dd4be2bdb9 make on_address_change available on R: Runtime 2026-02-28 10:21:59 -03:00
David
61abf00f40 feat(cef): add WebviewBuilder::on_address_change (#15010)
* fix:(cef): on_navigation for SPA

The current `on_navigation` callback only fires before full page loads. CEF `DisplayHandler::on_address_change` fires for ALL URL changes including `pushState`

* expose on_address_change instead

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2026-02-28 10:06:48 -03:00
Lucas Nogueira
84a37feedb include stderr in command error 2026-02-28 09:46:37 -03:00
FabianLars
934cf8b396 fix setuid in debian installer 2026-02-26 15:33:34 +01:00
FabianLars
bfe8e43c7c implement rpm installer 2026-02-26 15:18:36 +01:00
BiggerRain
f20256bca5 chore: fix clippy warnings (#14999) 2026-02-26 14:35:45 +01:00
FabianLars
10d60f4a99 implement debian installer 2026-02-26 13:38:02 +01:00
Lucas Nogueira
c8e7ab1889 chore: only add dev tools observer when needed 2026-02-25 10:41:13 -03:00
renovate[bot]
03514414d9 chore(deps): update dependency rollup to v4.58.0 (#14991)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-25 11:13:03 +08:00
Lucas Nogueira
d5e6b5f93d #[unsafe(no_mangle)] 2026-02-24 13:59:09 -03:00
Lucas Nogueira
2676f2adc9 devtools message passing 2026-02-23 23:03:39 -03:00
montyc1999
7b16dafb1d fix(tauri-utils): sort csp/plugin/header config maps during codegen so generate_context! is deterministic (#14986)
* fix(tauri-utils): sort csp/plugin/header config maps during codegen so generate_context! is deterministic

* add comments explaining rationale, and todo for removing the hack in v3
2026-02-23 23:14:56 +08:00
dependabot[bot]
7782c5525a chore(deps-dev): bump svelte from 5.35.6 to 5.51.5 (#14973)
Bumps [svelte](https://github.com/sveltejs/svelte/tree/HEAD/packages/svelte) from 5.35.6 to 5.51.5.
- [Release notes](https://github.com/sveltejs/svelte/releases)
- [Changelog](https://github.com/sveltejs/svelte/blob/main/packages/svelte/CHANGELOG.md)
- [Commits](https://github.com/sveltejs/svelte/commits/svelte@5.51.5/packages/svelte)

---
updated-dependencies:
- dependency-name: svelte
  dependency-version: 5.51.5
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-20 21:14:55 +08:00
renovate[bot]
aa0bf8bd19 chore(deps): update eslint monorepo to v10 (major) (#14922)
* chore(deps): update eslint monorepo to v10

* Update typescript-eslint and plugin security
2026-02-20 20:58:41 +08:00
dependabot[bot]
91fb0e161f chore(deps): bump keccak from 0.1.5 to 0.1.6 (#14972)
Bumps [keccak](https://github.com/RustCrypto/sponges) from 0.1.5 to 0.1.6.
- [Commits](https://github.com/RustCrypto/sponges/compare/keccak-v0.1.5...keccak-v0.1.6)

---
updated-dependencies:
- dependency-name: keccak
  dependency-version: 0.1.6
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-20 19:39:52 +08:00
montyc1999
88c05689c8 fix(deps): disable default-features in objc2 crates (#14967) 2026-02-18 21:31:23 +01:00
Lucas Fernandes Nogueira
8f71640250 fix: CEF CI (#14953)
* fix: CEF CI

* fmt

* update to rust 1.88, edition 2024

* install x86_64-apple-darwin

* linux clippy

* fix --all-features

* more all-features fixes

* install x86 apple

* fix windows

* fix doc tests

* skip --all-featuress test for android and ios

* more clippy fixes

* install target

* fix build, clippy

* export cef for tests

* pin version

* fix arg
2026-02-18 11:24:11 -03:00
David
0e5b4b713e fix(cef): zoom (#14964)
* fix(cef): zoom

* fmt

* fmt
2026-02-17 17:35:04 -03:00
Varun Chawla
6252432f07 fix(bundler): swap WIX registry search order to prioritize InstallDir (#14945) 2026-02-16 17:34:58 +01:00
Lucas Nogueira
465b42cb21 Merge remote-tracking branch 'origin/dev' into feat/cef 2026-02-15 16:45:52 -03:00
Lucas Nogueira
ebb0b3f9b9 tests 2026-02-15 16:44:48 -03:00
Lucas Nogueira
b576881ca4 clippy 2026-02-15 16:18:38 -03:00
Lucas Nogueira
6cfc582a07 fmt 2026-02-15 15:57:19 -03:00
Lucas Fernandes Nogueira
f73feaa35e Merge pull request #14952 from david-crabnebula/lemarier/cef-refcell
fix: refcell
2026-02-15 15:56:32 -03:00
FabianLars
2d0b80eb1c Revert "chore(deps): update rust crate time to v0.3.47 [security] (#14902)"
This reverts commit 86c8c870c8.
2026-02-15 14:19:06 +01:00
renovate[bot]
86c8c870c8 chore(deps): update rust crate time to v0.3.47 [security] (#14902)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-15 14:02:39 +01:00
cui
476e8ee7f3 fix(core): fix content-boundaries start/end order in asset protocol (#14938) 2026-02-15 13:53:01 +01:00
David
c9f29ae873 fix: refcell 2026-02-14 12:37:54 -05:00
Lucas Fernandes Nogueira
0d1cb83bab fix(cli): missing options on mobile dev/build commands (#14932)
* fix(cli): missing options on mobile dev/build commands

* avoid duplicated flags

* clippy
2026-02-12 21:12:00 -03:00
Lucas Nogueira
ece5dd1909 fix: avoid duplicated flags 2026-02-12 21:01:11 -03:00
Lucas Fernandes Nogueira
35c35f27ae fix(cli): features should support a comma separated list (#14931) 2026-02-12 12:24:40 -03:00
Lucas Nogueira
642fbbb324 fix missing cli options on mobile dev/build commands 2026-02-12 10:51:08 -03:00
Fabian-Lars
6dad457f24 fix: call on_window_destroyed for all window kinds (#14917)
* fix: call on_window_destroyed for all window kinds

* multiwebview support

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2026-02-10 09:23:51 -03:00
FabianLars
ed7b913df8 fix(appimage): add apparmor hook 2026-02-10 00:08:03 +01:00
Lucas Nogueira
e3bb8f73c9 remove dbg! statement 2026-02-09 08:34:07 -03:00
Amr Bashir
d12b176eb3 fix(cef): adjust inner size on Windows to account for borders (#14911) 2026-02-09 11:50:45 +01:00
Fabian-Lars
ad14d4c3ab fix(appimage): enable DEPLOY_CHROMIUM setting 2026-02-07 16:02:51 +01:00
Lucas Nogueira
ad9ab25e07 implement start_window_dragging on linux 2026-02-05 13:39:29 -03:00
Lucas Nogueira
98d75fabed single instance management for deep link support 2026-02-05 12:42:20 -03:00
renovate[bot]
7d01aa0417 chore(deps): update dependency rollup to v4.57.1 (#14868)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-05 23:16:42 +08:00
FabianLars
081910f61c remove webview2-com from tauri-runtime 2026-02-05 16:06:37 +01:00
Tony
7be58a1c64 chore(bundler): bring back binary patching log (#14894)
* chore(bundler): bring back binary patching log

* Fix change tag
2026-02-05 17:59:16 +08:00
dependabot[bot]
06374a902a chore(deps): bump bytes from 1.9.0 to 1.11.1 (#14890)
Bumps [bytes](https://github.com/tokio-rs/bytes) from 1.9.0 to 1.11.1.
- [Release notes](https://github.com/tokio-rs/bytes/releases)
- [Changelog](https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/bytes/compare/v1.9.0...v1.11.1)

---
updated-dependencies:
- dependency-name: bytes
  dependency-version: 1.11.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-04 23:06:29 +08:00
Lucas Nogueira
165a24ef83 fix refcell borrow crash 2026-02-04 10:51:13 -03:00
Lucas Nogueira
58dbfc6d75 use debug_cell 2026-02-04 10:34:49 -03:00
FabianLars
ede0c8ebe8 fix merge conflicts (macOS) 2026-02-03 16:18:43 +01:00
github-actions[bot]
c37368f339 apply version updates (#14884)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-03 11:54:01 -03:00
FabianLars
b29823c226 fix merge conflicts 2026-02-03 15:53:43 +01:00
goosewobbler
06f911aaff fix: don't inherit stdout from parent (#14871) 2026-02-03 11:20:42 -03:00
FabianLars
4118846d11 Merge remote-tracking branch 'origin/dev' into feat/cef 2026-02-03 15:12:07 +01:00
Lucas Fernandes Nogueira
eb5d88427a fix(codegen): Context generation with custom assets (#14883)
when custom assets are provided (`tauri::generate_context!(assets = my_assets)`) we can't use the fn inner logic directly and capture variables - we must pass them as arguments
2026-02-03 11:01:12 -03:00
FabianLars
540c5b4e59 chore(deps): update wrangler for undici update 2026-02-03 00:56:28 +01:00
FabianLars
5dbb37bab1 chore(api.js): Re-release 2.10.0 as 2.10.1 to fix npm package 2026-02-03 00:32:07 +01:00
FabianLars
19ded696de apply version updates 2026-02-02 23:05:28 +01:00
Fabian-Lars
08558b8ba4 chore(bundler): update gtk3 docs links in code comments (#14872) 2026-02-02 20:15:28 +01:00
Fabian-Lars
ce8fddb464 chore(deps): unlock webkit2gtk patch version (#14873) 2026-02-02 20:15:02 +01:00
Lucas Fernandes Nogueira
517b81e970 chore(api): release 2.10 (#14876)
api, CLI and tauri crates must be in sync
2026-02-02 16:09:22 -03:00
Lucas Fernandes Nogueira
cd68b03ee5 feat(ci): use trusted publishers for NPM publishing (#14874)
* feat(ci): use trusted publishers for NPM publishing

* bump npm version

* update npm

* use empty NODE_AUTH_TOKEN

* entire workflow permissions
2026-02-02 16:09:01 -03:00
github-actions[bot]
8d67af37b6 apply version updates (#14639)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-02 09:15:37 -03:00
Lucas Nogueira
f62b40e86f fix args 2026-02-02 08:54:52 -03:00
Lucas Nogueira
2b5f237319 allow media stream 2026-02-01 16:33:48 -03:00
Tunglies
9f0306fbcc refactor: rewrite some &String to &str (#14857)
* perf(tauri-build): refactor find_icon to use &str to remove unnecessary clones

* refactor(perf-tauri-build): remove obsolete changelog for find_icon refactor

* refactor(tauri-build): inline find_icon logic to simplify window icon path retrieval

* refactor(context): update find_icon predicate to use &str

* refactor(context): simplify predicate in find_icon to accept &&String

* Update crates/tauri-build/src/lib.rs

Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>

---------

Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>
2026-01-31 21:48:00 +08:00
renovate[bot]
f7c083cd41 chore(deps): update dependency rollup to v4.57.0 (#14820) 2026-01-31 20:32:55 +08:00
FabianLars
a2a7c6fbeb fix windows-rs features 2026-01-30 14:57:44 +01:00
FabianLars
655edd4d6e remove webkitgtk from tauri-runtime 2026-01-30 13:56:15 +01:00
FabianLars
1c24ef8a2a fix appimage bundler for cef using sharun 2026-01-29 22:00:48 +01:00
sftse
32576120fd Fix busy loop (#14839)
* refactor(tauri-cli):  remove unneeded Arc<Mutex>

* fix(tauri-cli): remove busy-looping
2026-01-29 11:13:03 +08:00
sftse
e3fdcb5002 refactor tauri-cli (#14836)
* refactor(tauri-cli): use OsString where possible

* refactor(tauri-cli): remove needless scoping blocks

* refactor(tauri-cli): make return type concrete

* refactor(tauri-cli): use ?

* refactor(tauri-cli): coerce later to trait object

* refactor(tauri-cli): remove clone

* refactor(tauri-cli): make better use of static OnceLock

* fix(tauri-cli): upgrade atomics to SeqCst

* Add change file

* Update .changes/change-pr-14836.md

Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>
2026-01-29 10:39:00 +08:00
sftse
d453e2e06a refactor(tauri-cli): remove trait implemented only once (#14840) 2026-01-29 10:35:55 +08:00
Fabian-Lars
20b99f9281 refactor: split appimage bundler in multiple files to support new backends (#14841) 2026-01-28 20:27:51 +01:00
Lucas Nogueira
612fadc9db improve window close logic - support user cancelling via onbeforeunload 2026-01-28 14:46:53 -03:00
Lucas Nogueira
568afcbcd9 let dev app be signed 2026-01-27 22:01:14 -03:00
Lucas Nogueira
b1bd198c5f workaround network service crash causing app load failures 2026-01-27 13:18:20 -03:00
FabianLars
b118087e6d lock cef versions 2026-01-27 15:12:00 +01:00
FabianLars
6be7a8ce7e fix nsis bundler 2026-01-27 13:46:19 +01:00
FabianLars
217b70a100 fix wix bundler 2026-01-27 13:13:40 +01:00
sftse
3a4e165b6f Less statics fixup (#14833)
* fix(tauri-cli): be more conservative to preserve behavior (#14804)

* refactor(tauri-cli): move app path initialization into commands
2026-01-27 16:33:11 +08:00
Lucas Nogueira
059c59a9c0 remove log 2026-01-26 14:54:00 -03:00
Lucas Nogueira
8c4141469b fix linux impl 2026-01-26 14:47:32 -03:00
Lucas Nogueira
4c8863fc59 fix tests 2026-01-26 14:35:14 -03:00
Lucas Nogueira
26e5d8f8c3 linux impl? 2026-01-26 14:25:57 -03:00
Lucas Nogueira
faf7d48f2f cef_entry_point macro 2026-01-26 14:13:53 -03:00
Fabian-Lars
efc4c26ebc chore: fix clippy lints (#14834) 2026-01-26 17:13:08 +01:00
Fabian-Lars
00426e376a fix: fix RuntimeInitArgs generic in MockRuntime::new_any_thread 2026-01-26 14:56:07 +01:00
Lucas Nogueira
e6e06cb446 update example 2026-01-26 10:01:37 -03:00
Lucas Nogueira
c741e3f15e fix macos build 2026-01-26 10:00:05 -03:00
Lucas Nogueira
98fdc7c5fa new window opener 2026-01-26 09:54:45 -03:00
Amr Bashir
fc405b3ae6 chore: update cef version to 144.1.0+144.0.7 (#14827) 2026-01-26 08:40:37 -03:00
Tony
7fca58230f chore(deps): update nsis_tauri_utils to 0.5.3 (#14830) 2026-01-26 17:55:27 +08:00
Kf637
c769f211fc feat(nsis): add Norwegian language support for installer (#14824)
* feat(nsis): add Norwegian language support for installer

* feat(nsis): add Norwegian language support for installer strings

* Add change file
2026-01-25 16:30:50 +08:00
Oscar Beaumont
4d5d78daf6 fix(specta): don't use #[specta(rename = ...)] with tauri::ipc::Channel (#14812) 2026-01-24 11:00:40 +01:00
Lucas Nogueira
5e36353d55 improve default features detection 2026-01-22 14:04:22 -03:00
renovate[bot]
4794a6ba22 chore(deps): update dependency rollup to v4.55.2 (#14808)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-22 14:09:19 +01:00
dependabot[bot]
09a4e7f55a chore(deps-dev): bump wrangler from 4.20.3 to 4.59.1 (#14806)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-22 14:06:29 +01:00
Fabian-Lars
c862a0bd8c fix(core): update error wording for invalid version field (#14800)
* fix(core): update error wording for invalid version field

fixes #14799

* fmt
2026-01-21 10:42:15 +08:00
Quentin Goinaud
f82594410c feat(cli): allow electron to start tauri (#13253)
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
2026-01-20 22:19:05 +01:00
Ishita Singh
853ed4642f fix(android): improve error handling for external storage file access (#14442)
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2026-01-20 21:52:11 +01:00
Tony
53611c4d7b fix(cli): only watch dependent workspace members (#14747)
* fix(cli): only watch dependent workspace members

* Use manifest path instead of `workspace_default_members`

* Add change file

* Merge remote-tracking branch 'upstream/dev' into only-watch-dependencies

* `bug` not `fix`

* Merge branch 'dev' into only-watch-dependencies

* Remove `CargoMetadataExpended`

* Merge remote-tracking branch 'upstream/dev' into only-watch-dependencies

* Remove top level `.taurignore`

* Load ignore files from workspace root
2026-01-20 17:52:34 +08:00
Lucas Fernandes Nogueira
62aa13a124 fix(cli): Android build --apk and --aab flags requiring a value (#14629)
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2026-01-19 20:32:43 +01:00
Luke
e919a760ed feat(webview-window): add set_simple_fullscreen to WebviewWindow (#14619)
* feat(webview): add set_simple_fullscreen to WebviewWindow

* add changes

* Combine per platform fn to one

---------

Co-authored-by: Tony <legendmastertony@gmail.com>
2026-01-19 11:38:37 +08:00
kandrelczyk
0575dd287e fix(bundler): patch bundle type via string replacement (#14521)
Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>
Co-authored-by: FabianLars <github@fabianlars.de>
2026-01-18 23:51:02 +01:00
Lucas Fernandes Nogueira
eccff97588 fix(cli): possibly empty associated-domains entitlement (#14779) 2026-01-18 19:01:36 +01:00
Tony
08e35fcda0 refactor(cli): remove mutex on config (#14791)
* refactor(cli): remove mutex on config

* Fix ios

* Clippy

* Fix ios

* Unused import

* Fix ios closure and clippy

* Import `ConfigMetadata`

* Remove life time tags
2026-01-18 21:09:36 +08:00
Tony
10a8066db3 refactor(cli): reorder a few parameters (#14792) 2026-01-18 20:57:36 +08:00
Tony
ea31b07f19 fix(cli): inspect's description (#14789) 2026-01-17 19:23:12 +02:00
sftse
7f7d9aac21 Less statics (#14668)
* refactor(tauri-cli): introduce replacement functions

* refactor(tauri-cli): apply replacement to remove.rs

* refactor(tauri-cli): apply replacement to icon.rs

* refactor(tauri-cli): apply replacement to bundle.rs

* refactor(tauri-cli): apply replacement to build.rs

* refactor(tauri-cli): apply replacement to add.rs

* refactor(tauri-cli): apply replacement to dev.rs

* refactor(tauri-cli): less controlflow

* refactor(tauri-cli): split config loading from locking static

* refactor(tauri-cli): remove duplicate checks covered by if let Some(tauri_dir) = tauri_dir

tauri_dir.is_some() must be true, otherwise the entire block is not run, so the frontend_dir check
is irrelevant

* fmt

* refactor(tauri-cli): apply replacement to inspect.rs

* refactor(tauri-cli): dont use statics for config

* refactor(tauri-cli): finish threading directory paths through functions

* fix: clippy

* fixup CI

* refactor(tauri-cli): dont need mutex

* refactor(tauri-cli): rescope mutex use to minimal necessary

* fix CI, reduce mutex use

* fixup PR #14607

* fix: clippy

* refactor(tauri-cli): remove ConfigHandle

* refactor(tauri-cli): remove more unwraps and panicing functions

* refactor(tauri-cli): less mutexes

* refactor(tauri-cli): undo mistaken change, address review comment

* Split android build to 2 functions

* Pass in dirs to migration v1 like the v2 beta

* Add change file

---------

Co-authored-by: Tony <legendmastertony@gmail.com>
2026-01-17 23:52:42 +08:00
yy
7873c4a1c6 docs: fix typos in comments (#14787) 2026-01-17 12:30:14 +01:00
Fabian-Lars
123d63a0c1 chore: change webkit2gtk bump to minor 2026-01-15 17:00:58 +01:00
Lucas Nogueira
3db9268a92 fix empty entitlements 2026-01-15 12:09:58 -03:00
Fabian-Lars
75057c7c08 chore(deps): update wry to 0.54 and webkit2gtk-rs to 2.0.2 (#14778) 2026-01-15 14:48:45 +01:00
sftse
268bb339f0 build(tauri-macos-sign): remove once-cell-regex (#14766)
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2026-01-15 13:14:30 +01:00
renovate[bot]
07788af13f chore(deps): update rust crate signal-hook-tokio to 0.4 (#14729)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: FabianLars <github@fabianlars.de>
2026-01-15 12:53:18 +01:00
renovate[bot]
9a53c84ec0 chore(deps): update dependency globals to v17 (#14730)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-15 12:28:04 +01:00
renovate[bot]
137576e8a4 chore(deps): update dependency rollup to v4.55.1 (#14746)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-15 11:51:21 +01:00
Wuelfhis Asuaje
1b0e335d3f Fix: Updater signer failed signing file without extension (#14713)
* fixing bug where updater signer failed signing file withou extension

* removing  unnecessary unwrap()

* Adding change file. Removing commnent. Adding TODO.

* Apply suggestions from code review

---------

Co-authored-by: Wuelfhis Asuaje <wasuaje@shorecg.com>
Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>
2026-01-14 09:09:45 +08:00
FabianLars
152c6e7c60 fix: also add rustls dep on desktop for cef dev server 2026-01-13 13:05:28 +01:00
FabianLars
29d3d196b2 Merge remote-tracking branch 'origin/dev' into feat/cef 2026-01-13 12:24:51 +01:00
Lucas Nogueira
9e04e45d85 fix prod url 2026-01-12 09:08:28 -03:00
Amr Bashir
84b04c4a8d fix: fix leftover inconsistent env var in tauri signer sign command (#14759) 2026-01-11 20:37:52 +02:00
Tony
897529d7a2 fix: map rustls-tls to reqwest/rustls-no-provider (#14726)
Co-authored-by: FabianLars <github@fabianlars.de>
2026-01-08 15:14:51 +01:00
Lucas Nogueira
1919b078a2 pull version from Cargo.lock, version specific directory 2026-01-08 08:00:31 -03:00
Lucas Nogueira
d20ebe461a use old registry for linux for now 2026-01-08 07:26:07 -03:00
Amr Bashir
270ba683df fix: fix transparency (#14743) 2026-01-07 14:38:01 -03:00
Lucas Nogueira
4b8688cff7 fix build on windows 2026-01-07 11:04:00 -03:00
Lucas Nogueira
1aa854cbd3 Merge remote-tracking branch 'origin/dev' into feat/cef 2026-01-07 10:25:05 -03:00
Lucas Nogueira
317cba830a update cef 2026-01-07 10:11:54 -03:00
dependabot[bot]
3d102e0c13 chore(deps): bump rsa from 0.9.7 to 0.9.10 (#14738)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-06 19:26:47 +01:00
Fabian-Lars
fea4d02403 chore(deps): update rkyv, closes #14734 (#14736) 2026-01-06 11:16:00 +01:00
Tony
a03219ca19 refactor(cli): disable jsonschema resolving external resources (#14725)
* refactor(cli): disable jsonschema resolving external resources

* Move `CONFIG_SCHEMA_VALIDATOR` to fn

* Format

* Update ureq to fix compile on linux

* New clippy warnings
2026-01-03 19:30:42 +08:00
renovate[bot]
b75ea5bead chore(deps): update rust crate reqwest to 0.13 (#14724)
* chore(deps): update rust crate reqwest to 0.13

* Fix feature name

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tony <legendmastertony@gmail.com>
2026-01-03 12:34:59 +08:00
Fabian-Lars
dcd1a65889 chore: fix tests (#14720)
* chore: fix tests

* windows
2026-01-02 16:02:23 +01:00
Camilla F
9b242e40c8 fix: BSD support in tauri-runtime (#14700)
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-12-29 17:29:07 +01:00
Bruno Verachten
1dbf6fd067 feat(cli): add RISC-V 64-bit pre-built binary support (#14685)
* feat(cli): add RISC-V 64-bit pre-built binary support

Add riscv64gc-unknown-linux-gnu target to the tauri-cli release workflow,
enabling pre-built binaries for RISC-V 64-bit Linux systems.

This eliminates the multi-hour QEMU compilation time that currently blocks
RISC-V adoption of Tauri apps. Native compilation on RISC-V hardware
takes ~63 minutes.

Changes:
- Add RISC-V entry to build matrix with self-hosted runner support
- Support custom `runs_on` field for matrix entries (falls back to `os`)
- Skip dtolnay/rust-toolchain and rust-cache for self-hosted runners
- Source ~/.cargo/env for self-hosted runners where Rust is pre-installed

Tested on:
- Hardware: Banana Pi F3 (RISC-V64, 16GB RAM)
- OS: Debian Trixie (required for WebKit2GTK RISC-V support)
- Build time: 1h 2m 28s
- Binary: ELF 64-bit RISC-V, 16MB stripped

* feat(cli): use cross for RISC-V cross-compilation

Switch from self-hosted runners to cross-rs for building RISC-V binaries.
This approach is simpler and doesn't require maintaining self-hosted infrastructure.

Local testing confirms cross builds a valid RISC-V binary in ~4 minutes.

* refactor(cli): address review feedback for RISC-V workflow

- Skip Rust toolchain and cache setup for cross builds (unnecessary)
- Pin cross version to 0.2.5 for reproducibility
- Fix Linux dependencies condition to match ubuntu-* variants
2025-12-29 10:21:49 -03:00
Tony
8a43e4f9d9 refactor: use u64 instead of usize for nonce gen (#14708) 2025-12-29 08:43:09 -03:00
sftse
a2abe2e6bc refactor(cli): simplify features: Option<Vec<String>> to Vec<String> (#14607)
* refactor: use empty vector for features instead of None

* refactor: reorder

* add change file

* comment: highlight places where serialization is used

* refactor: simplify serialization

* Update .changes/empty-vec-instead-of-none.md

* Update crates/tauri-cli/src/mobile/ios/mod.rs

---------

Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>
2025-12-29 13:54:51 +08:00
Tony
51f0fcb69c docs: pixel units (#14702) 2025-12-28 10:40:03 +08:00
Tony
0650852d14 docs: things related to WebviewUrl (#14692)
* Typos

* Rename to `handler`/`protocol_handler`

* Fix the `AssetResolver::get` fallback docs

* Refactor and update the docs for `get_url`

* Rename the remaining ones to `get_app_url`

* Apply suggestions from code review

Co-authored-by: Fabian-Lars <github@fabianlars.de>

* Generate schema
2025-12-25 20:05:02 +08:00
Kushal Meghani
c1d82eb3a3 fix(linux): reuse WebContext to prevent WebKitNetworkProcess leak (#14628)
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-12-25 13:03:15 +01:00
renovate[bot]
51a0d6d66d chore(deps): update dependency rollup to v4.54.0 (#14688)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-23 22:49:57 +08:00
renovate[bot]
7f48ee9068 chore(deps): update rust crate toml_edit to 0.24 (#14683)
* chore(deps): update rust crate toml_edit to 0.24

* Downgrade indexmap to 2.11.4 for MSRV

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tony <legendmastertony@gmail.com>
2025-12-21 22:04:33 +08:00
renovate[bot]
e290642fb4 chore(deps): update dependency rollup to v4.53.5 (#14676)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-19 17:15:17 +08:00
Lucas Nogueira
46ff50027f use separate helper for macOS to optimize bundle size 2025-12-18 11:54:39 -03:00
renovate[bot]
b79386010d chore(deps): update dependency rollup to v4.53.4 (#14670)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-18 22:49:52 +08:00
Lucas Nogueira
9d143bdac2 do not set macos dev icon on cef 2025-12-18 09:50:39 -03:00
Lucas Nogueira
9dbbb3d415 Merge branch 'feat/bundler-liquid-glass-icon' into feat/cef 2025-12-18 09:44:38 -03:00
Lucas Nogueira
d5751e6ebf fix build 2025-12-18 09:43:47 -03:00
Lucas Nogueira
e4621497ba fmt 2025-12-18 09:41:30 -03:00
Lucas Nogueira
8254e5af6d feat(bundler): support Liquid Glass icons, closes #14207
the `icon` config now supports loading an Assets.car directly or a `.icon` (Icon Composer asset) that gets compiled into an Assets.car file
2025-12-18 09:39:34 -03:00
Amr Bashir
e6e65e9bb5 feat(cef): implement traffic light positioning (#14660)
* feat(cef): implement traffic light positioning

* handle X axis as well
2025-12-16 07:11:34 -03:00
Amr Bashir
73a748ed20 feat(cef): add browser navigation methods (goBack, goForward, ...etc) (#14661) 2025-12-15 21:24:09 +02:00
Amr Bashir
062650e1a9 fix(cef/macos): fix TitleBarStyle::Visible have full size content view (#14648) 2025-12-15 06:56:34 -03:00
Amr Bashir
6409df3466 fix(cef): ensure valid content view on macOS to avoid interactivity issues (#14650)
* fix(cef): ensure valid content view on macOS to avoid interactivity issues

* fix on reparenting as well
2025-12-15 06:56:10 -03:00
Tony
ff5d76ca21 fix: default WindowConfig::focus to false in Default::default (#14653) 2025-12-14 16:21:44 +08:00
amrbashir
ad91cec0ef fix build on linux 2025-12-11 16:22:43 +02:00
Amr Bashir
67fa548168 refactor(cef): use native subviews instead of CEF's overlay (#14642)
* refactor(cef): use native subviews instead of CEF's overlay

* add windows implementation
2025-12-11 10:43:18 -03:00
sftse
2d28e3143e Cleanups (#14632)
* refactor(tauri-utils): current_dest and current_pattern always change in-sync, group them to one Option

* refactor(tauri-utils): pass path as explicit argument instead of implicitly through self

* refactor(tauri-utils): remove struct field that is never set to Some

* refactor(tauri-cli): use OsString, OsStr where possible

* refactor(tauri-cli): Deref Arc early

* refactor(tauri-cli): lock config before passing to build::setup()

* refactor(tauri-build, tauri-utils): bettern pattern matching and borrowing

* refactor(tauri-cli): dont need Arc if already have static

* fix(tauri-cli): race condition initializing static flag, remove unnecessary OnceLock

* refactor(tauri-cli): use expect

* refactor(tauri-cli): remove unnecessary OnceLock

* refactor(tauri-cli): better use of dunce api

* refactor(tauri-cli): rename
2025-12-09 21:38:14 +08:00
renovate[bot]
18c69df8c7 chore(deps): update worker-rs crates to 0.7 (#14638)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: FabianLars <github@fabianlars.de>
2025-12-09 13:42:27 +01:00
github-actions[bot]
f2e0405dc2 apply version updates (#14592)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-12-09 12:41:05 +01:00
FabianLars
54e8d93db1 ci(renovate): group worker-rs updates 2025-12-09 12:11:53 +01:00
Tony
251203b896 fix(linux): work area returns logical rect (#14637) 2025-12-09 18:05:12 +08:00
Lucas Nogueira
0651215ef5 Merge remote-tracking branch 'origin/dev' into feat/cef 2025-12-08 10:30:48 -03:00
Lucas Nogueira
e6241aa7a7 fix mac build 2025-12-08 10:28:54 -03:00
Tony
91becd9e4f fix(nsis): plugins not signed (#14627) 2025-12-08 20:13:52 +08:00
Tony
018b4db22e fix(bundler): skip signing for nsis uninstaller on --no-sign (#14625) 2025-12-08 20:13:43 +08:00
Amr Bashir
49b99f31b5 fix(cef): fix start_window_dragging on Windows (#14618) 2025-12-08 09:13:22 -03:00
Lucas Nogueira
a0b5d84140 fix --aab flag 2025-12-08 08:33:40 -03:00
Tony
731dd5bfdc docs: remove $APP and $LOG from FsScope (#14623) 2025-12-07 23:09:11 +08:00
Tony
7b1b3514df changes(cli): log npm package version parse in debug level (#14621) 2025-12-07 21:06:27 +08:00
sftse
546b296405 fix(tauri-bundler): add a bit more context to error message (#14606) 2025-12-05 11:56:34 +08:00
Tunglies
514cf21e14 chore(deps): update num-bigint-dig to version 0.8.6 (#14591)
* chore(deps): update num-bigint-dig to version 0.8.6

* Update .changes/bump-version-num-bigint-dig.md

---------

Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>
2025-12-02 10:20:35 +08:00
renovate[bot]
60174527c0 chore(deps): update rust crate ico to 0.5 (#14589)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-02 10:19:09 +08:00
chfaft
4176f93ae4 feat(bundler): consider extensions defined in main.wxs. (#14570)
* feat(bundler): consider extensions defined in main.wxs.

* chore(bundler): apply nitpick and add a change file.

* Update crates/tauri-bundler/src/bundle/windows/msi/mod.rs

chore(bundler): avoid clone and use reference.

Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>

* Update .changes/support-template-extensions.md

chore(bundler): reclassify changes.

Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>

---------

Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>
2025-12-02 09:58:35 +08:00
github-actions[bot]
4408f72af6 apply version updates (#14467)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-11-30 11:22:38 +01:00
Fabian-Lars
1496145f82 fix(bundler): typo in 32bit arch (#14585)
* fix(bundler): typo in 32bit arch

* changefile
2025-11-30 07:49:33 +01:00
hrzlgnm
f022b2d1ae fix(cli): Skip signing bundles entirely if --no-sign is requested (#14582)
Closes #14581
2025-11-30 11:45:43 +08:00
Fabian-Lars
1573c72402 fix: remove \\r from schema files on windows (#14561) 2025-11-26 11:22:45 +01:00
Lucas Nogueira
a2d18312f8 update setsize 2025-11-25 16:14:49 -03:00
Lucas Nogueira
387f4f243a fix android 2025-11-25 13:42:21 -03:00
Lucas Nogueira
0201110835 fix clioptions not applying on initial mobile build 2025-11-25 13:06:48 -03:00
Lucas Nogueira
6622b50947 fix mobile build 2025-11-25 12:25:02 -03:00
renovate[bot]
dd7e59a495 chore(deps): update dependency rollup to v4.53.3 (#14519)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-24 13:25:01 +08:00
Fabian-Lars
2d2a1be429 docs(cli): fix formatting of paths 2025-11-20 15:02:46 +01:00
Lucas Nogueira
4651a52744 fix build 2025-11-19 19:43:26 -03:00
Lucas Nogueira
f18723ceb6 only trigger navigation handler for main frame navigation 2025-11-19 19:42:01 -03:00
Lucas Nogueira
ec12a049b5 chore: disable caching for custom protocol 2025-11-19 16:54:13 -03:00
Fabian-Lars
afdd288eab chore(deps): update js-yaml (#14498) 2025-11-19 11:53:13 +01:00
Lucas Nogueira
5dc94d70d5 fix setbounds 2025-11-18 13:50:57 -03:00
Fabian-Lars
79a7d9ec01 fix(cli): change Cargo.toml version check to debug log (#14468) 2025-11-18 16:08:17 +01:00
Tony
f855caf8a3 fix(cli): mismatched versions check for pnpm (#14481) 2025-11-18 18:16:29 +08:00
Tunglies
ee3cc4a91b perf: remove needless clones in various files for improved performance (#14475)
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-11-17 15:27:49 +01:00
Lucas Nogueira
0ef43be6f0 fix linux build 2025-11-17 08:11:47 -03:00
amrbashir
df7e7208a4 fix build on Windows 2025-11-17 03:47:29 +02:00
Lucas Nogueira
f287ea52bc update cef 2025-11-16 20:42:53 -03:00
Lucas Nogueira
10e3a8214e Merge remote-tracking branch 'origin/dev' into feat/cef 2025-11-16 20:35:05 -03:00
Lucas Nogueira
578ca15a64 support adding child webviews to a WebviewWindow 2025-11-16 11:27:08 -03:00
Tony
b5ef603d84 chore(deps): update NSIS to 3.11 (#14478) 2025-11-16 21:56:05 +08:00
amrbashir
81521189d1 fix compilation on Windows 2025-11-16 15:27:02 +02:00
Lucas Nogueira
f778fe8f86 Merge remote-tracking branch 'origin/feat/cef-headers-patterns' into feat/cef 2025-11-16 10:00:33 -03:00
Lucas Nogueira
ce21a20e51 start dragging 2025-11-16 09:58:12 -03:00
Tunglies
ce98d87ce0 refactor: remove needless collect (#14474)
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-11-16 12:49:20 +01:00
Aleksey Ponomarev
ad1dec2e24 fix(core): properly handle async errors in addPluginListener (#14464)
* fix(core): properly handle async errors in addPluginListener

The previous implementation used .then() after invoke() without await, which prevented the catch block from handling rejected promises. Now using await to properly catch errors and allow fallback to camelCase registerListener method.

* Change file and generate `bundle.global.js`

---------

Co-authored-by: Tony <legendmastertony@gmail.com>
2025-11-15 12:07:51 +08:00
renovate[bot]
beffcd880f chore(deps): update dependency rollup to v4.53.2 (#14459)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-15 10:23:57 +08:00
amrbashir
18ff6466ca feat: add pattern-based header configuration support in HeaderConfig 2025-11-14 17:59:16 +02:00
Lucas Nogueira
8779deb450 implement RunEvent::Opened 2025-11-13 16:33:09 -03:00
github-actions[bot]
956031d73d apply version updates (#14458)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-11-13 09:14:14 -03:00
Lucas Nogueira
4f2179a263 fix center 2025-11-13 08:37:37 -03:00
Lucas Fernandes Nogueira
4b00130b86 refactor(core): improve iOS log messages from stdout/stderr (#14385)
* refactor(core): improve iOS log messages from stdout/stderr

move the stdout/stderr forward logic to Swift so it does not consume a Rust thread and never deadlocks on the simulator

I had to work on this because i'm facing #12172 again on latest Xcode (26.1)

* patch
2025-11-13 08:18:50 -03:00
Tony
8e3bd63db9 perf(codegen): wrap generated context in a fn (#14457)
* perf(codegen): wrap generated context in a fn

* Add comment about the reasoning
2025-11-13 15:24:10 +08:00
Lucas Nogueira
01f2252f19 rename 2025-11-12 11:45:41 -03:00
renovate[bot]
cfe47871a5 chore(deps): update dependency rollup to v4.53.1 (#14444)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-12 22:05:17 +08:00
Lucas Nogueira
a61ba6c80d fix entitlmeents for cef 2025-11-12 10:56:26 -03:00
Lucas Nogueira
a22c8fe03b can't use symlinks when signing 2025-11-12 10:19:01 -03:00
Amr Bashir
481fb63acf fix(cef): inject init scripts CSP only if it was set in request headers (#14451) 2025-11-12 08:28:13 -03:00
Lucas Nogueira
1061eefc86 fix devtools feature 2025-11-12 08:24:07 -03:00
Lucas Nogueira
fd908431d5 pin cef 2025-11-12 07:24:57 -03:00
Lucas Nogueira
c86b2efa1b reuse bundler in macos_dev 2025-11-12 07:23:11 -03:00
Fabian-Lars
236f55b7aa docs: enable dynamic-acl feature on docs.rs (#14452) 2025-11-12 10:21:18 +01:00
Lucas Nogueira
f72af40bab wip CEF bundling 2025-11-11 23:38:08 -03:00
Lucas Nogueira
d48ce1fc4a fix borrow 2025-11-11 15:15:49 -03:00
Lucas Nogueira
2c52420c99 lint 2025-11-11 14:59:19 -03:00
Lucas Nogueira
2ca4c75083 fix deadlock 2025-11-11 14:49:28 -03:00
Lucas Nogueira
f1f5b58c88 update cef 2025-11-11 10:29:41 -03:00
Lucas Nogueira
147ff6be30 export library path 2025-11-11 07:59:58 -03:00
Lucas Nogueira
8a9100dde6 fix content area on macos 2025-11-10 16:09:09 -03:00
Lucas Nogueira
d337e1917e Merge remote-tracking branch 'origin/feat/cef' into feat/cef 2025-11-10 15:25:08 -03:00
Lucas Nogueira
61d35c9a97 fix window icon 2025-11-10 17:57:27 -03:00
Lucas Nogueira
a2bfca6669 readd auto resize 2025-11-10 15:24:32 -03:00
Lucas Nogueira
96a87ffb4f rename variables 2025-11-10 15:23:47 -03:00
Lucas Nogueira
b15cd16746 rename runtime style enum 2025-11-10 14:40:26 -03:00
Lucas Nogueira
8731c97650 fix position on multiwebview 2025-11-10 13:43:30 -03:00
Lucas Nogueira
49e83d0544 lint 2025-11-10 11:23:43 -03:00
Lucas Nogueira
8bdd6fdb31 copy cef files to out dir 2025-11-10 10:51:28 -03:00
github-actions[bot]
9bb7e79e97 apply version updates (#14425)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-11-09 12:48:27 +01:00
FabianLars
d566679a99 ci: don't re-generate lockfile on prepublish 2025-11-09 12:08:57 +01:00
Lucas Nogueira
7805aafd84 handle close of browser windows 2025-11-07 13:08:30 -03:00
Lucas Nogueira
d01dd8ea90 fix incorrect label on custom protocol
cache_path can be shared between contexts, which ends up overwriting the handler factory instance
so we move everything to the appwebview instance instead
2025-11-07 12:58:47 -03:00
Lucas Nogueira
710b3c7851 cleanup 2025-11-06 23:45:20 -03:00
Kushal Meghani
3899d456d4 Address review comments (#14426)
* Address review comments

* Revert comments in `impl FromStr for ConfigValue`
2025-11-07 09:38:05 +08:00
Lucas Nogueira
c3a1f2bb1e fix cef dev proxy 2025-11-06 21:26:14 -03:00
Lucas Nogueira
c04f4d06f2 wip create full chrome browser_window 2025-11-06 16:00:01 -03:00
Lucas Nogueira
b42fe1d08a fix exit events 2025-11-06 09:16:12 -03:00
Lucas Nogueira
6b87f8f333 move custom_scheme_url to runtime 2025-11-06 09:07:37 -03:00
Lucas Nogueira
8801df6b5c only proxy when actually using dev server 2025-11-06 08:51:18 -03:00
Lucas Nogueira
6565c49e61 update example 2025-11-06 08:20:46 -03:00
Lucas Nogueira
66d86b8092 rename fn 2025-11-06 07:54:55 -03:00
amrbashir
1301cb190a fix windows compile 2025-11-06 06:25:37 +02:00
Lucas Nogueira
96029aae76 use http for custom schemes (better support overall e.g. extensions) 2025-11-06 01:06:32 -03:00
Lucas Nogueira
315207e6bd make command_line_args cef-only 2025-11-06 00:55:30 -03:00
Lucas Nogueira
b291a09ac2 add platform-specific webview attributes structure 2025-11-06 00:42:47 -03:00
Lucas Nogueira
72374cfc25 lint 2025-11-06 00:15:31 -03:00
Amr Bashir
4e9b83cf73 feat: add tauri::Builder::cef_command_line_args method (#14417)
* feat: add `tauri::Builder::cef_command_line_args` method

* remove cef feature from tauri-runtime

* support arguments, make it append

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-11-06 00:15:12 -03:00
Lucas Nogueira
e934a4c420 Merge remote-tracking branch 'origin/feat/cef' into feat/cef 2025-11-05 23:48:45 -03:00
Lucas Nogueira
042750a70a disable openDevtools if devtools_enabled 2025-11-05 23:45:50 -03:00
Tony
b586ecf1f4 fix(cli): demultiply tiny skia pixels (#14416)
* fix(cli): demultiply tiny skia pixels

* Pull resize out to a function `resize_image`

* Move comments as well

* Use cow for older rust versions
2025-11-06 10:12:10 +08:00
Fabian-Lars
dd70d213cd chore(deps): update minisign to 0.8 (#14415) 2025-11-05 14:58:54 +01:00
Kushal Meghani
d06a1994e9 refactor: improve cli code readability (#14333) 2025-11-05 13:48:32 +01:00
Lucas Nogueira
0a54cb82ff fix IPC on windows 2025-11-04 19:33:37 -03:00
Lucas Nogueira
f79e9d91b1 improve event loop 2025-11-04 19:16:36 -03:00
Lucas Nogueira
342cf09a13 lint 2025-11-04 17:50:28 -03:00
Lucas Nogueira
b2fb60dfc1 fix windows build 2025-11-04 16:54:41 -03:00
Lucas Nogueira
b27571caf9 fix linux build 2025-11-04 13:28:27 -03:00
Lucas Nogueira
30660d0327 Merge remote-tracking branch 'origin/dev' into feat/cef 2025-11-04 13:17:10 -03:00
Lucas Nogueira
c93cc96b71 fix cli macos build 2025-11-04 13:10:05 -03:00
Lucas Nogueira
5727229425 fix macos build 2025-11-04 13:05:39 -03:00
github-actions[bot]
b446a858de apply version updates (#14409)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-11-04 17:00:19 +01:00
Lucas Nogueira
193d0edfb4 ensure CEF is installed (CLI) 2025-11-04 12:59:33 -03:00
Lucas Nogueira
2e291e1e85 bg color 2025-11-04 10:24:21 -03:00
Lucas Nogueira
fd0ad78260 implement devtools_enabled, incognito, javascript_disabled, clipboard 2025-11-04 10:17:36 -03:00
Lucas Nogueira
c7131ed91c download_handler 2025-11-04 08:53:11 -03:00
Lucas Nogueira
21593e4023 navigation handler 2025-11-04 07:44:39 -03:00
Lucas Nogueira
d53e46dc84 document title change event 2025-11-04 07:41:05 -03:00
renovate[bot]
85ba5315c2 chore(deps): update dependency @types/node to v24 (#14376)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-04 11:27:01 +01:00
Adam
779612ac84 fix(cli): respect required-features field from Cargo.toml (#14379)
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-11-04 11:16:01 +01:00
Fabian-Lars
22edc65aad fix(bundler/cli): set user-agent when fetching build tools (#14408) 2025-11-04 10:53:44 +01:00
Tony
9a19226369 fix(nsis): uninstall fails when manually close app on kill app dialog (#14410) 2025-11-04 17:18:21 +08:00
Chase Knowlden
fd8c30b4f1 fix: premultiply alpha before resizing (fix #14351) (#14353)
* fix: Premultiply alpha before resizing

* feat: Use rayon for process speedup

* Fix change tag

* `cargo fmt`

* Document reasoning & use imageops::resize directly

---------

Co-authored-by: Tony <legendmastertony@gmail.com>
2025-11-04 11:16:11 +08:00
Lucas Nogueira
10dfef5d25 use native center 2025-11-03 14:00:02 -03:00
Lucas Nogueira
1a8d171867 use_value_delimiter 2025-11-03 11:51:22 -03:00
Lucas Nogueira
916565aab1 fix size/pos check 2025-11-03 11:21:45 -03:00
Lucas Nogueira
a514841311 fix syntax 2025-11-03 11:17:01 -03:00
Lucas Nogueira
53ecab3f5c resize/moved events 2025-11-03 11:15:53 -03:00
FabianLars
1b23e9921d fix windows compile error 2025-11-03 15:14:26 +01:00
Lucas Nogueira
f5ca88ef57 get back to attributes in delegate 2025-11-03 10:37:19 -03:00
Lucas Nogueira
a6ad473c0c impl autoresize 2025-11-03 10:30:56 -03:00
Lucas Nogueira
4613e19d20 use fix branch for delegate cast 2025-11-03 10:25:54 -03:00
Lucas Nogueira
8888d18173 fix webview bounds getters (fallback to window) 2025-11-03 07:58:15 -03:00
Lucas Nogueira
bfb417c8ce improve getter on main thread 2025-11-03 00:48:15 -03:00
Lucas Nogueira
090edf0ba3 fix mime type 2025-11-03 00:31:05 -03:00
Lucas Nogueira
11ed037bde fix build without isolation feature 2025-11-02 23:52:24 -03:00
Lucas Nogueira
4f0294ed4e show window buttons on macOS 2025-11-02 21:49:05 -03:00
Lucas Nogueira
637725dc46 fix race condition (url not loading?) 2025-11-02 21:47:26 -03:00
Lucas Nogueira
df376d52c8 logical pixels 2025-11-02 19:16:36 -03:00
Lucas Nogueira
bd15b36ac1 global attributes to fix ffi boundary? 2025-11-02 19:11:00 -03:00
Lucas Nogueira
7d9538ee64 Revert "arc"
This reverts commit 9f0c391d4d.
2025-11-02 18:34:41 -03:00
Lucas Nogueira
e619e5eded lint 2025-11-02 18:34:29 -03:00
Lucas Nogueira
9f0c391d4d arc 2025-11-02 18:32:51 -03:00
Lucas Nogueira
a474e7833c optimize set_bounds calls 2025-11-02 18:19:09 -03:00
Lucas Nogueira
b499178167 remove min size / max size on macOS, it's giving weird numbers 2025-11-02 18:12:03 -03:00
Lucas Nogueira
e7ccc643d9 wip macOS CLI impl 2025-11-02 17:13:51 -03:00
Lucas Nogueira
84c3e25446 more impls 2025-11-02 10:51:44 -03:00
Lucas Nogueira
6130dd67e3 sync attributes 2025-11-02 10:35:02 -03:00
Lucas Nogueira
8d772cc55f implement more apis 2025-11-02 08:47:57 -03:00
Lucas Nogueira
f6b329bea6 fix close/destroy loop 2025-11-02 07:22:18 -03:00
Lucas Nogueira
070f1e6378 on_page_load_handler impl 2025-11-02 06:50:17 -03:00
Lucas Nogueira
a9f420dbc1 cleanup 2025-11-02 06:37:08 -03:00
Lucas Nogueira
785ffd3470 fix webview id 2025-11-02 06:32:32 -03:00
Lucas Nogueira
fc62e74b32 update examples 2025-11-02 06:27:10 -03:00
Lucas Nogueira
566b4d5e87 make isolation scheme secure 2025-11-02 06:24:58 -03:00
renovate[bot]
18464d9481 chore(deps): update dependency vitest to v4 (#14361)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-02 17:21:40 +08:00
Lucas Nogueira
15ca77de3f one response refcell per instance 2025-11-02 06:13:51 -03:00
Lucas Nogueira
fca850ca73 proxy dev server 2025-11-01 21:16:42 -03:00
Lucas Nogueira
8c3539ab99 initial pass window APIs 2025-11-01 18:38:52 -03:00
Lucas Nogueira
8f1eb882cc some webview APIs 2025-11-01 18:08:00 -03:00
Lucas Nogueira
5066091746 implement exit and window close events 2025-11-01 17:38:09 -03:00
Lucas Nogueira
ca8fdc0068 unique identifier 2025-11-01 17:20:35 -03:00
Lucas Nogueira
533a35ccbb set root cache path 2025-11-01 17:14:40 -03:00
Lucas Nogueira
23fe60dfee fix multiwebview positionining 2025-11-01 17:01:44 -03:00
Lucas Nogueira
93efa5706e fix init scripts for remote URLs (android-like impl) 2025-11-01 16:11:37 -03:00
Lucas Nogueira
9132d90e95 prepare multiwebview 2025-11-01 15:30:11 -03:00
Lucas Nogueira
0f00219976 update example ui 2025-11-01 13:30:52 -03:00
Lucas Nogueira
28bcd6f86e run init_script before app loads 2025-11-01 13:27:40 -03:00
Lucas Nogueira
def097e278 fix body reading 2025-10-31 20:28:07 -03:00
Lucas Nogueira
f59495ea6d wip init scripts 2025-10-31 18:46:33 -03:00
Lucas Nogueira
3013a14ee8 fix devtools crash due to custom context 2025-10-31 14:57:38 -03:00
Tony
b80f9deb5f chore: fix new clippy warnings (derive default) (#14395)
* chore: fix new clippy warnings (derive default)

* Fix left over `#[cfg(feature = "isolation")]`
2025-10-31 21:12:41 +08:00
Lucas Nogueira
9d158651b3 fill more req/resource 2025-10-31 06:26:12 -03:00
Sebastian Neubauer
1afa9df6d5 fix(tauri-utils): Use write_if_changed more (#13621)
Replace `fs::write` with `write_if_changed` in two places. This can
prevent unnecessary rebuilds. (I didn’t encounter any, but this should
be ok nonetheless.)
2025-10-31 09:19:35 +08:00
Lucas Nogueira
2518fa3397 actually run protocol handler 2025-10-30 19:25:27 -03:00
Lucas Nogueira
05f8268acb missing mime type 2025-10-30 19:25:19 -03:00
Lucas Nogueira
70bb11538c Merge remote-tracking branch 'origin/dev' into feat/cef 2025-10-30 15:14:15 -03:00
Lucas Nogueira
1423ea2324 update runtime impl 2025-10-30 15:13:42 -03:00
Fabian-Lars
75a1fec705 ci: don't cache pnpm files in version-or-publish workflow (#14392) 2025-10-30 10:25:12 +01:00
github-actions[bot]
100dc94c48 apply version updates (#14378)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-10-29 15:15:51 +01:00
Fabian-Lars
7f710b8f3b fix(bundler): inline linuxdeploy plugin scripts (#14390) 2025-10-29 14:50:33 +01:00
Braden Wong
bda1d22369 docs(webviewWindow): fix incorrect import in JSDoc example (#14388)
The getByLabel method is a static method on WebviewWindow, not Webview.
Updated the JSDoc example to import and use the correct class name.
2025-10-29 15:34:16 +08:00
Tony
28b9e7c7b8 fix: throw on custom protocol IPC fails (#14377) 2025-10-28 18:07:50 +08:00
renovate[bot]
3056d44d96 chore(deps): update dependency @rollup/plugin-typescript to v12.3.0 (#14364)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-28 15:57:47 +08:00
kandrelczyk
fc017ee257 add info to error message (fix 14186) (#14368)
* add info to error message

* changes file and  linux only warning

Signed-off-by: Krzysztof Andrelczyk <cristof@curiana.net>

* Update change file

---------

Signed-off-by: Krzysztof Andrelczyk <cristof@curiana.net>
Co-authored-by: Tony <legendmastertony@gmail.com>
2025-10-28 15:03:48 +08:00
github-actions[bot]
67c7418c06 apply version updates (#14348)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-10-22 13:38:43 +02:00
Fabian-Lars
f59bf9d539 chore: Add missing changefile for tauri-macos-sign (#14337) 2025-10-22 12:28:10 +02:00
Fabian-Lars
4b6b8690ab chore: remove --cfg docsrs to fix docs.rs builds (#14347) 2025-10-22 11:33:30 +02:00
renovate[bot]
cdc5594286 chore(deps): update dependency rollup to v4.52.5 (#14339)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-21 17:09:40 +08:00
dependabot[bot]
a1c231ec29 chore(deps-dev): bump vite from 7.1.5 to 7.1.11 (#14336)
* chore(deps-dev): bump vite from 7.1.5 to 7.1.11

Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 7.1.5 to 7.1.11.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v7.1.11/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 7.1.11
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

* Dedupe

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tony <legendmastertony@gmail.com>
2025-10-21 16:30:28 +08:00
Tony
752c923002 chore: fix some typos (#14334) 2025-10-20 22:51:28 +08:00
github-actions[bot]
cb28f4368c apply version updates (#14137)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-10-20 09:49:46 -03:00
Lucas Nogueira
6aa7f2d852 chore(deps): minor bump plugin, codegen and macros crates 2025-10-20 09:25:07 -03:00
Lucas Nogueira
06f26bbb24 chore(deps): update tao to 0.34.5 2025-10-20 09:20:13 -03:00
Lucas Fernandes Nogueira
68cb318979 feat(core): add stop, restart, destroy and configuration changed Android hooks (#14328)
* feat(core): add pause, destroy and configuration changed Android hooks

* Apply suggestions from code review
2025-10-20 08:49:26 -03:00
Lucas Fernandes Nogueira
3397fd9bfe feat(core): back button event on Android, closes #8142 (#14133)
* feat(core): back button event and exit on Android, closes #8142

I've used https://github.com/ionic-team/capacitor-plugins/blob/main/app/android/src/main/java/com/capacitorjs/plugins/app/AppPlugin.java as a reference here, checking if there's a back button event handler with a default of webview's goBack implementation

* missing change file

* remove exit impl

* fmt

* update wry

* fix default back press

* add remove_listener
2025-10-15 20:50:15 -03:00
Bipin Pandey
3b4fac2017 feat(android): add auto_increment_version_code option for Android builds (#14194)
* add new api (auto_increment_version_code) in android configuration

* ensure increment is only ran once

* skip on dev

* update doc

* change file

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-10-14 15:01:54 -03:00
Bill Avery
dc922fa6c4 fix: fill in content through request handler 2025-10-14 09:53:37 -07:00
Lucas Nogueira
9619014311 update cef 2025-10-14 09:53:13 -07:00
Felix Häcker
684791efa6 fix(macos): Always try to create webview, even if webkit runtime isn't detected correctly (#14276) 2025-10-14 11:58:43 -03:00
Lucas Fernandes Nogueira
25e920e169 fix(cli): wait for dev command to exit with --no-watch, closes #14284 (#14298) 2025-10-14 07:28:18 -03:00
Lucas Nogueira
a279485856 chore(cli): update cargo-mobile2 to 0.21.1
applies https://github.com/tauri-apps/cargo-mobile2/pull/491
2025-10-10 13:44:33 -03:00
Lucas Fernandes Nogueira
7b0d4e7322 fix(core): SHA256 hash for JS scripts CSP on Windows (#14265)
* fix(core): SHA256 hash for JS scripts CSP on Windows

we hash JS scripts as SHA256 for the Content-Security-Policy (CSP) header. The isolation pattern is broken on Windows due to the hash including carriage return characters, which are not processed when the webview checks the script hash to see if the CSP allows the script.

* fmt, clippy
2025-10-10 08:11:38 -03:00
Tony
c5008b829d fix: skip empty script tag for CSP hash properly (#14274)
* fix: skip empty script tag for CSP hash properly

* add change file

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-10-10 08:11:08 -03:00
Lucas Fernandes Nogueira
b5aa018702 feat(cli): update cargo-mobile2 to 0.21, closes #14238 (#14268) 2025-10-09 08:30:36 -03:00
Tony
55453e8453 enhance(cli): check mismatched packages in info (#14262) 2025-10-08 19:53:55 +08:00
Lucas Fernandes Nogueira
75082cc5b3 feat(cli): add mobile run commands, closes #13196 (#14120)
* feat(cli): add mobile run commands, closes #13196

* headers

* debug by default

* fix android env

* implement watcher

* clippy

* skip ipa build
2025-10-08 07:58:17 -03:00
Lucas Fernandes Nogueira
006d592837 fix(core): parse Android plugin args starting with is, closes #14254 (#14260)
by default Jackson treats the `isX` as a getter, so it looks for the `x` key in the JSON. To match behavior on other platforms we now configure Jackson to treat it as the field name itself.
2025-10-08 07:53:35 -03:00
Tony
d2938486e9 fix(cli): js icon in tauri info (#14261) 2025-10-08 17:58:47 +08:00
DomanskiFilip
19fb6f7cb0 fix(cli): improve Android BuildTask.kt Windows executable detection for nvm4w Fixes #13892 (#14146)
* fix(cli): improve Android BuildTask.kt Windows executable detection

- Fix Android build error on Windows when using nvm4w
- Add robust fallback logic for Windows executable detection
- Prevent 'node.exe.cmd' and 'Cannot find module' errors
- Graceful fallback to cargo when Node.js detection fails

Fixes #13892

* strip extension from project, try exe/cmd/bat

* revert args

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-10-07 15:25:49 -03:00
Lucas Fernandes Nogueira
3d6868d09c feat(cli): UTExportedTypeDeclarations support for file associations (#14128)
* feat(cli): UTExportedTypeDeclarations support for file associations

closes #13314

* update example

* update readme
2025-10-07 13:12:39 -03:00
Lucas Fernandes Nogueira
cc8c0b5317 feat(core): add support to universal app links on macOS (#14031)
* feat(core): add support to universal app links on macOS

follow-up for https://github.com/tauri-apps/tao/pull/1108

* fix ci

* clippy

* ignore empty schemes
2025-10-07 09:27:30 -03:00
renovate[bot]
20e53a4b95 chore(deps): update dependency cross-env to v10.1.0 (#14242)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-07 08:47:31 -03:00
Lucas Fernandes Nogueira
08bda64c25 fix(api): "command not found" error when running addPluginListener (#14132)
* fix(api): "command not found" error when running addPluginListener

the backend expects the command name to be in snake case

we've made this change already for check_permissions and request_permissions, but missed register_listener

* fix check instead

* update bundle.global.js

* code review suggestion

* add note

* adjust change file

* remove unused var

* fmt

* build
2025-10-06 14:55:20 -03:00
Lucas Fernandes Nogueira
28a2f9bc55 fix(cli): ensure Xcode project is up to date with Cargo project name (#14101)
* fix(cli): ensure Xcode project is up to date with Cargo project name

closes #13542

* clippy
2025-10-06 14:06:04 -03:00
Lucas Fernandes Nogueira
ed7c9a4100 feat(core): add config for Info.plist extensions, closes #13667 (#14108)
* feat(core): add config for Info.plist extensions, closes #13667

* add missing tag

* do not lie :)
2025-10-06 14:05:33 -03:00
Lucas Fernandes Nogueira
abf7e8850b fix(cli): mobile init when using pnpm dlx (#14118)
i noticed this when testing #13180 (though the original issue refers to npx, which I could not reproduce yet)
2025-10-06 13:12:00 -03:00
Lucas Fernandes Nogueira
b0012424c5 fix(cli): resolve IP when dev URL host is unspecified, closes #13356 (#14115)
currently the `use_network_address_for_dev_url` function already detects Ipv4Addr::UNSPECIFIED to resolve the local IP address for mobile development when the dev URL host is 0.0.0.0, but we only call it when `--host` is provided or running on a physical device. This change detects the unspecified host early and force the resolution to run even for simulator builds
2025-10-06 13:11:48 -03:00
Fabian-Lars
06d4a4ed6c fix(bundler): set APPIMAGE_EXTRACT_AND_RUN env var as well for linuxdeploy (#14241)
* fix(bundler): set APPIMAGE_EXTRACT_AND_RUN env var as well for linuxdeploy

* Aktualisieren von linuxdeploy-extract.md
2025-10-06 13:11:35 -03:00
renovate[bot]
a99601ee4b chore(deps): update dependency rollup to v4.52.4 (#14256)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-06 19:10:02 +08:00
Lucas Nogueira
afea11430b wip custom protocol 2025-10-04 13:48:18 -07:00
Lucas Nogueira
8018cd2ecf wip custom protocol 2025-10-04 13:46:39 -07:00
Lucas Nogueira
b9f084cbc1 initial setup 2025-10-04 13:35:44 -07:00
Vladimir Pankratov
2e089f6acb feat(ios): support async Swift plugin methods (completionHandler:) in PluginManager (#14148)
* Added selector with completionHandler handling

* Added .changes file

* fix change file

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-10-02 09:00:44 -03:00
Lucas Fernandes Nogueira
6bbb530fd5 chore(cli): warn when product name is missing, closes #14034 (#14105) 2025-10-02 08:28:30 -03:00
Lucas Fernandes Nogueira
b06b3bd091 refactor(cli): improve errors (#14126)
* refactor(cli): improve errors

* update change files

* license

* add errorext with fs_context helper

* update linux

* lint

* fmt

* windows

* revert bundler breaking change

* fix ios mod

* ref

* reduce amount of enum variants

* fix macos build

* Fix windows build

* Clippy

* capitalize cargo [skip ci]

---------

Co-authored-by: Tony <legendmastertony@gmail.com>
2025-10-02 06:58:26 -03:00
renovate[bot]
eb60b9966b chore(deps): update dependency rollup to v4.52.3 (#14230)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-02 16:34:29 +08:00
kandrelczyk
94cbd40fc7 Add support for adaptive and themed icons on android (#14223)
* add support for adaptive icons

* fix

* small cleanup

* combine android_bg and android_fg when specified

* Update crates/tauri-cli/src/icon.rs

Co-authored-by: Fabian-Lars <github@fabianlars.de>

* add scale option

* properly generated rounded icons

* covector, clippy

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-10-01 09:41:54 -03:00
Lucas Fernandes Nogueira
673867aa0e feat(cli): detect Android env and install SDK and NDK if needed (#14094)
* feat(cli): detect Android env and install SDK and NDK if needed

changes the Android setup to be a bit more automated - looking up ANDROID_HOME and NDK_HOME from common system paths and installing the Android SDK and NDK if needed using the command line tools

* fix windows

* clippy

* lint

* add prmopts and ci check

* also check ANDROID_SDK_ROOT
2025-10-01 09:33:14 -03:00
Rasmus Mecklenburg
4188ffdafc chore(core): allow clippy::used_underscore_binding lint in command macro (#14225) 2025-09-28 13:21:58 +02:00
renovate[bot]
12a6787110 chore(deps): update dependency rollup to v4.52.2 (#14216)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-27 21:54:42 +08:00
renovate[bot]
6cb73194c4 chore(deps): update dependency rollup to v4.52.0 (#14188)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-25 15:41:58 +02:00
FabianLars
d1892b97ce ci(renovate): group windows-rs and webview2 crates 2025-09-25 14:57:50 +02:00
Fabian-Lars
e446926a6a chore: set minimumReleaseAge to 3 days in renovate and pnpm (#14206) 2025-09-25 11:40:25 +02:00
Kirill Gribunin
b0c493a4ea FIX: Fixed GDI object leak when a resizable window is created and then closed on Windows platform (#14209)
Co-authored-by: Kirill Gribunin <kgribunin@contoso.local>
2025-09-24 21:57:05 +03:00
Ryan Seys
d340b8c8b1 fix(macos): check if path is file or dir or neither (#13793) 2025-09-22 10:25:25 +02:00
Shane Cavanaugh
830146d0be chore: remove spam link in readme (#14197) 2025-09-18 18:52:47 +02:00
dependabot[bot]
fa3771b7bc chore(deps-dev): bump vite from 7.0.4 to 7.0.7 (#14172)
* chore(deps-dev): bump vite from 7.0.4 to 7.0.7

Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 7.0.4 to 7.0.7.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v7.0.7/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v7.0.7/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 7.0.7
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

* Deduplicate

* pnpm dedupe

* Update vite to 7.1.5

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tony <legendmastertony@gmail.com>
2025-09-11 11:14:50 +08:00
renovate[bot]
9efe474e06 chore(deps): update dependency rollup to v4.50.1 (#14169)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-09 11:12:36 +08:00
Tony
69476d8e23 fix(macros): stack overflow in invoke handler (#14170) 2025-09-08 17:38:15 +08:00
Jamie Ridding
f5851ee00d feat: Expose ScrollBarStyle webview option to tauri. (#14089)
* Expose `ScrollBarStyle` webview option to tauri.

This commit exposes the scroll_bar_style option from wry via the tauri
WebviewWindowBuilder API. By itself, the commit does not include changes
to the configuration file or JavaScript APIs: These will be added in a
later commit.

* Fix a compile error on macOS and Linux.

* Add `scroll_bar_style` to WindowConfig.

This commit exposes the `scroll_bar_style` option in tauri.conf.json/
.json5/.toml as `scrollBarStyle` and `scroll-bar-style`.

* Expose `scroll_bar_style` to JavaScript API.

This commit exposes the `scroll_bar_style` in the options object passed
to the JavaScript API `Webview` and `WebviewWindow` constructors.

While testing this, I discovered that on Windows, attempting to create
a webview from the JavaScript API will cause the hosting window to
immediately hang if it attempts to use the same data directory as
another webview without sharing the same environment options. This
commit includes no mitigation for this behaviour, as I will be opening
a separate issue about it at some point in the near future.

* Document WebView2 environment requirements.

This commit adds a message to the documentation for all components of
the `scroll_bar_style` configuration option, telling users that all
webviews that use the same data directory must use the same value for
this option.

* Fix formatting.

* Add change files to .changes directory.

* Remove `tauri-schema-generator` from change file.

* Remove quotes from change tags.

* Add tags to change files.

I did not realise that these were needed, as the pull request that I
used as my reference when building this feature did not have them.

* update conf

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-09-02 07:14:59 -03:00
FabianLars
66cb1dbbef chore(bench): clippy fixes 2025-09-01 20:28:21 +02:00
Kushal Meghani
a58d461eb0 refactor(bench): improve code style (#14062)
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
2025-09-01 20:18:20 +02:00
SHIGRAF SALIK
2a06d10066 feat(bundle): add --no-sign flag to skip code signing in bundling pro… (#14052)
* feat(bundle): add --no-sign flag to skip code signing in bundling process

- Introduce a
o_sign option in bundle settings to allow skipping code signing
- Update macOS and Windows bundler implementations to respect the flag
- Wire up CLI option --no-sign to control signing behavior during bundling
- Add necessary config and type changes to propagate the flag throughout bundler

Signed-off-by: ShigrafS <shigrafsalik@proton.me>

* ci: added yml for github action testing

Signed-off-by: ShigrafS <shigrafsalik@proton.me>

* fix: fixed field 'digest_algorithm' is already declared error

Signed-off-by: ShigrafS <shigrafsalik@proton.me>

* ci: updated to test the new features as well

Signed-off-by: ShigrafS <shigrafsalik@proton.me>

* ci: fixed yml issue

Signed-off-by: ShigrafS <shigrafsalik@proton.me>

* fix: fixed missing parameter issue in android sign.rs

Signed-off-by: ShigrafS <shigrafsalik@proton.me>

* chore: apply linting

Signed-off-by: ShigrafS <shigrafsalik@proton.me>

* chore: remove redundant files

Signed-off-by: ShigrafS <shigrafsalik@proton.me>

* chore: revert indentations

Signed-off-by: ShigrafS <shigrafsalik@proton.me>

* fix: added parameters to ios mobile build.rs

Signed-off-by: ShigrafS <shigrafsalik@proton.me>

* docs: updated documentation for settigs.rs

Signed-off-by: ShigrafS <shigrafsalik@proton.me>

* docs(cli): add documentation for
o_sign flag in build options

Signed-off-by: ShigrafS <shigrafsalik@proton.me>

* chore: apply cargo fmt

Signed-off-by: ShigrafS <shigrafsalik@proton.me>

* docs: added CHANGES.md

Signed-off-by: ShigrafS <shigrafsalik@proton.me>

* refactor(bundler): make
o_sign private and add getter

Signed-off-by: ShigrafS <shigrafsalik@proton.me>

* fix: minor error

Signed-off-by: ShigrafS <shigrafsalik@proton.me>

* refactor: revert build_benchmark_jsons.rs

Signed-off-by: ShigrafS <shigrafsalik@proton.me>

* impl for macos too

* fix ci

* fix windows build

---------

Signed-off-by: ShigrafS <shigrafsalik@proton.me>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-09-01 13:59:55 -03:00
Fabian-Lars
59089723fc feat(api): add dataDirectory setting config (#14091)
* feat(api): ad dataDirectory setting config

* changefile fmt

* chain, log if dirs::data_local_dir fails

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-09-01 13:56:26 -03:00
Lucas Fernandes Nogueira
1a6627ee7d feat(cli): set default log level when adding the log plugin (#14122)
* feat(cli): set default log level when adding the log plugin

needs https://github.com/tauri-apps/plugins-workspace/pull/2965

ref #14075

* Update crates/tauri-cli/src/add.rs
2025-09-01 13:55:59 -03:00
Lucas Fernandes Nogueira
f6622a3e34 feat(cli): prompt to install iOS runtime if needed, closes #9186 (#14129)
* feat(cli): prompt to install iOS runtime if needed, closes #9186

* ensure runtime is installed

* only when running directly

* use starts_with
2025-09-01 13:55:51 -03:00
github-actions[bot]
80eadb7387 apply version updates (#14100)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-09-01 12:44:16 -03:00
Tony
346a420812 docs: improve resources docs (#14136)
* docs: improve resources docs

* Clippy
2025-09-01 12:15:43 -03:00
renovate[bot]
5239d39149 chore(deps): update dependency rollup to v4.50.0 (#14127)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-31 17:51:26 +08:00
Lucas Fernandes Nogueira
0b1da30d28 chore(tauri): update documentation for home_dir on iOS (#14121)
* chore(tauri): update documentation for home_dir on iOS

ref #12497

* update
2025-08-30 08:09:38 -03:00
Lucas Fernandes Nogueira
7db7142f9f fix(cli): empty Android emulator name (#14119)
applies https://github.com/tauri-apps/cargo-mobile2/pull/481
2025-08-29 11:45:04 -03:00
Lucas Fernandes Nogueira
a9b342125d fix(cli): iOS simulator dev/build on Apple Intel, closes #13456 (#14114)
applies https://github.com/tauri-apps/cargo-mobile2/pull/479
2025-08-28 18:16:42 -03:00
Lucas Fernandes Nogueira
bcf000c0a8 fix(cli): ios command failing when running with deno, closes #13547 (#14110)
Deno doesn't set an environment variable to help us, so I had to use the exe path to determine whether we're running under deno or not
2025-08-28 18:02:46 -03:00
Lucas Fernandes Nogueira
61b9b681e8 feat(cli): retain all RUST_* env vars on mobile commands (#14111)
useful to propagate RUST_BACKTRACE to the IDE commands
2025-08-28 18:02:22 -03:00
Lucas Fernandes Nogueira
c37a298331 fix(cli): set package type for Deno (#14112)
without the type Deno assumes that the package is a ESM so it cannot use `require`
we should probably update our minimum Node.js version and use ESM instead, but I want to ship this fix first
2025-08-28 18:02:09 -03:00
Lucas Nogueira
b8b866fcc7 fix(examples): update tauri-plugin-log
fixes iOS deadlock
2025-08-28 15:09:36 -03:00
Lucas Fernandes Nogueira
956b4fd6ff fix(cli): export method on Xcode < 15.4, closes #13818 (#14106)
see https://github.com/fastlane/fastlane/issues/22028 for additional context
2025-08-28 12:37:26 -03:00
Lucas Fernandes Nogueira
07e134f70e feat(core): enhance error message for dev server request, closes #13816 (#14107) 2025-08-28 12:36:49 -03:00
Lucas Fernandes Nogueira
f70b28529d feat(cli): ensure mobile Rust targets are installed (#14093)
currently we only install Rust targets for mobile when initializing the projects.

Users can commit the Android/iOS projects, so running the init command is not a requirement to develop mobile apps. This change ensures the Rust targets are installed before trying to compile them.
2025-08-27 18:05:24 -03:00
Fabian-Lars
c23bec62d6 fix: don't set macos deployment target in dev (#14083)
* fix: don't set macos deployment target in dev.

* doc comment

* Update .changes/skip-deployment-target-in-dev.md

* Apply suggestions from code review

---------

Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
2025-08-27 17:07:07 -03:00
renovate[bot]
9a35a616f5 chore(deps): update dependency rollup to v4.49.0 (#14098)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-27 23:27:02 +08:00
Fabian-Lars
755eb33d1c docs: use get_webview_window in example (#14082) 2025-08-25 16:19:44 +02:00
Lucas Nogueira
df61fac2b5 fix(ci): bump tauri-cli to 2.8.3 to match @tauri-apps/cli 2025-08-25 10:32:46 -03:00
github-actions[bot]
16348ac2bd apply version updates (#14081)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-25 10:30:08 -03:00
Lucas Fernandes Nogueira
03e7c11932 fix(tauri-runtime-wry): ignore about:blank initial URL (#14080)
* fix(tauri-runtime-wry): ignore about:blank initial URL

fixes a macOS warning when a navigation handler is registered and you choose to create a new window on the on_new_window hook - in this case we shouldn't perform the initial navigation since the URL is provided by the webview configuration from the hook

* change tag

* bump min wry
2025-08-25 10:03:35 -03:00
github-actions[bot]
e81635aa3d apply version updates (#14079)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-25 14:25:58 +02:00
Fabian-Lars
0ac89d3b6c chore(deps): Update cargo-mobile2 for ios 18.6 sim support (#14078) 2025-08-25 14:04:43 +02:00
renovate[bot]
4791d09a0a chore(deps): update dependency rollup to v4.48.1 (#14077)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-25 12:32:49 +02:00
renovate[bot]
bc829ee24d chore(deps): update dependency rollup to v4.48.0 (#14053)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-25 12:55:18 +08:00
renovate[bot]
11800a0071 chore(deps): update rust crate jsonschema to 0.33 (#14074)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-25 09:25:53 +08:00
github-actions[bot]
662b39adb3 apply version updates (#14070)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-24 11:38:07 -03:00
Tony
2aaa801c35 Improve documentation of app > windows (#14058) 2025-08-24 10:55:44 -03:00
Fabian-Lars
5349984064 fix: set webview2 path before initializing runtime (#14054)
* fix: set webview2 path before initializing runtime

* wrong current_exe function
2025-08-24 08:18:14 -03:00
Lucas Nogueira
5f535b4150 fix(bench): lint warnings 2025-08-24 08:17:25 -03:00
Tony
f3df96fb38 fix(windows): binary patching 32 bit updater type (#14065)
* fix(windows): binary patching 32 bit updater type

* Use `get` instead of size check and then assert
2025-08-24 08:16:12 -03:00
Lucas Nogueira
c0d3f9d47e chore(bench): fix build and clippy 2025-08-24 07:14:53 -03:00
Kushal Meghani
d54f3b95a6 refactor(bench): improve utils.rs safety, error handling, and docs (#14057)
- Replace `unwrap` and `expect` with `anyhow::Result` for safer error handling
- Add contextual error messages using `anyhow::Context`
- Fix `home_path` on Windows by using `USERPROFILE` instead of `HOMEPATH`
- Ensure process helpers (`run_collect`, `run`) return `Result` instead of panicking
- Improve parsing logic in `parse_max_mem` and `parse_strace_output`
- Add documentation comments for all public functions
- Add best-effort cleanup and resilience against malformed input
2025-08-22 08:04:57 -03:00
renovate[bot]
1e7aac355f chore(deps): update dependency rollup to v4.46.4 (#14049)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-21 12:01:01 +08:00
github-actions[bot]
8d869717da apply version updates (#14041)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-19 09:08:54 -03:00
Kushal Meghani
f0172a454a fix(app): correct removeDataStore return type, add docs for getBundle… (#14038)
* fix(app): correct removeDataStore return type, add docs for getBundleType

* add change file

* fmt

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-08-19 08:02:21 -03:00
Lucas Fernandes Nogueira
5075b67d36 fix(tauri): build without the wry feature flag (#14039)
* fix(tauri): build without the wry feature flag

* change file

* fix windows
2025-08-19 07:42:41 -03:00
Lucas Nogueira
c3252f72f6 fix(tauri): on_related_view should be behind the wry feature flag 2025-08-18 17:23:06 -03:00
github-actions[bot]
b4abb6cae8 Apply Version Updates From Current Changes (#13887)
* apply version updates

* chore: minor bump codegen, build, macros

* fix audit

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-08-18 15:50:13 -03:00
Will
1a3d1a024e fix(ios): Tauri iOS build with binary XCFramework dependencies (#13995)
* Fix Tauri iOS build not having a PATH variable to access unzip to extract binaryTargets and also not including Frameworks when linking

* Add covector change

* fmt

* Update crates/tauri-utils/src/build.rs

Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>

---------

Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
2025-08-18 07:35:49 -03:00
renovate[bot]
37154ebdcd chore(deps): update dependency rollup to v4.46.3 (#14027)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-18 14:34:25 +08:00
Tony
380656874e Remove AsRef<Window> on WebviewWindow (#14026) 2025-08-18 13:45:43 +08:00
Lucas Fernandes Nogueira
bc4afe7dd4 feat(cli): check plugin versions for incompatibilities (#13993)
* feat(cli): check plugin versions for incompatibilities

check core plugin versions for incompatibilities between Cargo and NPM releases

a plugin NPM/cargo version is considered "incompatible" if their major or minor versions are not equal

on dev we show an warning
on build we error out (with a `--ignore-incompatible-plugins` flag to prevent that)

this is an idea from @oscartbeaumont
we've seen several plugin changes that require updates for both the cargo and the NPM releases of a plugin, and if they are not in sync, the functionality does not work
e.g. https://github.com/tauri-apps/plugins-workspace/pull/2573 where the change actually breaks the app updater if you miss the NPM update

* Use list to get multiple package versions at once

* Fix for older rust versions

* Clippy

* Support yarn classic

* Support yarn berry

* Use `.cmd` only for `npm`, `yarn`, `pnpm`

* Use yarn list without --pattern

* rename

* Extract function `check_incompatible_packages`

* Check `tauri` <-> `@tauri-apps/api`

* incompatible -> mismatched

* run build check in parallel

* rename struct

* Switch back to use sync check and add todo

* Extract to function `cargo_manifest_and_lock`

---------

Co-authored-by: Tony <legendmastertony@gmail.com>
2025-08-17 12:24:40 -03:00
Akshanabha Chakraborty
7c2eb31c83 feat: add PluginHandle::run_mobile_plugin_async (#13895)
* add async

* chore: fmt

* feat: add run_mobile_plugin_async

* changes

* chore: fix misplaced `}`

* chore: fix minor pattern matching error

* fix: copy the response handling directly from run_mobile_plugin

* fix android build

* Fix clippy lint

* lint

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-08-17 12:14:16 -03:00
Tony
737364b8d3 fix: a few regressions from previous PRs (#14020)
* fix: a few regressions from previous PRs

* rename with_window_features to window_features

* Clippy

* clippy

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-08-17 12:03:31 -03:00
Robert
68874c68c5 feat(core): webview window focusable property, closes #11130 (#13564)
* Adds the ability to set the focused property from tauri.conf.json -- windows

* add set_focusable, pin tao

* fmt

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-08-17 11:50:17 -03:00
Sean Wang
dfadcb764b feat: add WebView::set_cookie and WebView::delete_cookie (#13661)
* chore: patch wry

* feat: added `Webview::set_cookie` and `Webview::delete_cookie`

* chore: changes-files

* fmt

* owned cookie, re-export crate

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-08-16 23:41:16 -03:00
Sean Wang
22d6bcacbb feat(tauri): impl App::set_device_event_filter for AppHandle also (#14008)
* feat(tauri): impl `App::set_device_event_filter` for `AppHandle` also

* Update .changes/impl-set_device_event_filter-for-apphandle.md

* Update .changes/impl-set_device_event_filter-for-apphandle.md

---------

Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
2025-08-16 15:30:46 -03:00
Tony
b21d86a8a3 fix(cli): permission add could add duplicated (#13981) 2025-08-16 14:51:45 -03:00
THELOSTSOUL
33d0b3f0c1 feat: add WebviewBuilder::on_new_window and WebviewBuilder::on_document_title_changed (#13876)
* add "new window" and "document title changed" webview handler

* take document title changed handler

* update example, add missing api, change files

* allow creating tauri window for the window.open call

* set size and position, fix linux, example

* enhance document title change

* fix windows deadlock

* wry 0.53

* update wry

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-08-16 14:49:01 -03:00
Petr
f1232671ab feat: expose internal TrayIcon (#13959) 2025-08-17 00:23:23 +08:00
Lucas Fernandes Nogueira
0c402bfb6b feat(cli): increase iOS deployment target to 14.0 (#13997)
* feat(cli): increase iOS deployment target to 14.0

closes https://github.com/tauri-apps/plugins-workspace/issues/1876

ref https://github.com/tauri-apps/tauri-docs/pull/3455

* fix tests
2025-08-16 10:32:26 -03:00
Lucas Fernandes Nogueira
d6d5f37077 feat: add --root-certificate-path option for mobile dev (#13358)
* feat: add `--root-certificate-path` option for mobile dev

lets you use a HTTPS development server

example usage:
```
cargo install tauri-cli --git https://github.com/tauri-apps/tauri --branch feat/mobile-dev-cert
cargo tauri android dev --open --root-certificate-path "/Users/lucas/Library/Application Support/mkcert/rootCA.pem" --features tauri/rustls-tls
```

* Apply suggestions from code review

Co-authored-by: Fabian-Lars <github@fabianlars.de>

---------

Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-08-16 09:13:10 -03:00
Sean Wang
7261a14368 feat: impl AsRef<Window> and on_webview_event for WebviewWindow (#14012) 2025-08-16 11:01:53 +08:00
Sean Wang
0e6b5cbe5f feat(tauri): re-export PixelUnit, PhysicalUnit, LogicalUnit (#14009)
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-08-15 15:24:34 +02:00
Sean Wang
a3dc42477a feat(tauri): export TitleBarStyle for all platforms (#14013) 2025-08-15 15:13:05 +02:00
Sean Wang
21ebc6e820 feat(tauri): remove 'static lifetime bound from AppHandle::remove_plugin (#14007) 2025-08-15 15:28:39 +08:00
Lucas Fernandes Nogueira
2d5f5a9230 chore: update tests (#13998) 2025-08-13 13:34:01 -03:00
Fabian-Lars
4475e93e13 feat(bundler/cli): Add feature flag to use system certificates (#13824) 2025-08-12 13:30:23 +02:00
Naman Khandelwal
5110a762e9 feat(window): add macOS window::set_simple_fullscreen (closes #13670) (#13830)
* add implementation of set_simple_fullscreen

* add simple fullscreen API for macos

* register desktop command

* format

* fix errors

* chore: format

* change implementation

* add api

* fix tests

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-08-12 08:03:29 -03:00
Fabian-Lars
a9ec12843a feat: add option to not wait on notarization to finish (#13521)
* feat: add option to not wait on notarization to finish

* cli arg istead of config

* changefile

* fix serde

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-08-11 14:29:41 -03:00
Tony
f0dcf9637c fix(cli): add single-instance autostart init code (#13980) 2025-08-11 19:40:18 +08:00
Tony
196ace3c04 fix: return error on window creation failed (#13970)
* fix: return error on window creation failed

* Add todo about adding error inside `CreateWindow`
2025-08-09 22:43:18 +08:00
Aly Cerruti
82e264552e fix(windows): fix double free (STATUS_HEAP_CORRUPTION) of resizing handler's userdata (#13968)
* fix: double free of resizing handler's userdata on Windows

Using WM_NCDESTROY instead of WM_DESTROY is more correct for freeing userdata, as windows can receive multiple WM_DESTROY events if they're parented.

* chore: add change entry for resizing handler double-free fix
2025-08-09 12:03:21 +08:00
Tony
c134a769ea chore: fix some warnings on new rust version (#13965)
* chore: fix some warnings on new rust version

* No main

* allow dead code on specta Channel
2025-08-09 08:19:03 +08:00
Fabian-Lars
390cb9c36a fix(cli): reduce log level for goblin and handlebars (#13953) 2025-08-07 14:40:41 +02:00
Jaken Herman
9300b59f65 feat: Added fips_compliant field to WixConfig (#13787)
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-08-05 20:35:25 +02:00
Jadon Jesse
e1d7be8e57 fix(example): runtime crash when counter less than 0 (#13955) 2025-08-05 18:45:49 +02:00
renovate[bot]
90c1c327ac chore(deps): update dependency cross-env to v10 (#13894)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-05 17:15:22 +02:00
renovate[bot]
83032e273b chore(deps): update rust crate which to v8 (#13711)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-05 14:59:02 +02:00
Tony
a8f1569b04 fix(windows): bundler should not sign non-binaries (#13921)
* fix(windows): bundler should not sign non-binaries

* Fix non Windows
2025-08-05 11:06:43 +08:00
Tony
0ea08e901e fix(example): unminimize window on tray icon click (#13949) 2025-08-05 10:07:16 +08:00
Fabian-Lars
887b8da684 fix(bundler): improve log format of sign command stdout (#13947) 2025-08-04 15:38:56 +02:00
Tony
7d21e3b2fa docs: how security > capabilities works (#13946)
* docs: how `security > capabilities` works

* Add how to use it

* Apply suggestions

* Relative to `Cargo.toml`

* Remove the relative base wording
2025-08-04 18:13:02 +08:00
Sam Lidder
4d270a96a8 fix(windows): patch_binary causing codesigning verification failure (#13943)
* fix(windows): `patch_binary` causing codesigning verification failure

* `cargo fmt`

* add change file

* Update .changes/fix-binary-patching-codesign-verification-failure.md

---------

Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>
2025-08-04 16:58:04 +08:00
renovate[bot]
bcc7a82a3a chore(deps): update rust crate notify-debouncer-full to 0.6 (#13945)
* chore(deps): update rust crate notify-debouncer-full to 0.6

* Bump jsonschema
2025-08-04 10:39:34 +08:00
Fabian-Lars
8b465a12ba fix(bundler/linux): pull latest appimage plugin (#13913) 2025-07-31 20:06:57 +02:00
Tony
ee68c918a1 chore(deps): unpin serialize-to-javascript (#13932) 2025-07-31 17:52:51 +08:00
renovate[bot]
d7075b66bd chore(deps): update rust crate toml to 0.9 (#13784)
* chore(deps): update rust crate toml to 0.9

* Bump toml_edit and cargo_toml

* Update tauri-winres

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tony <legendmastertony@gmail.com>
2025-07-31 17:14:09 +08:00
xeodus
bbcea1f5e8 fix(cli): improve error messages regarding cargo metadata command (#13918) 2025-07-30 11:23:54 +02:00
Pavel Kuzmin
5ba1c3faa4 feat(menu): add icon support for Submenu in Rust and JS/TS APIs (#13722)
* feat(menu): add icon and nativeIcon support for Submenu in tauri and @tauri-apps/api

* Merge branch 'dev' into dev

* Update muda

* feat(menu): add set_icon and set_native_icon methods to set submenu icons

* feat(menu): unify icon handling by introducing MenuIcon type

* chore: sync bundle.global.js

* Make setIcon actually work

* Regenerate `bundle.global.js`

---------

Co-authored-by: Tony <legendmastertony@gmail.com>
2025-07-30 13:48:55 +08:00
renovate[bot]
e27427f795 chore(deps): update dependency rollup to v4.46.2 (#13914)
* chore(deps): update dependency rollup to v4.46.2

* Bump @eslint/plugin-kit

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tony <legendmastertony@gmail.com>
2025-07-30 09:39:22 +08:00
renovate[bot]
a32a4ce3be chore(deps): update rust crate jsonschema to 0.32 (#13915)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-30 09:26:04 +08:00
Andrew Voynov
bc6b125b24 fix(bundler): replace empty RPM release value with 1 (#13909)
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-07-29 22:20:25 +02:00
Takeaki Kobayashi
9c938be452 fix(cli): properly migrate svelte to v5 in the plugin example template (#13912)
* fix: update vite.config.ts to support Svelte 4 in example app

* Migrate the code to svelte 5 instead

* Add change file

---------

Co-authored-by: Tony <legendmastertony@gmail.com>
2025-07-29 17:47:17 +08:00
renovate[bot]
5c8182860c chore(deps): update rust crate jsonschema to 0.31 (#13903)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-28 23:29:31 +08:00
renovate[bot]
1d31e4647c chore(deps): update dependency rollup to v4.46.1 (#13904)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-28 15:19:30 +08:00
renovate[bot]
517e7b60e1 chore(deps): update dependency rollup to v4.46.0 (#13897)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-27 20:38:49 +08:00
Robin van Boven
72b4226ee9 feat: reduce Debug format size for binary buffers (#13809)
* feat: reduce Image debug output

For example now:
`Image { rgba: Cow::Borrowed([u8; 4096]), width: 32, height: 32 }) }`

* feat: reduce EmbeddedAssets debug size

For example now:
```
EmbeddedAssets {
    assets: {
        "/index.html": [u8; 1835],
        "/index.js": [u8; 212],
    },
    global_hashes: [
        Script(
            "'sha256-EOd6N98xxmK5s7VvxV7W2w7YG+dmP52MqNiZUq1NLeE='",
        ),
        Style(
            "'sha256-YEercZJImS+vUX2bz7vkQ0aA4rtBIPLuCEWz+yraQ/g='",
        ),
    ],
    html_hashes: {
        "/index.html": [
            Script(
                "'sha256-3g8CfFrjFLGpwD2o+hwMt+lh/hsHbQ3XY+EPJ35fFKk='",
            ),
            Script(
                "'sha256-EOd6N98xxmK5s7VvxV7W2w7YG+dmP52MqNiZUq1NLeE='",
            ),
        ],
    },
}
```

* feat: reduce `app_icon` debug size

* chore: changelog

* chore: include tauri-utils in changelog

* doc: comment had extra closing brackets [skip ci]
2025-07-25 07:55:00 -03:00
Lucas Fernandes Nogueira
d6d941c3a7 chore(cli): update plugin template (#13882) 2025-07-25 07:50:41 -03:00
Lucas Fernandes Nogueira
a0113a8c64 feat(tauri-plugin): add build::mobile::update_info_plist (#13888)
* feat(tauri-plugin): add build::mobile::update_info_plist

needed for https://github.com/tauri-apps/plugins-workspace/pull/2870

* Update .changes/update-info-plist.md
2025-07-25 07:50:24 -03:00
Jack Lavigne
91508c0b8d feat: add config option for custom watch folders (#13881)
* feat: add config option for custom watch folders

* fix: cargo clippy changes

* chore: remove file

* fix: ios dev

* docs: clarify absolute allowed

* refactor: rename variable

* fix: review suggestions

* fix: resolve paths

* fixL use canonicalize

* chore: add changefile

* chore: add error if cant canonicalize

* reformat changelog

* Update .changes/additional-watch-folders.md

* Update crates/tauri-cli/src/interface/rust.rs

Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>

* Revert "Update .changes/additional-watch-folders.md"

This reverts commit 98186b1a89.

* Also bump `@tauri-apps/cli`

* Apparently I'm so used to a higher rust version

* Revert "Apparently I'm so used to a higher rust version"

This reverts commit ea1d89e2d3.

* Need to check for existence for abs paths as well

---------

Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>
Co-authored-by: Tony <legendmastertony@gmail.com>
2025-07-24 22:21:00 +08:00
github-actions[bot]
fd63f229d5 apply version updates (#13871)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-07-22 12:32:14 +08:00
Krishna Chaitanya
af95fb6014 fix: sign main binary after patching with bundle info (fix #13868) (#13870)
* fixed #13868

* add main binary singing only on windows

* updated readme message
2025-07-22 11:32:49 +08:00
FabianLars
65bb24b9ae fix(cli): fix metadata version 2025-07-21 10:10:12 +02:00
FabianLars
332ec355a1 fix(cli): add default triplets to napi targets config 2025-07-21 09:59:32 +02:00
renovate[bot]
2c46b1873e chore(deps): update dependency eslint-config-prettier to v10.1.8 (#13855)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-21 10:23:19 +08:00
FabianLars
96439c2c42 chore(deps): Update @eslint/plugin-kit to fix pnpm audit 2025-07-21 00:37:41 +02:00
github-actions[bot]
ab97f36b64 apply version updates (#13751)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-07-21 00:09:52 +02:00
Tony
6a4451bcd9 fix(windows): isolation pattern create iframe loop (#13849) 2025-07-20 23:33:14 +02:00
Tony
56277e4722 chore(deps): update napi to v3 (#13852) 2025-07-20 23:03:51 +02:00
Fabian-Lars
7a6fd5b75d fix(bundler): Move AppRun to mirror (#13863) 2025-07-20 23:00:19 +02:00
Sean Wang
7f3c989111 feat(tauri): add plugin_boxed methods (#13837)
* feat(tauri): add `plugin_dyn` methods

* refactor: rename `plugin_dyn` to `plugin_boxed`
2025-07-18 11:48:10 +08:00
Tony
bda8304107 fix(cli): error out when migrating from v2 alpha (#13833) 2025-07-16 22:06:17 +08:00
Fabian-Lars
fb9d9c7fd1 chore(readme): Update discord invite (#13836) 2025-07-16 11:02:23 +02:00
renovate[bot]
8263b412c6 chore(deps): update dependency rollup to v4.45.1 (#13831)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-15 23:10:12 +08:00
Siddharth
3025d90951 feat: expose some window props from runtime-wry (#13822)
* test: make some of window id + stores public

* test: make window wrapper label pub

* feat: make label accessible for windowwrapper

* chore: adds wry runtime changefile

* chore: avoid forced clone on label

Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>

---------

Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>
2025-07-15 14:32:19 +08:00
Joseph Brooksbank
96391467e9 feat(mock): add mock for listen and emit (#13783)
* feat(mock): add mock for listen and emit
* feat(mock): add mock for listen and emit

* feat(mock): add mock for listen and emit

* Add change file

* correctly clear unregisterListener

* format with prettier

* build project

* opt-in to mocking events

* Use a minor bump
2025-07-15 09:30:01 +08:00
kandrelczyk
c0a654b863 failed binary patch warning (#13825)
* failed binary patch warning

* Update crates/tauri-bundler/src/bundle.rs

Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>

---------

Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>
2025-07-14 22:24:11 +08:00
Lucas Raposeiras
b821796add docs: add missing trafficLightPosition to WindowOptions (fix #13790) (#13810)
* docs: add missing `trafficLightPosition` to `WindowOptions`

* Change file and tweak docs

---------

Co-authored-by: Tony <legendmastertony@gmail.com>
2025-07-13 20:58:39 +08:00
Mohammad Hossein Bagheri
33d079392a feat(cli): allow runner configuration to be an object with cwd and args (#13811)
* Update config.schema.json

* Add RunnerConfig for customizable build runner

Replaces runner String with RunnerConfig in CLI and config, allowing advanced runner configuration via string or object with cmd, cwd, and args. Updates schema and usage to support new format, and adds tests for serialization, deserialization, and API. Enables more flexible build and run command customization.

* Create runner-object-config.md

* Remove unused RunnerConfig import in tests

Cleaned up the test module in config.rs by removing the unused RunnerConfig import from two test functions.

* Fix tests failing

Updates related tests in tauri-utils to improve readability and maintain consistency. Minor import reordering in tauri-cli for clarity.

* Move RunnerConfig enum and impls above BuildConfig

Relocated the RunnerConfig enum and its associated implementations to appear before the BuildConfig definition. This improves code organization and logical grouping of configuration-related types.
2025-07-13 19:28:09 +08:00
Tony
7bc77a038a feat: allow all frame init scripts in plugin (#13609)
* feat: allow all frame init scripts in plugin

* Add change files

* Update crates/tauri/src/plugin.rs

Co-authored-by: Fabian-Lars <github@fabianlars.de>

* Default impl initialization_script_2 from 1

* Update crates/tauri/src/plugin.rs

Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>

---------

Co-authored-by: Fabian-Lars <github@fabianlars.de>
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
2025-07-13 14:12:39 +08:00
kandrelczyk
371ee34383 make static bundle type var mutable (#13812)
* make static bundle type var mutable

* remove unsafe from no_mangle and link_section
2025-07-12 18:48:13 +08:00
renovate[bot]
22cd1e2846 chore(deps): update dependency rollup to v4.45.0 (#13813)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-12 17:55:16 +08:00
M
1c5df96fe8 fix(protocol): proxy body in mobile dev (#13773)
* proxy body in mobile dev

* add change file, use std::mem::take

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-07-11 07:22:46 -03:00
kandrelczyk
4f96ed41ca add #[used] to __TAURI_BUNDLE_TYPE so that it's not stripped in release builds (#13808) 2025-07-11 15:52:37 +08:00
renovate[bot]
24eb2b1cd3 chore(deps): update dependency @sveltejs/vite-plugin-svelte to v6 (#13803)
* chore(deps): update dependency @sveltejs/vite-plugin-svelte to v6

* Bump vite

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tony <legendmastertony@gmail.com>
2025-07-11 13:22:46 +08:00
Lucas Fernandes Nogueira
0f248b111f fix(cli): install iOS dependencies when needed (#13799)
currently deps are only installed on init, which might not be executed on someone's machine if the xcode project is commited to the repo. we need to ensure dependencies are installed before running them

applies https://github.com/tauri-apps/cargo-mobile2/pull/468
2025-07-10 10:17:23 -03:00
Lucas Fernandes Nogueira
4ba871c5d2 fix(core): loading remote URLs on mobile, closes #13461 (#13782) 2025-07-09 17:08:38 -03:00
Catalin Andrei Cacuci
f94af90359 fix(nsis): per-machine installer not requesting elevation when run by non-admin users (#13786) 2025-07-09 13:42:07 +02:00
Tony
cfc5bb8196 feat(android): edge to edge in init template (#13780)
* feat(android): edge to edge in init template

* Add androidx.activity:activity-ktx

* androidx.webkit:webkit:1.14.0
2025-07-09 10:05:27 +08:00
Lucas Fernandes Nogueira
916aeaa486 fix(cli): android commands reading iOS config closes #13765 (#13781) 2025-07-08 08:49:47 -03:00
Jeong Min Oh
12e3590613 Fix(package.json) build script, Fix(android) build template (#13759)
* Update compileSdk targetSdk, Fix build cmd

* Add changelog

* Update AGP version

* Update package.json

* Update AGP

* Update SDK

* Update

* Update .changes/update-android-sdk.md

Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>

* Use changes tag in change file

---------

Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>
2025-07-08 17:00:26 +08:00
kandrelczyk
232265c70e feat: bundle type detection at runtime via binary patching (#13209)
* patch binary with bundle type info

* only patch if the updater is included

* fix linux warnings

* patch binary when updaer is configured

* patch binary with bundle type info

only patch if the updater is included

fix linux warnings

patch binary when updaer is configured

* fix formatting

* fix license header

* fix taplo error

* move __TAURI_BUNDLE_TYPE to utils

* export get_current_bundle_type

* macos fix

* cleanup, add api

* update change file

* fix windows

* fmt, fix rust version support

* fix macos

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-07-07 12:08:00 -03:00
renovate[bot]
02440b875c chore(deps): update dependency rollup to v4.44.2 (#13766)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-06 20:39:00 +08:00
Catalin Andrei Cacuci
f2dbe73097 fix(nsis): wrong required files path for nsis_tauri_utils.dll (#13772)
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-07-05 23:42:25 +02:00
Tony
152d971bcd fix(mock): expose callback functions (#13744)
* fix(mock): expose callback functions

* Add change file

* Bumped the wrong package

* Fix end quote in comment
2025-07-02 22:23:23 +08:00
Jeong Min Oh
acd7574284 fix(cli/ios): fix CFBundleVersion type (#13743)
Co-authored-by: devfive <devfive@devfiveui-MacStudio.local>
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-07-02 16:01:59 +02:00
renovate[bot]
e296e4bc38 chore(deps): update dependency @rollup/plugin-typescript to v12.1.4 (#13729)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-30 14:07:17 +02:00
AprilNEA
11b4a03881 fix(cli): remove unnecessary files in npm package, closes #12139 (#13735)
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-06-30 14:02:03 +02:00
github-actions[bot]
0277596341 apply version updates (#13731)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-06-28 17:48:13 -03:00
Lucas Fernandes Nogueira
cbd9629729 fix(cli): load --config values on xcode and android-studio scripts (#13730) 2025-06-28 17:16:36 -03:00
FabianLars
0079d08ba9 chore(worker): Enable observability 2025-06-27 17:20:01 +02:00
FabianLars
effd106adf fix(worker): Fix route syntax 2025-06-27 17:14:34 +02:00
github-actions[bot]
4053ad1b58 apply version updates (#13724)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-06-27 16:22:27 +02:00
Fabian-Lars
f010ca5e91 fix(core): compile error without common-controls-v6 (#13719) 2025-06-27 15:54:10 +02:00
Fabian-Lars
6b2b9d6cbf chore: clippy 1.88 (#13720) 2025-06-27 15:33:36 +02:00
renovate[bot]
b6de1c89c2 chore(deps): update rust crate md5 to 0.8 (#13712)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-06-26 16:29:19 +02:00
renovate[bot]
a3ae2cebbf chore(deps): update rust crate rand to 0.9 (#13700)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: FabianLars <github@fabianlars.de>
2025-06-26 15:47:42 +02:00
github-actions[bot]
a3f11b4f3b apply version updates (#13693)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-06-26 20:47:38 +08:00
Fabian-Lars
4b7370e9e0 fix(cli): fix rollup-plugin-typescript v12 compatiblity (#13710)
* fix(cli): fix rollup-plugin-typescript v12 compatiblity

* always the same mistake
2025-06-26 20:13:05 +08:00
Tony
5bbcaaec89 fix: can't set tray menus and icons in js (#13707) 2025-06-26 19:42:01 +08:00
renovate[bot]
3eb3162404 chore(deps): update rust crate muda to 0.17 - tray-icon to 0.21 (#13695)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: FabianLars <github@fabianlars.de>
2025-06-26 12:31:00 +02:00
renovate[bot]
0cbfd8923c chore(deps): update dependency rollup to v4.44.1 (#13696)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-26 15:33:56 +08:00
montyc1999
0a552a868c fix(macros): cache rustc -V output (#13690) 2025-06-26 10:48:52 +08:00
renovate[bot]
560067cd7e chore(deps): update rust crate getrandom to 0.3 (#13685)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: FabianLars <github@fabianlars.de>
2025-06-25 23:05:29 +02:00
Fabian-Lars
6a4ea10274 fix(worker): add workaround to fix build on rust 1.87 2025-06-25 22:19:47 +02:00
Fabian-Lars
349bbfc5c7 chore(deps): update axum to 0.8 and worker to 0.6 (#13677) 2025-06-25 20:57:52 +02:00
Fabian-Lars
32a84650c0 ci: disable renovate for 1.x branch (#13673) 2025-06-25 17:36:07 +02:00
Tony
b19f16aba1 ci: enable create-pull-request sign commits (#13668) 2025-06-25 15:50:45 +02:00
github-actions[bot]
594822aa55 Apply Version Updates From Current Changes (#13282)
* apply version updates

* minor bump for build, plugin, macros and runtime

---------

Co-authored-by: lucasfernog <20051258+lucasfernog@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-06-24 15:50:44 -03:00
Lucas Nogueira
e4aa35e083 fix(cli): init tests 2025-06-24 15:02:22 -03:00
sftse
9c16eefa31 Update kuchikiki, html5ever, tao, wry, webview2-com (#13629)
* fix: dont depend on private schemars api

* tauri-cli/deps: update kuchikiki and html5ever
tauri-utils/deps: update kuchikiki and html5ever
tauri-runtime-wry/deps: update wry to match kuchikiki and html5ever versions

* fix: specify exact patch version of schemars

Without this, cargo resolves the patch version of schemars to one that
does not include the _private module on which tauri-utils v1 depends,
which is a dependency of tauri-cli. As a result of this, the build breaks.

* tauri-utils/fix: inline tauri-utils v1 config module

* deps: upgrade and pin schemars 0.8.21 to pick up crate patch in Cargo.toml

* update tao, wry

* lint, license

* lint

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-06-24 14:39:20 -03:00
Lucas Fernandes Nogueira
3242e1c946 feat(cli): allow passing Cargo commands to mobile dev/build commands (#13659)
* feat(cli): allow passing Cargo commands to mobile dev/build commands

* fmt
2025-06-23 14:47:21 -03:00
Lucas Fernandes Nogueira
4a880ca697 feat(cli): synchronize productName changes with iOS Xcode project (#13658)
* feat(cli): synchronize productName changes with iOS Xcode project

* fmt
2025-06-23 14:47:10 -03:00
Lucas Fernandes Nogueira
d1ce9af628 feat(cli): add --config arg to the mobile init cmds, closes #13284 (#13660) 2025-06-23 12:55:07 -03:00
Lucas Fernandes Nogueira
ec6065fa4a fix(cli): use original identifier to fix mobile options reading (#13625)
* fix(cli): read original identifier to fix mobile options reading

the iOS and Android CLI commands leverage an android_studio_script/xcode_script that is executed by the native IDE or build tool. This script reads the Tauri configuration to find the app identifier used to communicate with the parent Tauri CLI process to read CLI options.

The communication is broken when the `--config` arg is used, since the IDE script does not have access to that value before reaching the parent process, which is impossible without knowing the actual identifier used.

To bypass this we'll agree on using the original identifier. This obviously won't work if the original tauri.conf.json do not have an identifier, so we error out in this case

* fix build, lint
2025-06-23 09:29:46 -03:00
Tony
18b5299952 docs: where does resource dir resolve to (#13640)
* docs: where does resource dir resolve to

* Add note about potential change
2025-06-21 10:22:24 +08:00
Tony
eb3f0248c2 fix: write default permission words if not empty (#13646)
* fix: write default permission words if not empty

* Remove left over format!
2025-06-21 09:52:36 +08:00
Tony
c03cc586e3 chore: check generated file on package lock change (#13641)
* chore: check generated file on package lock change

* Build bundle.global.js

looks like it's already outdated
2025-06-20 20:13:16 +08:00
renovate[bot]
488bcea970 chore(deps): update dependency rollup to v4.44.0 (#13635)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-19 19:20:17 +08:00
kandrelczyk
d48e7a39a7 chore: improve contributing guide (#13594) 2025-06-18 11:34:19 +02:00
renovate[bot]
221254738a chore(deps): update dependency @rollup/plugin-typescript to v12.1.3 (#13628)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-17 23:43:38 +08:00
Naman Khandelwal
9fb0586909 fix(cli) : final changes for macOS identifier issue (fix #12674) (#13627)
* fix(cli) : final changes for macOS identifier issue

* chore:formatted the code
2025-06-17 12:18:50 -03:00
Naman Khandelwal
8ee14a8648 fix(cli): prevent .app identifier (fix #12674) (#13618)
* fix(cli): prevent .app identifier

* chore(cli): changed warn log of non macOS

* Add change file

---------

Co-authored-by: Tony <legendmastertony@gmail.com>
2025-06-16 23:48:54 +08:00
renovate[bot]
0f0d6a4e02 chore(deps): update rust crate windows-sys to 0.60 (dev) (#13616)
* chore(deps): update rust crate windows-sys to 0.60

* Fix compile and update lock file

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tony <legendmastertony@gmail.com>
2025-06-16 17:58:29 +08:00
Tony
f9bdb9b230 fix: failing scope test on Windows (#13596) 2025-06-11 15:10:25 +02:00
renovate[bot]
f34acf161d chore(deps): update dependency rollup to v4.43.0 (dev) (#13604)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: FabianLars <github@fabianlars.de>
2025-06-11 14:52:46 +02:00
Emmanuel Ferdman
87b3cdce48 fix: resolve typos in schema (#13591)
* fix: update `English.nsh` reference

Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>

* fix: resolve typos in schema

Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>

* Generate schema

---------

Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
Co-authored-by: Tony <legendmastertony@gmail.com>
2025-06-08 00:50:10 +08:00
renovate[bot]
aa1131a047 chore(deps): update dependency rollup to v4.42.0 (#13583)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-06 23:10:34 +02:00
Pierre de la Martinière
bd8a7cf39d fix(bundler/linux): fix app icon not showing on Gnome+Wayland (#5258) (#13581) 2025-06-06 22:46:24 +02:00
Tony
f1891540bf refactor: simplify future in command IPC structs (#13529) 2025-06-04 20:32:51 +08:00
renovate[bot]
d15da3daae chore(deps): update rust crate duct to v1 (dev) (#13397)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: FabianLars <github@fabianlars.de>
2025-06-03 16:54:27 +02:00
Tunglies
414619c36e feat: add bundleName field to schema and MacConfig (#13110) (#13536) 2025-06-03 15:44:49 +02:00
Fabian-Lars
25757fece4 chore(cli): Remove outdated licensing errata in readme (#13548) 2025-06-03 13:58:40 +02:00
Tony
78d15e892d fix(windows): allow web fullscreen APIs to work (#13558)
* fix(windows): allow web fullscreen APIs to work

* tauri-runtime-wry not tauri-wry

* Remove last clone

* Change file on windows
2025-06-03 19:04:14 +08:00
Tony
6a39f49991 refactor: dynamic dispatch async commands in debug (#13464)
* Dynamic dispatch async commands

* format

* Preserve `'static`

* Use a inner function instead

* Only do it for dev for now

* Add change file

* Tag respond_async_serialized_dyn with debug
2025-05-29 22:02:56 +08:00
Tony
a35600cbd7 docs: fix setAutoResize typo (#13526) 2025-05-29 17:54:22 +08:00
Tunglies
1c53640ac3 fix(schema): update hardened_runtime description to include link (#13512) 2025-05-27 17:38:18 +02:00
Amr Bashir
e7f2d8cba4 chore: remove leftover in utils.nsh (#13507) 2025-05-26 06:20:31 +03:00
Amr Bashir
7322f05792 feat(nsis): allow using CheckIfAppIsRunning macro inside NSIS hooks (#13502) 2025-05-25 23:03:10 +03:00
renovate[bot]
06c75fd98b chore(deps): update dependency rollup to v4.41.1 (#13499)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-24 21:37:42 +08:00
Lucas Fernandes Nogueira
c8a30a61d2 fix(core): capability filtering crashing allowed command generation (#13476)
* fix(core): capability filtering crashing allowed command generation

tauri-plugin and tauri build scripts cannot have access to the capabilities file (generated by tauri-build) and can only infer capabilities from the config path

* cleanup

* unused import

* followup

* fix reassign

* mut

* Update crates/tauri-utils/src/acl/build.rs

Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>

---------

Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>
2025-05-22 07:45:32 -03:00
renovate[bot]
650c91c114 chore(deps): update rust crate zip to v4 (#13487)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-22 09:11:50 +08:00
Lucas Fernandes Nogueira
5a5291d66c fix(cli): use platform name to detect iOS architecture to build (#13483) 2025-05-21 14:12:44 -03:00
renovate[bot]
dbcfaa18d7 chore(deps): update dependency rollup to v4.41.0 (#13467)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-19 09:10:35 +08:00
WofWca
923b7c7bc6 docs: fix build instructions somewhat (#13463) 2025-05-18 20:43:49 +02:00
Tony
626165eeb4 fix: mock context without dynamic-acl feature (#13455) 2025-05-17 18:08:53 +08:00
Kingsword
638804e9c4 fix: ensure set_window_effects runs on main thread in WindowBuilder (#13422) (#13423)
Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>
2025-05-16 23:38:12 +02:00
Tony
1686296463 refactor: put dynamic acl to a feature (#13418)
* refactor: put dynamic acl to a feature

* Add change file

* Tweak remove_unused_commands's docs

* License header

* Document the feature

* Merge remote-tracking branch 'upstream/dev' into dynamic-acl-feature

* Use a inner non generic fn for add_capability

* Clippy and macro stability notice

* Merge remote-tracking branch 'upstream/dev' into dynamic-acl-feature

* Format
2025-05-16 22:54:23 +08:00
dependabot[bot]
85baacd18b chore(deps): bump undici from 5.28.5 to 5.29.0 (#13450)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: FabianLars <github@fabianlars.de>
2025-05-15 18:41:01 +02:00
Tony
c31c75fffc docs: fix missing docs for a few methods (#13449) 2025-05-16 00:17:28 +08:00
renovate[bot]
9687a9b4fb chore(deps): update rust crate zip to v3 (#13445)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-15 15:25:25 +08:00
Tony
4acae1ec02 fix(macos): run app.set_theme on main thread (#13443)
* fix(macos): run `app.set_theme` on main thread

* Change file
2025-05-15 15:13:23 +08:00
Tony
d38d90b8d9 refactor: reduce the code in macro pass (#13441) 2025-05-15 09:26:49 +08:00
Tony
b52da29d5d fix: main binary name can't contain dots (#13429)
* fix: main binary name can't contain dots

* Revert the change in tauri.conf.json

* Change file

* Use target platform when matching extension
2025-05-14 16:50:12 +08:00
Tony
574a4d4d36 fix(cli): slow dev startup (#13426)
* fix(cli): slow dev startup

* Use `recv_timeout` instead

* Update crates/tauri-cli/src/interface/rust.rs

Co-authored-by: Fabian-Lars <github@fabianlars.de>

---------

Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-05-14 16:48:05 +08:00
Tony
1777406a16 chore: apply some clippy suggestions (#13424) 2025-05-13 14:18:24 +08:00
MidnightCrowing
d3586a2afa docs(api): fix incorrect example and clarify description for dirname in path API docs (#13417) 2025-05-12 16:35:35 +08:00
Tony
b7cdb3b39e chore: feature gate html manipulation code (#13410)
* Feature gate html manipulation code

* Change file
2025-05-11 00:13:19 +08:00
Amr Bashir
96ecfca428 feat: check if webview runtime is accessible when creating a webview (#13406) 2025-05-10 06:00:09 +03:00
dependabot[bot]
0e616dbbcb chore(deps): bump ring from 0.17.8 to 0.17.14 (#13409)
Bumps [ring](https://github.com/briansmith/ring) from 0.17.8 to 0.17.14.
- [Changelog](https://github.com/briansmith/ring/blob/main/RELEASES.md)
- [Commits](https://github.com/briansmith/ring/commits)

---
updated-dependencies:
- dependency-name: ring
  dependency-version: 0.17.14
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-10 09:58:21 +08:00
Oscar Beaumont
bc2f0e48ac fix(macOS): caculation for work area (#13401)
* remove y offset

* Create change-pr-13401.md
2025-05-09 08:36:12 -03:00
renovate[bot]
efcc840ff0 chore(deps): update dependency eslint-config-prettier to v10.1.5 (#13403)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-09 15:27:18 +08:00
Fabian-Lars
7897ed257d fix(cli): don't canonicalize cargo's target dir in frontendDist verification (#13392) 2025-05-07 23:00:24 +02:00
renovate[bot]
1a018878ab chore(deps): update dependency eslint-config-prettier to v10.1.3 (#13387)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-07 21:17:19 +08:00
renovate[bot]
e15f665efc chore(deps): update dependency rollup to v4.40.2 (#13381)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-06 20:12:53 +08:00
Fabian-Lars
479cee3d36 fix(bundler): set ARCH env var for appimagetool (#13260) 2025-05-06 08:48:56 -03:00
39zde
09c19932d2 feat: add support for Service-Woker-Allowed HTTP header (#13304)
* add support for Service-Worker-Allowed headers

* add changes readme

* add service_worker_allowed in to_tokens
2025-05-06 08:15:19 -03:00
Tony
4221124c4e fix: use app's resource table for storing tray icons (#13316)
* Use app's resource table for storing tray icons

* Clean up

* Move remove tray logic to Resource::close
2025-05-06 08:11:49 -03:00
Lucas Fernandes Nogueira
b985eaf0a2 fix(core): immediately unregister event listener on unlisten call (#13306)
* fix(core): immediately unregister event listener on unlisten call

the unlisten function is currently async, but marked as `() => void` in the TypeScript definition. To avoid a breaking change, we're going to immediately unregister the listener function so it's not called.

this fixes a race condition where after calling unlisten() you would still receive events if you do not `await` it and there's a new event triggering while the unlisten command is running

* cleanup

* fix build

* fix ci
2025-05-05 10:46:05 -03:00
Miguel Duarte
c84b162374 docs: Fix description and add example for WebviewWindowBuilder::from_config (#13374)
* Update docs for WebviewWindowBuilder::from_config

The documentation for `WebviewWindowBuilder::from_config` mentions changing the label of the new `WebviewWindowBuilder`, which is not possible.

Instead, the label must be changed in the `WindowConfig` that is passed into `WebviewWindowBuilder::from_config`.

This change fixes that description and adds an example code snippet for this use-case.

* Add reference to function arguments so the type is correctly inferred

* Remove unnecesary reference

* fix tests

* fix doctest

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-05-05 09:37:53 -03:00
geeseofbeverlyroad
4f75bf5bdb docs: Added more detailed comments to menu popup method and DPI-related classes (#13368)
* Detailed function description for popup()

* Expanded DPI class descriptions

* fmt

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-05-05 09:25:30 -03:00
Tony
b5c549d189 refactor: rework transformCallback (#13325)
* refactor: rework `transformCallback`

* Migrate listen and unlisten js

* handlerId -> listener.handlerId

* Update docs

* `transformCallback` change file

* typo
2025-05-05 09:15:38 -03:00
Daniil Oberlev
208f4bcadc changed operator in vite.config.js (#13373)
Prefer using nullish coalescing operator (`??`) instead of a logical or (`||`), as it is a safer operator.
2025-05-04 03:56:28 +03:00
Lucas Fernandes Nogueira
f0662e41f4 fix(tauri-runtime-wry): window prevent overflow monitor check (#13365) 2025-05-03 14:31:43 -03:00
Matthew Richardson
dfacb656d2 fix: Can't register multiple plugin listeners for an event (#13360)
* fix: Can't register multiple listeners for an event

* add change file

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-05-02 15:43:47 -03:00
Tony
db03f00693 refactor: use WindowConfig for create_webview (#13322)
* refactor: use WindowConfig for `create_webview`

* Pass in label inside options

* Fix compile
2025-05-01 09:43:25 -03:00
Lucas Nogueira
a60a383360 chore(ci): tweak workflow name reference in paths list 2025-05-01 09:20:52 -03:00
Tony
aa8661acfd chore(deps): bump js dependencies (#13355) 2025-05-01 11:29:35 +02:00
Lucas Fernandes Nogueira
e045fe32c9 fix(bundler): custom sign command failing to sign uninstaller executable (#13334) 2025-04-30 15:21:14 -03:00
Kingsword
197da6fe78 docs(window): monitorFromPoint example error (#13340) 2025-04-30 03:24:32 +03:00
Oscar Beaumont
94b77b36e3 fix: use format_callback::format_raw for channels (#13288)
* fix it

* Create change-pr-13288.md

* fixes

* fixes

* fix .change
2025-04-29 08:45:22 +08:00
renovate[bot]
527bf0031e chore(deps): update dependency rollup to v4.40.1 (#13328)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-28 15:03:27 +08:00
Kingsword
35aa7e1218 fix(cli): Allow the use of target dir inside frontendDist/distDir (unless it's cargo's target dir) (#13294)
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-04-27 21:37:50 +02:00
Kingsword
23b9da75b9 fix path joining behavior where path.join('', 'a') incorrectly returns "/a" instead of "a" (#13313) (#13324)
* fix path joining behavior where path.join('', 'a') incorrectly returns "/a" instead of "a" (#13313)

* Clean up

---------

Co-authored-by: Tony <legendmastertony@gmail.com>
2025-04-27 14:18:27 +08:00
Neriya Cohen
8a8c1f9f3b fix(windows): typos in Hebrew translation for NSIS installer (#13317) 2025-04-27 11:09:20 +08:00
Kingsword
50ebddaa2d feat: expose the setAutoResize API for webviews in @tauri-apps/api (#13318) (#13319) 2025-04-27 10:27:23 +08:00
Lucas Fernandes Nogueira
568efb4568 fix: follow-up fix for monitor work area on macOS (#13310)
follow-up for #13309
2025-04-26 15:03:35 -03:00
Lucas Fernandes Nogueira
6ce10ab773 fix: monitor work_area on macOS (#13309)
macOS uses a different coordinate system for visibleFrame, so to get accurate values we should only get the diff between frame() and visibleFrame() and apply that to the standard monitor position returned by CGDisplayBounds. Size isn't impacted by this, and properly returns the value (accounting for dock position).
2025-04-25 20:08:46 -03:00
Lucas Fernandes Nogueira
039f44b7b1 fix(core): fix TrayIcon.getById returning new resource IDs (#13307)
* fix(core): fix TrayIcon.getById returning new resource IDs

this prevents the close() from working properly if you somehow lose the new() resource ID (for instance when the app reloads) and need to pick it up again and close it.

* cleanup on close
2025-04-25 15:30:53 -03:00
situ2001
00dfc32a2d docs(webview): corrected examples to ensure webview is created after window initialization (#13279)
* fix: typo

* docs(webview): corrected examples to ensure webview is created after window initialization
2025-04-23 04:56:52 +02:00
situ2001
76cbeef208 fix: add proxy URL support to Webview at Rust-side. (#13278)
* fix: add proxy URL support to Webview

* chore: add .changes file

* Change file
2025-04-23 09:38:43 +08:00
Amr Bashir
267368fd4f feat: add workarea getter for monitor (#13276) 2025-04-23 03:29:03 +02:00
situ2001
4e00b27913 docs: update example for in webview ts api (#13272) 2025-04-21 18:15:14 +02:00
github-actions[bot]
766bccc341 apply version updates (#13243)
Co-authored-by: amrbashir <48618675+amrbashir@users.noreply.github.com>
2025-04-21 05:54:30 +02:00
Amr Bashir
31becbd1d1 enhance(core): respect data-tauri-drag-region="false" (#13269) 2025-04-21 05:03:54 +02:00
Tony
da2a6ae5e3 fix(core): raw channel message type regression (#13268)
* Fix raw channel message type regression

* Re-word change file

* Rename formated_bytes to bytes_as_json_array
2025-04-21 10:26:00 +08:00
renovate[bot]
87fdc3b9cd chore(deps): update rust crate jsonschema to 0.30 (#13249)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-20 20:37:48 +08:00
renovate[bot]
30e76c7d3a chore(deps): update rust crate brotli to v8 (#13264)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-20 20:23:13 +08:00
Tony
85b1912529 Make tauri-runtime-wry optional with features (#13241) 2025-04-16 14:50:11 +08:00
Lucas Fernandes Nogueira
82da4f17f5 fix(ci): ubuntu 20.04 no longer exists (#13240) 2025-04-15 17:45:05 -03:00
github-actions[bot]
977c4b496c apply version updates (#13123)
Co-authored-by: lucasfernog <20051258+lucasfernog@users.noreply.github.com>
2025-04-15 14:42:44 -03:00
Lucas Nogueira
48b12b4404 chore: bump crates depending on tauri-utils as minor 2025-04-15 14:18:15 -03:00
Lucas Fernandes Nogueira
9356fa15d8 feat(core): include type name in state panic message (#13239)
* feat(core): include type name in state panic message

* tweak message
2025-04-15 14:15:45 -03:00
Kingsword
2dccfab532 fix: fileAssociations missing LSHandlerRank on macOS (#13159) (#13236) 2025-04-15 13:45:46 -03:00
Lucas Nogueira
5d3687e8c3 chore(tauri-driver): update README 2025-04-15 13:44:07 -03:00
Lucas Fernandes Nogueira
0cf2d9933f fix(tauri-driver): append .exe ext on app path on Windows, closes #11317 (#13238) 2025-04-15 13:43:19 -03:00
Tony
1734273bbe fix: using center and overflow together crashes (#13235) 2025-04-15 16:59:01 +08:00
Tony
690146e311 fix(macros): invoke handler stack overflow (#13217)
* Fix invoke handler stack overflow

* Format and inline iife in release build

* Add change file

* The comment should be one level up
2025-04-14 18:52:23 -03:00
Tony
f888502fd2 fix(core): use Headers in sendIpcMessage (#13227)
* Use `Headers` in `sendIpcMessage`

* Add change file

* Change files

* Don't use optional chaining
Seems like we have changed it in #9530 deliberately,
so preserving it in this change

* do not let the tauri headers to be overwritten

Co-authored-by: Sean Wang <126865849+WSH032@users.noreply.github.com>

* use HeadersInit on the type definition

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
Co-authored-by: Sean Wang <126865849+WSH032@users.noreply.github.com>
2025-04-14 17:58:20 -03:00
Mateusz Kurowski
577c7ffc45 fix(webdriver): windows: make native webdriver close with parent process (fix #8610) (#10108)
* fix(webdriver): windows: make native webdriver close with parent process

* add change file

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-04-14 17:57:44 -03:00
Lucas Fernandes Nogueira
82406c61e0 feat(cli): improve iOS simulator usage and check SDK installation (#13231)
applies https://github.com/tauri-apps/cargo-mobile2/pull/453
2025-04-14 14:57:13 -03:00
Lucas Fernandes Nogueira
07953fb9c3 fix(tauri-runtime-wry): send focused events on multiwebview for Windows (#13222)
* fix(tauri-runtime-wry): send focused events on multiwebview for Windows

closes #9755

follow-up for #12014

* fix mobile build
2025-04-14 14:56:57 -03:00
thewh1teagle
8d994f60fe fix(bundler): sign DLLs (#11676)
* fix: sign nsis plugin DLLs

* also sign DLLs on unix

* fix build

* create copy of nsis dir

* always make a copy of nsis (so linux works, permission error otherwise)

* fix windows build

* fix

* to_path_buf

* also create wix copy

* remove unused toolset change

* fix unused var

* fmt

* fix wix build

* fix build

* fix plugin copy

* fix conflict

* fix file download

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-04-13 18:46:14 -03:00
sftse
8a1d490820 Clippy (#12485)
* fix: remove unused clones, discovered with clippy nursery lint clippy::redundant_clone

* fix: clippy

* fix: remove no longer used clippy allow directives

* more lint

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-04-13 08:21:34 -03:00
Lucas Fernandes Nogueira
89c6e436ea chore(api): add typescript dependency (#13220)
I noticed `pnpm ts:check` isn't working on my end, currently only works if the typescript package is globally installed
2025-04-12 22:04:40 -03:00
Neriya Cohen
b0babb6df1 Add Hebrew translation to NSIS languages (#12938)
* Create Hebrew.nsh

* add change file

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-04-12 22:04:30 -03:00
Typed SIGTERM
b8f86669ab fix: make isTauri runtime-unrelated (#13145)
* Update core.ts

* Update core.ts

* Update core.ts

* lint

* build

* fix lint, add change file

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-04-12 21:30:03 -03:00
Tony
7ed877a0ae chore(example): migrate API example to svelte 5 (#13146)
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-04-12 21:11:21 -03:00
Lucas Fernandes Nogueira
ea36294cbc feat(core): allow changing or disabling the input accessory view on iOS (#13208)
* feat(core): allow changing or disabling the input accessory view on iOS

needs https://github.com/tauri-apps/wry/pull/1544

* remove unused code

* fix imports

* lint

* fix features

* wry 0.51.2
2025-04-12 21:10:07 -03:00
Tony
0d39ff6b09 fix(core): missing core: in referenced commands (#13150) 2025-04-12 21:03:19 -03:00
Tony
ad3fd3890f feat(cli): try detect package manager from env (#13152)
* fix(cli): try detect package manager from env

* Typo
2025-04-12 21:01:06 -03:00
Lucas Fernandes Nogueira
3752fed282 feat(cli): enhance iOS bundle version formatting (#13218)
* feat(cli): enhance iOS bundle version formatting

follow-up for #13030 and https://github.com/tauri-apps/cargo-mobile2/pull/450

the bundle version validation has been updated, now it can actually handle one or two integers (e.g. `100` or `10.7`) instead of just full triple semver strings (e.g. `10.7.1`).

* lint
2025-04-12 20:51:56 -03:00
Tony
b072e2b296 feat(core): add an option for preventing window overflow (#9687)
* Add an option for preventing window overflow

* Fix shadow counted as part of the width

* Enable prevent overflow by default

* Fix crashing when margin is bigger than screen

* Config file support

* Add to ts type

* Add mac implementation

* Should be let some

* Apply suggestions from code review

Co-authored-by: Jason Tsai <jason@pews.dev>

* checked_sub -> saturating_sub

* Revert license header

* Migrate windows 0.58

* Generate schema

* Fix merge conflict

* Try casting to objc2_app_kit::NSScreen

* Add NSScreen feature

* Use cast instead of as

* fmt

* Deref first

* Wrong unsafe block

* Add change file

* Add serde alias

* More docs

* Disable prevent_overflow by default
since we can't make breaking changes anymore right now

* Remove unused default impl

* Missing pub

* Fix mock_runtime on ios

* Match PreventOverflowMargin's description

* Typo

* Apply suggestions from code review

* Move get_work_area_size to seperate files

* Unused imports

* Add prevent_overflow to WebviewWindowBuilder

* Fix mac compile

* MonitorExt is only for desktop

* Rename to work_area

* Use workarea for linux

* Missing `()`

* Convert size

* Import MonitorExt

* as u32

* Re-build API js

* Fix wrong docs for work_area

* Remove linux platform specific note

* Remove left over linux platform specific note

* Use work area API for center as well

* Fix mobile

* Clean up

* small cleanup

* fix codegen

* update docs

* fix generated

---------

Co-authored-by: Jason Tsai <jason@pews.dev>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-04-12 13:56:43 -03:00
Lucas Fernandes Nogueira
0802529031 fix(cli): iOS dev broken on Xcode 16.3, closes #13128 (#13210)
* fix(cli): iOS dev broken on Xcode 16.3, closes #13128

Looks like we cannot use the arm64-sim custom architecture on Xcode 16.3, as it incorrectly appends the -sim suffix on some clang build scripts which ends up with an invalid target triple.

Currently we do not have automation to update Xcode/Android projects, so a manual intervention is required by our users, either recreating the project or modifying it manually (the arm64-sim arch must be removed and all its references).

ref https://github.com/tauri-apps/cargo-mobile2/pull/445

* fix dev on macOS with intel chip
2025-04-12 12:50:06 -03:00
Tony
66e6325f43 fix: channel callback never cleaned up from window (#13136)
* Fix channel cb never cleaned up from `window`

* Should be `_{id}`

* Still need to manually impl clone

* Regenerate bundle.global.js

* Remove current_index from ChannelInner

* Move phantom to `Channel`

* `Channel` not `Self`

* Clean up

* Clean up

* Fix missing end quote

* Add change file

* Rename id to index to match js side

* Improve channel speed on small data

* do the same perf check for IPC responses and raw bytes

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-04-12 10:31:25 -03:00
Matthew Richardson
0aa48fb9e4 feat: Support custom CFBundleVersion for iOS and macOS (#13030)
* feat: Add bundleVersion for iOS and macOS

* feat: Use bundleVersion for CFBundleVersion

* feat: Synchronize bundleVersion with Info.plist

* cleanup

* fix bundle version, enhance prerelease/buildnumber support and checks

* fix change file

* tauri-bundler to change file

* expand doc

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-04-12 09:28:48 -03:00
renovate[bot]
628f4a97e4 chore(deps): update dependency rollup to v4.40.0 (#13214)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-12 18:16:09 +08:00
Tony
fca5154e7a chore(core)!: remove re-exported WebviewAttributes (#13130) 2025-04-11 20:34:15 -03:00
Tony
fbd57a1afd feat(core): make invoke_system take AsRef<str> (#13175)
* feat(core): make `invoke_system` take `AsRef<str>`

* Use minor bump
2025-04-11 20:30:05 -03:00
The1111mp
dd4f13ce4b feat: add set_dock_visibility method (#13185)
* feat: add `set_dock_visibility` method

Signed-off-by: The1111mp <The1111mp@outlook.com>

* add api

* retain focus

* fmt

* make SetDockVisibility message conditional (macos only)

* lint

---------

Signed-off-by: The1111mp <The1111mp@outlook.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-04-11 15:13:07 -03:00
dependabot[bot]
7b14531f24 chore(deps-dev): bump vite from 6.2.5 to 6.2.6 (#13206)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 6.2.5 to 6.2.6.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v6.2.6/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v6.2.6/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 6.2.6
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-11 23:48:57 +08:00
Trivikram Kamat
7a86e0f8a1 ci: remove redundant corepack enable (#13203) 2025-04-11 09:04:19 -03:00
Simon Laux
c1cd0a2ddb feat: macOS/iOS: add option to disable or enable link previews when building a webview (#13090)
* macOS/iOS: add option to disable or enable link previews when building a webview (the webkit api has it enabled by default)
  -  `WebViewBuilderExtDarwin.allow_link_preview(allow_link_preview: bool)`
  -  `WebViewBuilder.allow_link_preview(allow_link_preview: bool)`
  -  `WebviewWindowBuilder.allow_link_preview(allow_link_preview: bool)`

* also call on iOS

* add api

* fix tests

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-04-11 09:00:34 -03:00
dependabot[bot]
073dbc3953 chore(deps): bump crossbeam-channel from 0.5.14 to 0.5.15 (#13194)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-10 16:54:11 +02:00
renovate[bot]
47df696dfb chore(deps): update dependency eslint-config-prettier to v10.1.2 (#13192)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-10 15:03:40 +02:00
Tony
9ea76503dc fix(nsis): can't include resources with $ (#13186) 2025-04-09 20:03:35 +08:00
Lucas Fernandes Nogueira
bb5faa21f4 chore: update tao, wry, windows, webview2-com (#13163)
* chore: update tao, wry, windows, webview2-com

* update docs

* Use `impl Into<String>`

* More docs

---------

Co-authored-by: Tony <legendmastertony@gmail.com>
2025-04-09 08:15:31 -03:00
renovate[bot]
b32153b437 chore(deps): update rust crate tokio to v1.43.1 [security] (#13172)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-08 09:35:03 +08:00
dependabot[bot]
c71755fd5f chore(deps-dev): bump vite from 6.2.4 to 6.2.5 (#13138)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 6.2.4 to 6.2.5.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v6.2.5/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v6.2.5/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 6.2.5
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-05 10:08:12 +08:00
dependabot[bot]
7b81825144 chore(deps): bump openssl from 0.10.70 to 0.10.72 (#13140)
Bumps [openssl](https://github.com/sfackler/rust-openssl) from 0.10.70 to 0.10.72.
- [Release notes](https://github.com/sfackler/rust-openssl/releases)
- [Commits](https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.70...openssl-v0.10.72)

---
updated-dependencies:
- dependency-name: openssl
  dependency-version: 0.10.72
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-05 10:07:41 +08:00
Tony
ebd3dcb92f enhance(core): change eval to take Into<String> (#13135) 2025-04-04 10:06:22 +02:00
Tony
80dccb6a2e chore: fix a few internal docs and apply clippy suggestions (#13131)
* chore: fix a few internal docs

* Remove label clone

* Unused allow lint

* No way clippy just updated

* `cargo clippy --fix -- -W clippy::redundant_clone`

* format
2025-04-03 17:57:36 +02:00
WofWca
cf0b3588a3 docs: add SafePathBuf examples (#13122) 2025-04-02 14:02:48 -03:00
Tony
b8c0d7e402 fix: run_return not responding to restart (#13040)
* fix: `run_return` not responding to `restart`

* Document run_return will handle restart requests

* Add change file
2025-04-02 09:54:38 -03:00
renovate[bot]
e4982dff73 chore(deps): update dependency rollup to v4.39.0 (#13125)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-02 17:17:43 +08:00
Simon Laux
8cf662e34b feat: expose api to run initialization scripts on all frames. (#13076)
* api!: expose api to run initialisation scripts on all frames.

* remove breaking change, add new api instead.

* Update .changes/init-script-on-all-frames.md

Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>

* use struct `InitializationScript` instead of tuple

* Update crates/tauri-runtime/src/webview.rs

Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>

* Apply suggestions from code review

* Update crates/tauri/src/webview/webview_window.rs

---------

Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>
2025-04-02 08:41:34 +08:00
github-actions[bot]
b154826881 apply version updates (#13060)
Co-authored-by: lucasfernog <20051258+lucasfernog@users.noreply.github.com>
2025-04-01 13:52:38 -03:00
Lucas Nogueira
dade232592 chore: change bumps to patches 2025-04-01 13:14:28 -03:00
Tony
aa6b4d4edf fix(cli): preserve null when merging patches (#13120)
* fix(cli): preserve null when merging patches

* add test

* remove commented out code

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-04-01 13:09:50 -03:00
Tony
794af778e4 fix(cli): merge config based on the first one (#13117)
* fix(cli): merge config based on the first one

* Add change file
2025-04-01 17:18:13 +08:00
dependabot[bot]
4e22ae29d3 chore(deps-dev): bump vite from 6.2.3 to 6.2.4 (#13111)
* chore(deps-dev): bump vite from 6.2.3 to 6.2.4

Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 6.2.3 to 6.2.4.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v6.2.4/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v6.2.4/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update esbuild

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tony <legendmastertony@gmail.com>
2025-04-01 09:05:10 +08:00
Tony
4ae14bf2f2 fix: suppress deprecated warning in tray icon codegen (#13093) 2025-03-31 09:54:07 +08:00
Pietagorh
f805061d11 feat(cli): allow for toml and json5 files in --config arg (#13079) 2025-03-30 18:11:47 +02:00
Tony
30beb6fee7 fix(cli): tauri info can't find the latest version for rust crates (#13096)
* fix(cli): `tauri info` can't find the latest version for rust crates

* Forget to remove dbg!

* Use strip_suffix

* Add change file
2025-03-29 23:45:38 +08:00
renovate[bot]
22c7a877e3 chore(deps): update dependency rollup to v4.38.0 (#13094)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-29 17:32:15 +08:00
Tony
2138bbc212 fix(nsis): in wrong language if SpanishInternational is included (#13087) 2025-03-28 03:45:13 -07:00
dependabot[bot]
5c2b3b8b65 chore(deps-dev): bump vite from 6.2.0 to 6.2.3 (#13072)
* chore(deps-dev): bump vite from 6.2.0 to 6.2.3

Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 6.2.0 to 6.2.3.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v6.2.3/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v6.2.3/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update esbuilds to the same version

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tony <legendmastertony@gmail.com>
2025-03-26 15:10:34 +08:00
阿豪
dd13728334 enhance(api): add generic parameter to emit and emitTo functions (#13066)
closes #13059
2025-03-25 05:34:20 +02:00
renovate[bot]
f235ec0113 chore(deps): update dependency rollup to v4.37.0 (#13062)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-24 21:14:02 +08:00
Matthew Richardson
f182b0bb93 docs: Update general setup in contributing guide (#13065) 2025-03-24 05:51:09 -07:00
Tony
a851b6597f enhance: include permission group permissions in the generated schema (#13057)
* enhance: include permissions in default permission description

* Only include in schema

* Remove 'which includes` to tauri's build script

* Also bump utils

* Clippy
My local clippy didn't report this, weird

* Use `which enables all commands`
for default permissions that enables everything

* Extract description into a variable

* Generate permissions with or without description

* Tweak the docs and generate 'which includes'

* Simplify to just `includes`

* Docs change change file

* Put the change in minor

* Update .changes/include-permissions-in-schema.md

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>

* Remove unused change file

---------

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
2025-03-23 21:35:45 +08:00
WofWca
be31675fbc docs: improve Builder::run docs (#13058)
Otherwise people might use it and not realize
that `App::run` also takes the callback argument,
which could be useful for some.
2025-03-23 15:07:33 +02:00
Lőrik Levente
dea8bbf6cd docs: Improve BaseDirectory documentation (#13043)
* add notes

* Add links

* fix fmt
2025-03-21 13:57:34 +02:00
524 changed files with 41438 additions and 12834 deletions

View File

@@ -6,4 +6,6 @@ ignore = [
"RUSTSEC-2020-0095",
# proc-macro-error is unmaintained
"RUSTSEC-2024-0370",
# time crate can't be updated in the repo because of MSRV, users are unaffected
"RUSTSEC-2026-0009",
]

5
.changes/base64.md Normal file
View File

@@ -0,0 +1,5 @@
---
"tauri-macos-sign": patch:enhance
---
Do not rely on system base64 CLI to decode certificates.

View File

@@ -27,12 +27,6 @@
"dryRunCommand": true,
"pipe": true
},
{
"command": "cargo generate-lockfile",
"dryRunCommand": true,
"runFromRoot": true,
"pipe": true
},
{
"command": "cargo audit ${ process.env.CARGO_AUDIT_OPTIONS || '' }",
"dryRunCommand": true,
@@ -171,6 +165,11 @@
"manager": "rust",
"dependencies": ["tauri-utils", "tauri-runtime"]
},
"tauri-runtime-cef": {
"path": "./crates/tauri-runtime-cef",
"manager": "rust",
"dependencies": ["tauri-utils", "tauri-runtime"]
},
"tauri-codegen": {
"path": "./crates/tauri-codegen",
"manager": "rust",

View File

@@ -0,0 +1,5 @@
---
"tauri": minor:feat
---
Add `data-tauri-drag-region="deep"` so clicks on non-clickable children will drag as well. Can still opt out of drag on some regions using `data-tauri-drag-region="false"`

View File

@@ -0,0 +1,7 @@
---
"@tauri-apps/cli": patch:enhance
"tauri-cli": patch:enhance
"tauri-bundler": patch:enhance
---
When a captured command fails, include its stderr in the error message.

View File

@@ -0,0 +1,5 @@
---
"tauri-bundler": minor:feat
---
Added support to Liquid Glass icons.

View File

@@ -0,0 +1,6 @@
---
"tauri-cli": patch:enhance
"@tauri-apps/cli": patch:enhance
---
Show the context before prompting for updater signing key password

View File

@@ -5,6 +5,7 @@ Hi! We, the maintainers, are really excited that you are interested in contribut
- [Issue Reporting Guidelines](#issue-reporting-guidelines)
- [Pull Request Guidelines](#pull-request-guidelines)
- [Development Guide](#development-guide)
- [AI Tool Policy](#ai-tool-policy)
## Issue Reporting Guidelines
@@ -33,11 +34,9 @@ Hi! We, the maintainers, are really excited that you are interested in contribut
- It's OK to have multiple small commits as you work on the PR - we will let GitHub automatically squash it before merging.
- If adding new feature:
- Provide convincing reason to add this feature. Ideally you should open a suggestion issue first and have it greenlighted before working on it.
- If fixing a bug:
- If you are resolving a special issue, add `(fix: #xxxx[,#xxx])` (#xxxx is the issue id) in your PR title for a better release log, e.g. `fix: update entities encoding/decoding (fix #3899)`.
- Provide detailed description of the bug in the PR, or link to an issue that does.
@@ -51,37 +50,70 @@ Hi! We, the maintainers, are really excited that you are interested in contribut
First, [join our Discord server](https://discord.gg/SpmNs4S) and let us know that you want to contribute. This way we can point you in the right direction and help ensure your contribution will be as helpful as possible.
To set up your machine for development, follow the [Tauri setup guide](https://v2.tauri.app/start/prerequisites/) to get all the tools you need to develop Tauri apps. The only additional tool you may need is [PNPM](https://pnpm.io/), it is only required if you are developing the Node CLI or API packages (`packages/cli` and `packages/api`). Next, fork and clone this repo. It is structured as a monorepo, which means that all the various Tauri packages are under the same repository. The development process varies depending on what part of Tauri you are contributing to, see the guides below for per-package instructions.
To set up your machine for development, follow the [Tauri setup guide](https://v2.tauri.app/start/prerequisites/) to get all the tools you need to develop Tauri apps. The only additional tool you may need is [PNPM](https://pnpm.io/), it is only required if you are developing the Node CLI or API packages (`packages/cli` and `packages/api`).
Some Tauri packages will be automatically built when running one of the examples. Others, however, will need to be built beforehand. To build these automatically, run the `.scripts/setup.sh` (Linux and macOS) or `.scripts/setup.ps1` (Windows) script. This will install the Rust and Node.js CLI and build the JS API. After that, you should be able to run all the examples. Note that the setup script should be executed from the root folder of the repository in order to run correctly.
Next, [fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) and clone [this repository](https://github.com/tauri-apps).
The development process varies depending on what part of Tauri you are contributing to, see the guides below for per-package instructions.
Some Tauri packages will be automatically built when running one of the examples. Others, however, will need to be built beforehand. To initialize, execute these commands in the repository root:
```bash
pnpm install
pnpm build
```
### Overview
See [Architecture](../ARCHITECTURE.md#major-components) for an overview of the packages in this repository.
### Developing Tauri Core and Related Components (Rust API, Macros, Codegen, and Utils)
The code for the Rust crates, including the Core, Macros, Utils, WRY runtime, and a few more are located in the [main Tauri repository](https://github.com/tauri-apps/tauri/tree/dev/crates).
The easiest way to test your changes is to use the [helloworld](https://github.com/tauri-apps/tauri/tree/dev/examples/helloworld) example app. It automatically rebuilds and uses your local copy of the Tauri core packages. Just run `cargo run --example helloworld` after making changes to test them out.
To test local changes against your own application simply point the Tauri create to your local repository. In `src-tauri/Cargo.toml` file change:
`tauri = { version = "2.1.1" }`
to:
`tauri = { path = "path/to/local/tauri/crates/tauri" }`
If any other crates depend on Tauri you will have to point them to the local repo as well.
### Developing Tauri Bundler and Rust CLI
The code for the bundler is located in `[Tauri repo root]/crates/tauri-bundler`, and the code for the Rust CLI is located in `[Tauri repo root]/crates/tauri-cli`. If you are using your local copy of `@tauri-apps/cli` (see above), any changes you make to the bundler and CLI will be automatically built and applied when running the build or dev command. Otherwise, running `cargo install --path .` in the Rust CLI directory will allow you to run `cargo tauri build` and `cargo tauri dev` anywhere, using the updated copy of the bundler and cli. You will have to run this command each time you make a change in either package.
The code for the bundler is located in [crates/tauri-bundler](https://github.com/tauri-apps/tauri/tree/dev/crates/tauri-bundler), and the code for the Rust CLI is located in [tauri-cli](https://github.com/tauri-apps/tauri/tree/dev/crates/tauri-cli).
Running `cargo install --path .` in the Rust CLI directory will allow you to run `cargo tauri build` and `cargo tauri dev` anywhere, using the updated copy of the bundler and cli. You will have to run this command each time you make a change in either package.
You can use `cargo install --path . --debug` to speed up test builds.
### Developing The Node.js CLI (`@tauri-apps/cli`)
`@tauri-apps/cli` is a wrapper to `tauri-cli` so most changes should be written on the Rust CLI. The `[Tauri repo root]/crates/tauri-cli` folder contains only packaging scripts to properly publish the Rust CLI binaries to NPM.
### Developing Tauri Core and Related Components (Rust API, Macros, Codegen, and Utils)
The code for the Rust crates, including the Core, Macros, Utils, WRY runtime, and a few more are located in `[Tauri repo root]/crates/tauri-(macros/utils)`. The easiest way to test your changes is to use the `[Tauri repo root]/examples/helloworld` app. It automatically rebuilds and uses your local copy of the Tauri core packages. Just run `cargo run --example helloworld` after making changes to test them out.
[`@tauri-apps/cli`](https://github.com/tauri-apps/tauri/tree/dev/packages/cli) is a small wrapper around `tauri-cli` so most changes should be happen in the Rust CLI (see above).
#### Building the documentation locally
You can build the Rust documentation locally running the following script:
```bash
$ RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features --open
$ cargo +nightly doc --all-features --open
```
### Developing the JS API
The JS API provides bindings between the developer's JS in the Webview and the builtin Tauri APIs, written in Rust. Its code is located in `[Tauri repo root]/packages/api`. After making changes to the code, run `pnpm build` to build it. To test your changes, we recommend using the API example app, located in `[Tauri repo root]/examples/api`. It will automatically use your local copy of the JS API and provides a helpful UI to test the various commands.
The JS API provides bindings between the developer's JS in the Webview and the built-in Tauri APIs, written in Rust. Its code is located in [/packages/api](https://github.com/tauri-apps/tauri/tree/dev/packages/api).
After making changes to the code, run `pnpm build` to build it. To test your changes, we recommend using the API example app, located in [/examples/api](https://github.com/tauri-apps/tauri/tree/dev/examples/api). It will automatically use your local copy of the JS API and provides a helpful UI to test the various commands.
## AI Tool Policy
It takes a lot of time to review a Pull Request while it's very easy to make a nonsensical but plausible looking one using AI tools.
It is unfair for other contributors and the reviewers to spend much of the time dealing with this, hence these rules:
1. Review and test all LLM-generated content before submitting, you're the one responsible for it, not the AI.
2. Don't use AI to respond to review comments (except for translations).
We will close the Pull Request with a `ai-slop` tag if you failed to do so.
## Financial Contribution

View File

@@ -33,11 +33,6 @@ Releasing can be as easy as merging the version pull request but here is a check
- [ ] Double check that every package is bumped correctly and there are no accidental major or minor being released unless that is indeed the intention.
- [ ] Make sure that there are no pending or unfinished [covector-version-or-publish.yml](./workflows/covector-version-or-publish.yml) workflow runs.
- [ ] Sign the Version PR before merging as we require signed commits
- [ ] `git fetch --all`
- [ ] `git checkout release/version-updates`
- [ ] `git commit --amend -S`
- [ ] `git push --force`
- [ ] Approve and merge the version pull request
## Publishing failed, what to do?

View File

@@ -8,6 +8,13 @@ on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
pull_request:
paths:
- '.github/workflows/audit.yml'
- '**/Cargo.lock'
- '**/Cargo.toml'
- '**/package.json'
- '**/pnpm-lock.yaml'
push:
paths:
- '.github/workflows/audit.yml'
@@ -26,7 +33,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: rust audit
uses: rustsec/audit-check@v1
uses: rustsec/audit-check@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
@@ -34,9 +41,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
npm i -g --force corepack
corepack enable
- run: npm i -g --force corepack
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'

View File

@@ -8,6 +8,7 @@ on:
pull_request:
paths:
- '.github/workflows/check-generated-files.yml'
- 'pnpm-lock.yaml'
- 'packages/api/src/**'
- 'crates/tauri/scripts/bundle.global.js'
- 'crates/tauri-utils/src/config.rs'
@@ -31,6 +32,7 @@ jobs:
with:
filters: |
api:
- 'pnpm-lock.yaml'
- 'packages/api/src/**'
- 'crates/tauri/scripts/bundle.global.js'
schema:
@@ -44,9 +46,7 @@ jobs:
if: needs.changes.outputs.api == 'true'
steps:
- uses: actions/checkout@v4
- run: |
npm i -g --force corepack
corepack enable
- run: npm i -g --force corepack
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'

View File

@@ -23,9 +23,7 @@ jobs:
with:
fetch-depth: 0
- run: |
npm i -g --force corepack
corepack enable
- run: npm i -g --force corepack
- uses: actions/setup-node@v4
with:
node-version: 20
@@ -34,6 +32,10 @@ jobs:
- name: install stable
uses: dtolnay/rust-toolchain@stable
- name: install x86_64-apple-darwin target (required by bundler CEF helper on macOS)
if: matrix.platform == 'macos-latest'
run: rustup target add x86_64-apple-darwin
- name: install Linux dependencies
if: matrix.platform == 'ubuntu-latest'
run: |
@@ -63,7 +65,7 @@ jobs:
actions: write # required for workflow_dispatch
contents: write # required to create new releases
pull-requests: write # required to open version update pr
id-token: write # pnpm provenance
id-token: write # pnpm provenance / oidc token
outputs:
change: ${{ steps.covector.outputs.change }}
commandRan: ${{ steps.covector.outputs.commandRan }}
@@ -75,14 +77,10 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: |
npm i -g --force corepack
corepack enable
- uses: actions/setup-node@v4
- run: npm i -g --force corepack
- uses: actions/setup-node@v6
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'
node-version: 24
- name: cargo login
run: cargo login ${{ secrets.ORG_CRATES_IO_TOKEN }}
@@ -100,7 +98,6 @@ jobs:
uses: jbolda/covector/packages/action@covector-v0
id: covector
env:
NODE_AUTH_TOKEN: ${{ secrets.ORG_NPM_TOKEN }}
CARGO_AUDIT_OPTIONS: ${{ secrets.CARGO_AUDIT_OPTIONS }}
NPM_CONFIG_PROVENANCE: true
with:
@@ -123,6 +120,7 @@ jobs:
commit-message: 'apply version updates'
labels: 'version updates'
body: ${{ steps.covector.outputs.change }}
sign-commits: true
- name: Trigger doc update
if: |

View File

@@ -66,9 +66,7 @@ jobs:
with:
targets: ${{ matrix.target.name }}
- run: |
npm i -g --force corepack
corepack enable
- run: npm i -g --force corepack
- name: Setup node
uses: actions/setup-node@v4
with:

View File

@@ -26,9 +26,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
npm i -g --force corepack
corepack enable
- run: npm i -g --force corepack
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'

View File

@@ -19,9 +19,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
npm i -g --force corepack
corepack enable
- run: npm i -g --force corepack
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
@@ -33,9 +31,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
npm i -g --force corepack
corepack enable
- run: npm i -g --force corepack
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'

View File

@@ -10,7 +10,7 @@ on:
- dev
pull_request:
paths:
- '.github/workflows/lint-cli.yml'
- '.github/workflows/lint-rust.yml'
- 'crates/**'
env:

View File

@@ -20,6 +20,10 @@ defaults:
run:
working-directory: packages/cli/
permissions:
contents: write # update release
id-token: write # oidc token
jobs:
build:
strategy:
@@ -44,16 +48,15 @@ jobs:
architecture: x64
target: aarch64-pc-windows-msvc
build: pnpm build --target aarch64-pc-windows-msvc
- host: ubuntu-20.04
- host: ubuntu-22.04
target: x86_64-unknown-linux-gnu
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
build: |
npm i -g --force corepack
corepack enable
cd packages/cli
pnpm build --target x86_64-unknown-linux-gnu
strip *.node
- host: ubuntu-20.04
- host: ubuntu-22.04
target: x86_64-unknown-linux-musl
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
build: |
@@ -65,16 +68,15 @@ jobs:
build: |
pnpm build --features native-tls-vendored --target=aarch64-apple-darwin
strip -x *.node
- host: ubuntu-20.04
- host: ubuntu-22.04
target: aarch64-unknown-linux-gnu
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
build: |
npm i -g --force corepack
corepack enable
cd packages/cli
pnpm build --target aarch64-unknown-linux-gnu
aarch64-unknown-linux-gnu-strip *.node
- host: ubuntu-20.04
- host: ubuntu-22.04
architecture: x64
target: armv7-unknown-linux-gnueabihf
setup: |
@@ -83,7 +85,7 @@ jobs:
build: |
pnpm build --target=armv7-unknown-linux-gnueabihf
arm-linux-gnueabihf-strip *.node
- host: ubuntu-20.04
- host: ubuntu-22.04
architecture: x64
target: aarch64-unknown-linux-musl
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
@@ -105,9 +107,7 @@ jobs:
runs-on: ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@v4
- run: |
npm i -g --force corepack
corepack enable
- run: npm i -g --force corepack
- name: Setup node
uses: actions/setup-node@v4
if: ${{ !matrix.settings.docker }}
@@ -120,7 +120,7 @@ jobs:
if: ${{ !matrix.settings.docker }}
with:
targets: ${{ matrix.settings.target }}
- uses: Swatinem/rust-cache@v1
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.settings.target }}
if: ${{ matrix.settings.docker }}
@@ -217,9 +217,7 @@ jobs:
runs-on: ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@v4
- run: |
npm i -g --force corepack
corepack enable
- run: npm i -g --force corepack
- name: Setup node
uses: actions/setup-node@v4
with:
@@ -250,9 +248,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
npm i -g --force corepack
corepack enable
- run: npm i -g --force corepack
- name: Setup node
uses: actions/setup-node@v4
with:
@@ -289,9 +285,7 @@ jobs:
image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
steps:
- uses: actions/checkout@v4
- run: |
npm i -g --force corepack
corepack enable
- run: npm i -g --force corepack
- name: Setup node
uses: actions/setup-node@v4
with:
@@ -329,7 +323,6 @@ jobs:
- '20'
image:
- ghcr.io/napi-rs/napi-rs/nodejs:aarch64-16
- ghcr.io/napi-rs/napi-rs/nodejs:armhf-16
runs-on: ubuntu-latest
steps:
- run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
@@ -377,18 +370,13 @@ jobs:
- test-linux-x64-gnu-binding
- test-linux-x64-musl-binding
#- test-linux-arm-bindings
permissions:
contents: write # update release
id-token: write # npm provenance
steps:
- uses: actions/checkout@v4
- run: |
npm i -g --force corepack
corepack enable
- run: npm i -g --force corepack
- name: Setup node
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: 20
node-version: 24
cache: 'pnpm'
- name: Install dependencies
run: pnpm i --frozen-lockfile --ignore-scripts
@@ -403,10 +391,8 @@ jobs:
shell: bash
- name: Publish
run: |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
npm publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.ORG_NPM_TOKEN }}
NODE_AUTH_TOKEN: ''
RELEASE_ID: ${{ github.event.client_payload.releaseId || inputs.releaseId }}
NPM_CONFIG_PROVENANCE: true

View File

@@ -18,7 +18,7 @@ jobs:
fail-fast: false
matrix:
config:
- os: ubuntu-20.04
- os: ubuntu-22.04
rust_target: x86_64-unknown-linux-gnu
ext: ''
args: ''
@@ -38,35 +38,66 @@ jobs:
rust_target: aarch64-pc-windows-msvc
ext: '.exe'
args: ''
- os: ubuntu-22.04
rust_target: riscv64gc-unknown-linux-gnu
ext: ''
args: ''
cross: true
steps:
- uses: actions/checkout@v4
- name: 'Setup Rust'
if: ${{ !matrix.config.cross }}
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.config.rust_target }}
- name: install x86_64-apple-darwin target (required by bundler CEF helper on macOS)
if: ${{ !matrix.config.cross && matrix.config.os == 'macos-latest' }}
run: rustup target add x86_64-apple-darwin
- uses: Swatinem/rust-cache@v2
if: ${{ !matrix.config.cross }}
with:
key: ${{ matrix.config.rust_target }}
- name: install Linux dependencies
if: matrix.config.os == 'ubuntu-latest'
if: ${{ !matrix.config.cross && startsWith(matrix.config.os, 'ubuntu') }}
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev
- name: Install cross
if: ${{ matrix.config.cross }}
uses: taiki-e/install-action@v2
with:
tool: cross@0.2.5
- name: Build CLI
if: ${{ !matrix.config.cross }}
run: cargo build --manifest-path ./crates/tauri-cli/Cargo.toml --profile release-size-optimized ${{ matrix.config.args }}
- name: Build CLI (cross)
if: ${{ matrix.config.cross }}
run: cross build --manifest-path ./crates/tauri-cli/Cargo.toml --target ${{ matrix.config.rust_target }} --profile release-size-optimized ${{ matrix.config.args }}
- name: Upload CLI
if: ${{ !matrix.config.cross }}
uses: actions/upload-artifact@v4
with:
name: cargo-tauri-${{ matrix.config.rust_target }}${{ matrix.config.ext }}
path: target/release-size-optimized/cargo-tauri${{ matrix.config.ext }}
if-no-files-found: error
- name: Upload CLI (cross)
if: ${{ matrix.config.cross }}
uses: actions/upload-artifact@v4
with:
name: cargo-tauri-${{ matrix.config.rust_target }}${{ matrix.config.ext }}
path: target/${{ matrix.config.rust_target }}/release-size-optimized/cargo-tauri${{ matrix.config.ext }}
if-no-files-found: error
upload:
needs: build
runs-on: ubuntu-latest

View File

@@ -33,8 +33,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: install Rust 1.77.2
uses: dtolnay/rust-toolchain@1.77.2
- name: install Rust 1.88
uses: dtolnay/rust-toolchain@1.88
- name: install x86_64-apple-darwin target (required by bundler CEF helper on macOS)
if: matrix.platform == 'macos-latest'
run: rustup target add x86_64-apple-darwin
- name: install Linux dependencies
if: matrix.platform == 'ubuntu-latest'
@@ -42,9 +46,7 @@ jobs:
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.1
- run: |
npm i -g --force corepack
corepack enable
- run: npm i -g --force corepack
- name: setup node
uses: actions/setup-node@v4
with:

View File

@@ -38,15 +38,17 @@ jobs:
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
- run: |
npm i -g --force corepack
corepack enable
- run: npm i -g --force corepack
- name: setup node
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'pnpm'
- name: install x86_64-apple-darwin target (required by bundler CEF helper on macOS)
if: matrix.platform == 'macos-latest'
run: rustup target add x86_64-apple-darwin
- name: install Linux dependencies
if: matrix.platform == 'ubuntu-latest'
run: |

View File

@@ -44,10 +44,14 @@ jobs:
- uses: actions/checkout@v4
- name: 'Setup Rust'
uses: dtolnay/rust-toolchain@1.77.2
uses: dtolnay/rust-toolchain@1.88
with:
targets: ${{ matrix.platform.target }}
- name: install x86_64-apple-darwin target (required by bundler CEF helper on macOS)
if: matrix.platform.os == 'macos-latest'
run: rustup target add x86_64-apple-darwin
- name: install Linux dependencies
if: matrix.platform.os == 'ubuntu-latest'
run: |

View File

@@ -37,41 +37,46 @@ jobs:
- {
target: x86_64-pc-windows-msvc,
os: windows-latest,
toolchain: '1.77.2',
toolchain: '1.88',
cross: false,
command: 'test'
}
- {
target: x86_64-unknown-linux-gnu,
os: ubuntu-latest,
toolchain: '1.77.2',
toolchain: '1.88',
cross: false,
command: 'test'
}
- {
target: aarch64-apple-darwin,
os: macos-14,
toolchain: '1.77.2',
toolchain: '1.88',
cross: false,
command: 'test'
}
- {
target: aarch64-apple-ios,
os: macos-latest,
toolchain: '1.77.2',
toolchain: '1.88',
cross: false,
command: 'build'
}
- {
target: aarch64-linux-android,
os: ubuntu-latest,
toolchain: '1.77.2',
toolchain: '1.88',
cross: true,
command: 'build'
}
features:
- { args: --no-default-features, key: no-default }
- { args: --all-features, key: all }
exclude:
- platform: { target: aarch64-apple-ios }
features: { key: all }
- platform: { target: aarch64-linux-android }
features: { key: all }
steps:
- uses: actions/checkout@v4
@@ -82,6 +87,10 @@ jobs:
toolchain: ${{ matrix.platform.toolchain }}
targets: ${{ matrix.platform.target }}
- name: install x86_64-apple-darwin target (required by bundler CEF helper on macOS)
if: ${{ startsWith(matrix.platform.os, 'macos-') }}
run: rustup target add x86_64-apple-darwin
- name: install Linux dependencies
if: contains(matrix.platform.target, 'unknown-linux')
run: |
@@ -90,15 +99,52 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
prefix-key: v2
key: ${{ matrix.platform.target }}
save-if: ${{ matrix.features.key == 'all' }}
- name: test
if: ${{ !matrix.platform.cross }}
run: cargo ${{ matrix.platform.command }} --target ${{ matrix.platform.target }} ${{ matrix.features.args }} --manifest-path crates/tauri/Cargo.toml
- name: Cache CEF
if: matrix.features.key == 'all'
id: cache-cef
uses: actions/cache@v5.0.3
with:
path: ~/.local/share/cef
key: cef-${{ matrix.platform.os }}-${{ hashFiles('Cargo.toml') }}
- name: test (using cross)
- name: ${{ steps.cache-cef.outputs.cache-hit && 'Use cache' || 'Export CEF' }}
if: matrix.features.key == 'all'
run: |
${{ steps.cache-cef.outputs.cache-hit && 'echo "Cached CEF"'
|| (matrix.platform.os == 'windows-latest'
&& 'cargo install export-cef-dir && export-cef-dir --version 144.0.7 "$env:USERPROFILE/.local/share/cef"'
|| 'cargo install export-cef-dir && export-cef-dir --version 144.0.7 "$HOME/.local/share/cef"')
}}
echo "CEF_PATH=${{ matrix.platform.os == 'windows-latest'
&& '$env:USERPROFILE'
|| '$HOME'
}}/.local/share/cef" >> "$${{ matrix.platform.os == 'windows-latest'
&& 'env:'
|| ''
}}GITHUB_ENV"
echo "${{ startsWith(matrix.platform.os, 'macos-')
&& 'DYLD_FALLBACK_LIBRARY_PATH=$DYLD_FALLBACK_LIBRARY_PATH:$HOME/.local/share/cef:$HOME/.local/share/cef/Chromium Embedded Framework.framework/Libraries'
|| (matrix.platform.os == 'windows-latest'
&& 'PATH=$env:PATH;$env:USERPROFILE/.local/share/cef'
|| 'LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/.local/share/cef') }}" >> "$${{ matrix.platform.os == 'windows-latest'
&& 'env:'
|| ''
}}GITHUB_ENV"
- name: test tauri-utils
if: ${{ !matrix.platform.cross }}
# Using --lib --bins --tests to skip doc tests
run: cargo ${{ matrix.platform.command }} --target ${{ matrix.platform.target }} ${{ matrix.features.args }} --lib --bins --tests --manifest-path crates/tauri-utils/Cargo.toml
- name: test tauri
if: ${{ !matrix.platform.cross }}
run: cargo ${{ matrix.features.key == 'no-default' && 'check' || matrix.platform.command }} --target ${{ matrix.platform.target }} ${{ matrix.features.args }} --manifest-path crates/tauri/Cargo.toml
- name: test tauri (using cross)
if: ${{ matrix.platform.cross }}
run: |
cargo install cross --git https://github.com/cross-rs/cross --rev ac4c11cedc97cd7c27faed36e55377a90e6ed618 --locked
cross ${{ matrix.platform.command }} --target ${{ matrix.platform.target }} ${{ matrix.features.args }} --manifest-path crates/tauri/Cargo.toml
cargo install cross --git https://github.com/cross-rs/cross --rev 51f46f296253d8122c927c5bb933e3c4f27cc317 --locked
cross ${{ matrix.features.key == 'no-default' && 'check' || matrix.platform.command }} --target ${{ matrix.platform.target }} ${{ matrix.features.args }} --manifest-path crates/tauri/Cargo.toml

109
.gitignore vendored
View File

@@ -1,54 +1,55 @@
# dependency directories
node_modules/
# Optional npm and yarn cache directory
.npm/
.yarn/
# Output of 'npm pack'
*.tgz
# dotenv environment variables file
.env
# .vscode workspace settings file
.vscode/settings.json
.vscode/launch.json
.vscode/tasks.json
# npm, yarn and bun lock files
package-lock.json
yarn.lock
bun.lockb
# rust compiled folders
target/
# test video for streaming example
streaming_example_test_video.mp4
# examples /gen directory
/examples/**/src-tauri/gen/
/bench/**/src-tauri/gen/
# logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# runtime data
pids
*.pid
*.seed
*.pid.lock
# miscellaneous
/.vs
.DS_Store
.Thumbs.db
*.sublime*
.idea
debug.log
TODO.md
# dependency directories
node_modules/
# Optional npm and yarn cache directory
.npm/
.yarn/
# Output of 'npm pack'
*.tgz
# dotenv environment variables file
.env
# .vscode workspace settings file
.vscode/settings.json
.vscode/launch.json
.vscode/tasks.json
# npm, yarn and bun lock files
package-lock.json
yarn.lock
bun.lockb
# rust compiled folders
target/
# test video for streaming example
streaming_example_test_video.mp4
# examples /gen directory
/examples/**/src-tauri/gen/
/bench/**/src-tauri/gen/
# logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# runtime data
pids
*.pid
*.seed
*.pid.lock
# miscellaneous
/.vs
.DS_Store
.Thumbs.db
*.sublime*
.idea
debug.log
TODO.md
.aider*

View File

@@ -57,7 +57,7 @@ function checkChangeFiles(changeFiles) {
for (const [file, packages] of unknownTagsEntries) {
for (const { package, tag } of packages) {
console.error(
`Package \`${package}\` has an uknown change tag ${tag} in ${file} `
`Package \`${package}\` has an unknown change tag ${tag} in ${file} `
)
}
}

View File

@@ -29,7 +29,7 @@ const ignore = [
async function checkFile(file) {
if (
extensions.some((e) => file.endsWith(e))
&& !ignore.some((i) => file.includes(`/${i}/`) || path.basename(file) == i)
&& !ignore.some((i) => file.includes(`/${i}/`) || path.basename(file) === i)
) {
const fileStream = fs.createReadStream(file)
const rl = readline.createInterface({

View File

@@ -1,16 +0,0 @@
.changes
.devcontainer
.docker
.github
.scripts
.vscode
audits
bench
packages/api
packages/cli
crates/tauri-cli
crates/tauri-bundler
crates/tauri-driver
crates/tauri-macos-sign
crates/tauri-schema-generator
crates/tests

2056
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -3,6 +3,7 @@ members = [
"crates/tauri",
"crates/tauri-runtime",
"crates/tauri-runtime-wry",
"crates/tauri-runtime-cef",
"crates/tauri-macros",
"crates/tauri-utils",
"crates/tauri-build",
@@ -42,8 +43,8 @@ homepage = "https://tauri.app/"
repository = "https://github.com/tauri-apps/tauri"
categories = ["gui", "web-programming"]
license = "Apache-2.0 OR MIT"
edition = "2021"
rust-version = "1.77.2"
edition = "2024"
rust-version = "1.88"
# default to small, optimized workspace release binaries
[profile.release]
@@ -65,9 +66,8 @@ lto = true
incremental = false
opt-level = "s"
# Temporary patch to schemars to preserve newlines in docstrings for our reference docs schemas
# See https://github.com/GREsau/schemars/issues/120 for reference
[patch.crates-io]
schemars_derive = { git = 'https://github.com/tauri-apps/schemars.git', branch = 'feat/preserve-description-newlines' }
tauri = { path = "./crates/tauri" }
tauri-plugin = { path = "./crates/tauri-plugin" }
tauri-utils = { path = "./crates/tauri-utils" }
tauri-plugin-log = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "feat/cef" }

View File

@@ -4,7 +4,7 @@
[![License](https://img.shields.io/badge/License-MIT%20or%20Apache%202-green.svg)](https://opencollective.com/tauri)
[![test core](https://img.shields.io/github/actions/workflow/status/tauri-apps/tauri/test-core.yml?label=test%20core&logo=github)](https://github.com/tauri-apps/tauri/actions/workflows/test-core.yml)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Ftauri-apps%2Ftauri.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Ftauri-apps%2Ftauri?ref=badge_shield)
[![Chat Server](https://img.shields.io/badge/chat-discord-7289da.svg)](https://discord.gg/SpmNs4S)
[![Chat Server](https://img.shields.io/badge/chat-discord-7289da.svg)](https://discord.com/invite/tauri)
[![website](https://img.shields.io/badge/website-tauri.app-purple.svg)](https://tauri.app)
[![https://good-labs.github.io/greater-good-affirmation/assets/images/badge.svg](https://good-labs.github.io/greater-good-affirmation/assets/images/badge.svg)](https://good-labs.github.io/greater-good-affirmation)
[![support](https://img.shields.io/badge/sponsor-Open%20Collective-blue.svg)](https://opencollective.com/tauri)
@@ -81,7 +81,7 @@ For the complete list of sponsors please visit our [website](https://tauri.app#s
## Organization
Tauri aims to be a sustainable collective based on principles that guide [sustainable free and open software communities](https://sfosc.org). To this end it has become a Programme within the [Commons Conservancy](https://commonsconservancy.org/), and you can contribute financially via [Open Collective](https://opencollective.com/tauri).
Tauri aims to be a sustainable collective based on principles that guide sustainable free and open software communities. To this end it has become a Programme within the [Commons Conservancy](https://commonsconservancy.org/), and you can contribute financially via [Open Collective](https://opencollective.com/tauri).
## Licenses

View File

@@ -2,8 +2,8 @@
name = "tauri_bench"
version = "0.1.0"
authors = ["Tauri Programme within The Commons Conservancy"]
edition = "2021"
rust-version = "1.77.2"
edition = "2024"
rust-version = "1.88"
license = "Apache-2.0 OR MIT"
description = "Cross-platform WebView rendering library"
repository = "https://github.com/tauri-apps/wry"

View File

@@ -10,6 +10,8 @@
html_logo_url = "https://github.com/tauri-apps/tauri/raw/dev/.github/icon.png",
html_favicon_url = "https://github.com/tauri-apps/tauri/raw/dev/.github/icon.png"
)]
// file is used by multiple binaries
#![allow(dead_code)]
use std::{fs::File, io::BufReader};
mod utils;
@@ -52,7 +54,7 @@ fn main() {
.expect("Something wrong with tauri_data"),
&serde_json::to_value(all_data).expect("Unable to build final json (all)"),
)
.unwrap_or_else(|_| panic!("Unable to write {:?}", tauri_data));
.unwrap_or_else(|_| panic!("Unable to write {tauri_data:?}"));
utils::write_json(
tauri_recent
@@ -60,5 +62,5 @@ fn main() {
.expect("Something wrong with tauri_recent"),
&serde_json::to_value(recent).expect("Unable to build final json (recent)"),
)
.unwrap_or_else(|_| panic!("Unable to write {:?}", tauri_recent));
.unwrap_or_else(|_| panic!("Unable to write {tauri_recent:?}"));
}

View File

@@ -2,16 +2,17 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
//! This Rust binary runs on CI and provides internal metrics results of Tauri. To learn more see [benchmark_results](https://github.com/tauri-apps/benchmark_results) repository.
//! This Rust binary runs on CI and provides internal metrics results of Tauri.
//! To learn more see [benchmark_results](https://github.com/tauri-apps/benchmark_results) repository.
//!
//! ***_Internal use only_**
//! ***_Internal use only_***
#![doc(
html_logo_url = "https://github.com/tauri-apps/tauri/raw/dev/.github/icon.png",
html_favicon_url = "https://github.com/tauri-apps/tauri/raw/dev/.github/icon.png"
)]
use anyhow::Result;
use anyhow::{Context, Result};
use std::{
collections::{HashMap, HashSet},
env,
@@ -21,62 +22,66 @@ use std::{
mod utils;
/// The list of the examples of the benchmark name and binary relative path
fn get_all_benchmarks() -> Vec<(String, String)> {
/// The list of examples for benchmarks
fn get_all_benchmarks(target: &str) -> Vec<(String, String)> {
vec![
(
"tauri_hello_world".into(),
format!("../target/{}/release/bench_helloworld", utils::get_target()),
format!("../target/{target}/release/bench_helloworld"),
),
(
"tauri_cpu_intensive".into(),
format!(
"../target/{}/release/bench_cpu_intensive",
utils::get_target()
),
format!("../target/{target}/release/bench_cpu_intensive"),
),
(
"tauri_3mb_transfer".into(),
format!(
"../target/{}/release/bench_files_transfer",
utils::get_target()
),
format!("../target/{target}/release/bench_files_transfer"),
),
]
}
fn run_strace_benchmarks(new_data: &mut utils::BenchResult) -> Result<()> {
fn run_strace_benchmarks(new_data: &mut utils::BenchResult, target: &str) -> Result<()> {
use std::io::Read;
let mut thread_count = HashMap::<String, u64>::new();
let mut syscall_count = HashMap::<String, u64>::new();
for (name, example_exe) in get_all_benchmarks() {
let mut file = tempfile::NamedTempFile::new()?;
for (name, example_exe) in get_all_benchmarks(target) {
let mut file = tempfile::NamedTempFile::new()
.context("failed to create temporary file for strace output")?;
let exe_path = utils::bench_root_path().join(&example_exe);
let exe_path_str = exe_path
.to_str()
.context("executable path contains invalid UTF-8")?;
let temp_path_str = file
.path()
.to_str()
.context("temporary file path contains invalid UTF-8")?;
Command::new("strace")
.args([
"-c",
"-f",
"-o",
file.path().to_str().unwrap(),
utils::bench_root_path().join(example_exe).to_str().unwrap(),
])
.args(["-c", "-f", "-o", temp_path_str, exe_path_str])
.stdout(Stdio::inherit())
.spawn()?
.wait()?;
.spawn()
.context("failed to spawn strace process")?
.wait()
.context("failed to wait for strace process")?;
let mut output = String::new();
file.as_file_mut().read_to_string(&mut output)?;
file
.as_file_mut()
.read_to_string(&mut output)
.context("failed to read strace output")?;
let strace_result = utils::parse_strace_output(&output);
// Note, we always have 1 thread. Use cloneX calls as counter for additional threads created.
let clone = 1
+ strace_result.get("clone").map(|d| d.calls).unwrap_or(0)
// Count clone/clone3 syscalls as thread creation indicators
let clone_calls = strace_result.get("clone").map(|d| d.calls).unwrap_or(0)
+ strace_result.get("clone3").map(|d| d.calls).unwrap_or(0);
let total = strace_result.get("total").unwrap().calls;
thread_count.insert(name.to_string(), clone);
syscall_count.insert(name.to_string(), total);
if let Some(total) = strace_result.get("total") {
thread_count.insert(name.clone(), clone_calls);
syscall_count.insert(name, total.calls);
}
}
new_data.thread_count = thread_count;
@@ -85,70 +90,100 @@ fn run_strace_benchmarks(new_data: &mut utils::BenchResult) -> Result<()> {
Ok(())
}
fn run_max_mem_benchmark() -> Result<HashMap<String, u64>> {
fn run_max_mem_benchmark(target: &str) -> Result<HashMap<String, u64>> {
let mut results = HashMap::<String, u64>::new();
for (name, example_exe) in get_all_benchmarks() {
let benchmark_file = utils::target_dir().join(format!("mprof{}_.dat", name));
let benchmark_file = benchmark_file.to_str().unwrap();
for (name, example_exe) in get_all_benchmarks(target) {
let benchmark_file = utils::target_dir().join(format!("mprof{name}_.dat"));
let benchmark_file_str = benchmark_file
.to_str()
.context("benchmark file path contains invalid UTF-8")?;
let exe_path = utils::bench_root_path().join(&example_exe);
let exe_path_str = exe_path
.to_str()
.context("executable path contains invalid UTF-8")?;
let proc = Command::new("mprof")
.args([
"run",
"-C",
"-o",
benchmark_file,
utils::bench_root_path().join(example_exe).to_str().unwrap(),
])
.args(["run", "-C", "-o", benchmark_file_str, exe_path_str])
.stdout(Stdio::null())
.stderr(Stdio::piped())
.spawn()?;
.spawn()
.with_context(|| format!("failed to spawn mprof for benchmark {name}"))?;
let proc_result = proc.wait_with_output()?;
println!("{:?}", proc_result);
results.insert(
name.to_string(),
utils::parse_max_mem(benchmark_file).unwrap(),
);
let proc_result = proc
.wait_with_output()
.with_context(|| format!("failed to wait for mprof {name}"))?;
if !proc_result.status.success() {
eprintln!(
"mprof failed for {name}: {}",
String::from_utf8_lossy(&proc_result.stderr)
);
}
if let Some(mem) = utils::parse_max_mem(benchmark_file_str)
.with_context(|| format!("failed to parse mprof data for {name}"))?
{
results.insert(name, mem);
}
// Clean up the temporary file
if let Err(e) = std::fs::remove_file(&benchmark_file) {
eprintln!("Warning: failed to remove temporary file {benchmark_file_str}: {e}");
}
}
Ok(results)
}
fn rlib_size(target_dir: &std::path::Path, prefix: &str) -> u64 {
fn rlib_size(target_dir: &Path, prefix: &str) -> Result<u64> {
let mut size = 0;
let mut seen = std::collections::HashSet::new();
let mut seen = HashSet::new();
for entry in std::fs::read_dir(target_dir.join("deps")).unwrap() {
let entry = entry.unwrap();
let os_str = entry.file_name();
let name = os_str.to_str().unwrap();
if name.starts_with(prefix) && name.ends_with(".rlib") {
let start = name.split('-').next().unwrap().to_string();
if seen.contains(&start) {
println!("skip {}", name);
} else {
seen.insert(start);
size += entry.metadata().unwrap().len();
println!("check size {} {}", name, size);
}
let deps_dir = target_dir.join("deps");
for entry in std::fs::read_dir(&deps_dir).with_context(|| {
format!(
"failed to read target deps directory: {}",
deps_dir.display()
)
})? {
let entry = entry.context("failed to read directory entry")?;
let name = entry.file_name().to_string_lossy().to_string();
if name.starts_with(prefix)
&& name.ends_with(".rlib")
&& let Some(start) = name.split('-').next()
&& seen.insert(start.to_string())
{
size += entry
.metadata()
.context("failed to read file metadata")?
.len();
}
}
assert!(size > 0);
size
if size == 0 {
anyhow::bail!(
"no rlib files found for prefix {prefix} in {}",
deps_dir.display()
);
}
Ok(size)
}
fn get_binary_sizes(target_dir: &Path) -> Result<HashMap<String, u64>> {
fn get_binary_sizes(target_dir: &Path, target: &str) -> Result<HashMap<String, u64>> {
let mut sizes = HashMap::<String, u64>::new();
let wry_size = rlib_size(target_dir, "libwry");
println!("wry {} bytes", wry_size);
let wry_size = rlib_size(target_dir, "libwry")?;
sizes.insert("wry_rlib".to_string(), wry_size);
// add size for all EXEC_TIME_BENCHMARKS
for (name, example_exe) in get_all_benchmarks() {
let meta = std::fs::metadata(example_exe).unwrap();
sizes.insert(name.to_string(), meta.len());
for (name, example_exe) in get_all_benchmarks(target) {
let exe_path = utils::bench_root_path().join(&example_exe);
let meta = std::fs::metadata(&exe_path)
.with_context(|| format!("failed to read metadata for {}", exe_path.display()))?;
sizes.insert(name, meta.len());
}
Ok(sizes)
@@ -188,14 +223,33 @@ fn cargo_deps() -> HashMap<String, usize> {
cmd.args(["--target", target]);
cmd.current_dir(utils::tauri_root_path());
let full_deps = cmd.output().expect("failed to run cargo tree").stdout;
let full_deps = String::from_utf8(full_deps).expect("cargo tree output not utf-8");
let count = full_deps.lines().collect::<HashSet<_>>().len() - 1; // output includes wry itself
match cmd.output() {
Ok(output) if output.status.success() => {
let full_deps = String::from_utf8_lossy(&output.stdout);
let count = full_deps
.lines()
.collect::<HashSet<_>>()
.len()
.saturating_sub(1); // output includes wry itself
// set the count to the highest count seen for this OS
let existing = results.entry(os.to_string()).or_default();
*existing = count.max(*existing);
assert!(count > 10); // sanity check
// set the count to the highest count seen for this OS
let existing = results.entry(os.to_string()).or_default();
*existing = count.max(*existing);
if count <= 10 {
eprintln!("Warning: dependency count for {target} seems low: {count}");
}
}
Ok(output) => {
eprintln!(
"cargo tree failed for {target}: {}",
String::from_utf8_lossy(&output.stderr)
);
}
Err(e) => {
eprintln!("Failed to run cargo tree for {target}: {e}");
}
}
}
}
results
@@ -203,104 +257,127 @@ fn cargo_deps() -> HashMap<String, usize> {
const RESULT_KEYS: &[&str] = &["mean", "stddev", "user", "system", "min", "max"];
fn run_exec_time(target_dir: &Path) -> Result<HashMap<String, HashMap<String, f64>>> {
fn run_exec_time(target: &str) -> Result<HashMap<String, HashMap<String, f64>>> {
let target_dir = utils::target_dir();
let benchmark_file = target_dir.join("hyperfine_results.json");
let benchmark_file = benchmark_file.to_str().unwrap();
let benchmark_file_str = benchmark_file
.to_str()
.context("benchmark file path contains invalid UTF-8")?;
let mut command = [
let mut command = vec![
"hyperfine",
"--export-json",
benchmark_file,
benchmark_file_str,
"--show-output",
"--warmup",
"3",
]
.iter()
.map(|s| s.to_string())
.collect::<Vec<_>>();
];
for (_, example_exe) in get_all_benchmarks() {
command.push(
utils::bench_root_path()
.join(example_exe)
.to_str()
.unwrap()
.to_string(),
);
let benchmarks = get_all_benchmarks(target);
let mut benchmark_paths = Vec::new();
for (_, example_exe) in &benchmarks {
let exe_path = utils::bench_root_path().join(example_exe);
let exe_path_str = exe_path
.to_str()
.context("executable path contains invalid UTF-8")?;
benchmark_paths.push(exe_path_str.to_string());
}
utils::run(&command.iter().map(|s| s.as_ref()).collect::<Vec<_>>());
for path in &benchmark_paths {
command.push(path.as_str());
}
utils::run(&command)?;
let mut results = HashMap::<String, HashMap<String, f64>>::new();
let hyperfine_results = utils::read_json(benchmark_file)?;
for ((name, _), data) in get_all_benchmarks().iter().zip(
hyperfine_results
.as_object()
.unwrap()
.get("results")
.unwrap()
.as_array()
.unwrap(),
) {
let data = data.as_object().unwrap().clone();
results.insert(
name.to_string(),
data
.into_iter()
.filter(|(key, _)| RESULT_KEYS.contains(&key.as_str()))
.map(|(key, val)| (key, val.as_f64().unwrap()))
.collect(),
);
let hyperfine_results = utils::read_json(benchmark_file_str)?;
if let Some(results_array) = hyperfine_results
.as_object()
.and_then(|obj| obj.get("results"))
.and_then(|val| val.as_array())
{
for ((name, _), data) in benchmarks.iter().zip(results_array.iter()) {
if let Some(data_obj) = data.as_object() {
let filtered_data: HashMap<String, f64> = data_obj
.iter()
.filter(|(key, _)| RESULT_KEYS.contains(&key.as_str()))
.filter_map(|(key, val)| val.as_f64().map(|v| (key.clone(), v)))
.collect();
results.insert(name.clone(), filtered_data);
}
}
}
Ok(results)
}
fn main() -> Result<()> {
// download big files if not present
let json_3mb = utils::home_path().join(".tauri_3mb.json");
if !json_3mb.exists() {
println!("Downloading test data...");
utils::download_file(
"https://github.com/lemarier/tauri-test/releases/download/v2.0.0/json_3mb.json",
json_3mb,
);
)
.context("failed to download test data")?;
}
println!("Starting tauri benchmark");
let target_dir = utils::target_dir();
let target = utils::get_target();
env::set_current_dir(utils::bench_root_path())?;
env::set_current_dir(utils::bench_root_path())
.context("failed to set working directory to bench root")?;
let now = std::time::SystemTime::now()
.duration_since(std::time::UNIX_EPOCH)
.context("failed to get current time")?;
let timestamp = format!("{}", now.as_secs());
println!("Running execution time benchmarks...");
let exec_time = run_exec_time(target)?;
println!("Getting binary sizes...");
let binary_size = get_binary_sizes(&target_dir, target)?;
println!("Analyzing cargo dependencies...");
let cargo_deps = cargo_deps();
let format =
time::format_description::parse("[year]-[month]-[day]T[hour]:[minute]:[second]Z").unwrap();
let now = time::OffsetDateTime::now_utc();
let mut new_data = utils::BenchResult {
created_at: now.format(&format).unwrap(),
sha1: utils::run_collect(&["git", "rev-parse", "HEAD"])
.0
.trim()
.to_string(),
exec_time: run_exec_time(&target_dir)?,
binary_size: get_binary_sizes(&target_dir)?,
cargo_deps: cargo_deps(),
created_at: timestamp,
sha1: {
let output = utils::run_collect(&["git", "rev-parse", "HEAD"])?;
output.0.trim().to_string()
},
exec_time,
binary_size,
cargo_deps,
..Default::default()
};
if cfg!(target_os = "linux") {
run_strace_benchmarks(&mut new_data)?;
new_data.max_memory = run_max_mem_benchmark()?;
println!("Running Linux-specific benchmarks...");
run_strace_benchmarks(&mut new_data, target)?;
new_data.max_memory = run_max_mem_benchmark(target)?;
}
println!("===== <BENCHMARK RESULTS>");
serde_json::to_writer_pretty(std::io::stdout(), &new_data)?;
serde_json::to_writer_pretty(std::io::stdout(), &new_data)
.context("failed to serialize benchmark results")?;
println!("\n===== </BENCHMARK RESULTS>");
if let Some(filename) = target_dir.join("bench.json").to_str() {
utils::write_json(filename, &serde_json::to_value(&new_data)?)?;
let bench_file = target_dir.join("bench.json");
if let Some(filename) = bench_file.to_str() {
utils::write_json(filename, &serde_json::to_value(&new_data)?)
.context("failed to write benchmark results to file")?;
println!("Results written to: {filename}");
} else {
eprintln!("Cannot write bench.json, path is invalid");
eprintln!("Cannot write bench.json, path contains invalid UTF-8");
}
Ok(())

View File

@@ -2,7 +2,16 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
use anyhow::Result;
//! Utility functions for benchmarking tasks in the Tauri project.
//!
//! This module provides helpers for:
//! - Paths to project directories and targets
//! - Running and collecting process outputs
//! - Parsing memory profiler (`mprof`) and syscall profiler (`strace`) outputs
//! - JSON read/write utilities
//! - File download utilities (via `curl` or file copy)
use anyhow::{Context, Result, bail};
use serde::{Deserialize, Serialize};
use serde_json::Value;
use std::{
@@ -13,6 +22,7 @@ use std::{
process::{Command, Output, Stdio},
};
/// Holds the results of a benchmark run.
#[derive(Default, Clone, Serialize, Deserialize, Debug)]
pub struct BenchResult {
pub created_at: String,
@@ -25,7 +35,7 @@ pub struct BenchResult {
pub cargo_deps: HashMap<String, usize>,
}
#[allow(dead_code)]
/// Represents a single line of parsed `strace` output.
#[derive(Debug, Clone, Serialize)]
pub struct StraceOutput {
pub percent_time: f64,
@@ -35,6 +45,7 @@ pub struct StraceOutput {
pub errors: u64,
}
/// Get the compilation target triple for the current platform.
pub fn get_target() -> &'static str {
#[cfg(target_os = "macos")]
return if cfg!(target_arch = "aarch64") {
@@ -42,18 +53,22 @@ pub fn get_target() -> &'static str {
} else {
"x86_64-apple-darwin"
};
#[cfg(target_os = "ios")]
return if cfg!(target_arch = "aarch64") {
"aarch64-apple-ios"
} else {
"x86_64-apple-ios"
};
#[cfg(target_os = "linux")]
return "x86_64-unknown-linux-gnu";
#[cfg(target_os = "windows")]
unimplemented!();
unimplemented!("Windows target not implemented yet");
}
/// Get the `target/release` directory path for benchmarks.
pub fn target_dir() -> PathBuf {
bench_root_path()
.join("..")
@@ -62,83 +77,90 @@ pub fn target_dir() -> PathBuf {
.join("release")
}
/// Get the root path of the current benchmark crate.
pub fn bench_root_path() -> PathBuf {
PathBuf::from(env!("CARGO_MANIFEST_DIR"))
}
#[allow(dead_code)]
/// Get the home directory of the current user.
pub fn home_path() -> PathBuf {
#[cfg(any(target_os = "macos", target_os = "ios", target_os = "linux"))]
return PathBuf::from(env!("HOME"));
{
PathBuf::from(std::env::var("HOME").unwrap_or_default())
}
#[cfg(target_os = "windows")]
return PathBuf::from(env!("HOMEPATH"));
{
PathBuf::from(std::env::var("USERPROFILE").unwrap_or_default())
}
}
#[allow(dead_code)]
/// Get the root path of the Tauri repository.
pub fn tauri_root_path() -> PathBuf {
bench_root_path().parent().unwrap().to_path_buf()
bench_root_path().parent().map(|p| p.to_path_buf()).unwrap()
}
#[allow(dead_code)]
pub fn run_collect(cmd: &[&str]) -> (String, String) {
let mut process_builder = Command::new(cmd[0]);
process_builder
/// Run a command and collect its stdout and stderr as strings.
/// Returns an error if the command fails or exits with a non-zero status.
pub fn run_collect(cmd: &[&str]) -> Result<(String, String)> {
let output: Output = Command::new(cmd[0])
.args(&cmd[1..])
.stdin(Stdio::piped())
.stdout(Stdio::piped())
.stderr(Stdio::piped());
let prog = process_builder.spawn().expect("failed to spawn script");
let Output {
stdout,
stderr,
status,
} = prog.wait_with_output().expect("failed to wait on child");
let stdout = String::from_utf8_lossy(&stdout).to_string();
let stderr = String::from_utf8_lossy(&stderr).to_string();
if !status.success() {
eprintln!("stdout: <<<{}>>>", stdout);
eprintln!("stderr: <<<{}>>>", stderr);
panic!("Unexpected exit code: {:?}", status.code());
.stderr(Stdio::piped())
.output()
.with_context(|| format!("failed to execute command: {cmd:?}"))?;
if !output.status.success() {
bail!(
"Command {:?} exited with {:?}\nstdout:\n{}\nstderr:\n{}",
cmd,
output.status.code(),
String::from_utf8_lossy(&output.stdout),
String::from_utf8_lossy(&output.stderr)
);
}
(stdout, stderr)
Ok((
String::from_utf8_lossy(&output.stdout).to_string(),
String::from_utf8_lossy(&output.stderr).to_string(),
))
}
#[allow(dead_code)]
pub fn parse_max_mem(file_path: &str) -> Option<u64> {
let file = fs::File::open(file_path).unwrap();
/// Parse a memory profiler (`mprof`) output file and return the maximum
/// memory usage in bytes. Returns `None` if no values are found.
pub fn parse_max_mem(file_path: &str) -> Result<Option<u64>> {
let file = fs::File::open(file_path)
.with_context(|| format!("failed to open mprof output file {file_path}"))?;
let output = BufReader::new(file);
let mut highest: u64 = 0;
// MEM 203.437500 1621617192.4123
for line in output.lines().map_while(Result::ok) {
// split line by space
let split = line.split(' ').collect::<Vec<_>>();
if split.len() == 3 {
// mprof generate result in MB
let current_bytes = str::parse::<f64>(split[1]).unwrap() as u64 * 1024 * 1024;
if current_bytes > highest {
highest = current_bytes;
}
let split: Vec<&str> = line.split(' ').collect();
if split.len() == 3
&& let Ok(mb) = split[1].parse::<f64>()
{
let current_bytes = (mb * 1024.0 * 1024.0) as u64;
highest = highest.max(current_bytes);
}
}
fs::remove_file(file_path).unwrap();
// Best-effort cleanup
let _ = fs::remove_file(file_path);
if highest > 0 {
return Some(highest);
}
None
Ok(if highest > 0 { Some(highest) } else { None })
}
#[allow(dead_code)]
/// Parse the output of `strace -c` and return a summary of syscalls.
pub fn parse_strace_output(output: &str) -> HashMap<String, StraceOutput> {
let mut summary = HashMap::new();
let mut lines = output
.lines()
.filter(|line| !line.is_empty() && !line.contains("detached ..."));
let count = lines.clone().count();
let count = lines.clone().count();
if count < 4 {
return summary;
}
@@ -148,89 +170,91 @@ pub fn parse_strace_output(output: &str) -> HashMap<String, StraceOutput> {
let data_lines = lines.skip(2);
for line in data_lines {
let syscall_fields = line.split_whitespace().collect::<Vec<_>>();
let syscall_fields: Vec<&str> = line.split_whitespace().collect();
let len = syscall_fields.len();
let syscall_name = syscall_fields.last().unwrap();
if (5..=6).contains(&len) {
summary.insert(
syscall_name.to_string(),
StraceOutput {
percent_time: str::parse::<f64>(syscall_fields[0]).unwrap(),
seconds: str::parse::<f64>(syscall_fields[1]).unwrap(),
usecs_per_call: Some(str::parse::<u64>(syscall_fields[2]).unwrap()),
calls: str::parse::<u64>(syscall_fields[3]).unwrap(),
errors: if syscall_fields.len() < 6 {
0
} else {
str::parse::<u64>(syscall_fields[4]).unwrap()
},
if let Some(&syscall_name) = syscall_fields.last()
&& (5..=6).contains(&len)
{
let output = StraceOutput {
percent_time: syscall_fields[0].parse().unwrap_or(0.0),
seconds: syscall_fields[1].parse().unwrap_or(0.0),
usecs_per_call: syscall_fields[2].parse().ok(),
calls: syscall_fields[3].parse().unwrap_or(0),
errors: if len < 6 {
0
} else {
syscall_fields[4].parse().unwrap_or(0)
},
);
};
summary.insert(syscall_name.to_string(), output);
}
}
let total_fields = total_line.split_whitespace().collect::<Vec<_>>();
summary.insert(
"total".to_string(),
match total_fields.len() {
// Old format, has no usecs/call
5 => StraceOutput {
percent_time: str::parse::<f64>(total_fields[0]).unwrap(),
seconds: str::parse::<f64>(total_fields[1]).unwrap(),
usecs_per_call: None,
calls: str::parse::<u64>(total_fields[2]).unwrap(),
errors: str::parse::<u64>(total_fields[3]).unwrap(),
},
6 => StraceOutput {
percent_time: str::parse::<f64>(total_fields[0]).unwrap(),
seconds: str::parse::<f64>(total_fields[1]).unwrap(),
usecs_per_call: Some(str::parse::<u64>(total_fields[2]).unwrap()),
calls: str::parse::<u64>(total_fields[3]).unwrap(),
errors: str::parse::<u64>(total_fields[4]).unwrap(),
},
_ => panic!("Unexpected total field count: {}", total_fields.len()),
let total_fields: Vec<&str> = total_line.split_whitespace().collect();
let total = match total_fields.len() {
5 => StraceOutput {
percent_time: total_fields[0].parse().unwrap_or(0.0),
seconds: total_fields[1].parse().unwrap_or(0.0),
usecs_per_call: None,
calls: total_fields[2].parse().unwrap_or(0),
errors: total_fields[3].parse().unwrap_or(0),
},
);
6 => StraceOutput {
percent_time: total_fields[0].parse().unwrap_or(0.0),
seconds: total_fields[1].parse().unwrap_or(0.0),
usecs_per_call: total_fields[2].parse().ok(),
calls: total_fields[3].parse().unwrap_or(0),
errors: total_fields[4].parse().unwrap_or(0),
},
_ => {
panic!("Unexpected total field count: {}", total_fields.len());
}
};
summary.insert("total".to_string(), total);
summary
}
#[allow(dead_code)]
pub fn run(cmd: &[&str]) {
let mut process_builder = Command::new(cmd[0]);
process_builder.args(&cmd[1..]).stdin(Stdio::piped());
let mut prog = process_builder.spawn().expect("failed to spawn script");
let status = prog.wait().expect("failed to wait on child");
/// Run a command and wait for completion.
/// Returns an error if the command fails.
pub fn run(cmd: &[&str]) -> Result<()> {
let status = Command::new(cmd[0])
.args(&cmd[1..])
.stdin(Stdio::piped())
.status()
.with_context(|| format!("failed to execute command: {cmd:?}"))?;
if !status.success() {
panic!("Unexpected exit code: {:?}", status.code());
bail!("Command {:?} exited with {:?}", cmd, status.code());
}
Ok(())
}
#[allow(dead_code)]
/// Read a JSON file into a [`serde_json::Value`].
pub fn read_json(filename: &str) -> Result<Value> {
let f = fs::File::open(filename)?;
let f =
fs::File::open(filename).with_context(|| format!("failed to open JSON file {filename}"))?;
Ok(serde_json::from_reader(f)?)
}
#[allow(dead_code)]
/// Write a [`serde_json::Value`] into a JSON file.
pub fn write_json(filename: &str, value: &Value) -> Result<()> {
let f = fs::File::create(filename)?;
let f =
fs::File::create(filename).with_context(|| format!("failed to create JSON file {filename}"))?;
serde_json::to_writer(f, value)?;
Ok(())
}
#[allow(dead_code)]
pub fn download_file(url: &str, filename: PathBuf) {
/// Download a file from either a local path or an HTTP/HTTPS URL.
/// Falls back to copying the file if the URL does not start with http/https.
pub fn download_file(url: &str, filename: PathBuf) -> Result<()> {
if !url.starts_with("http:") && !url.starts_with("https:") {
fs::copy(url, filename).unwrap();
return;
fs::copy(url, &filename).with_context(|| format!("failed to copy from {url}"))?;
return Ok(());
}
// Downloading with curl this saves us from adding
// a Rust HTTP client dependency.
println!("Downloading {}", url);
println!("Downloading {url}");
let status = Command::new("curl")
.arg("-L")
.arg("-s")
@@ -238,8 +262,14 @@ pub fn download_file(url: &str, filename: PathBuf) {
.arg(&filename)
.arg(url)
.status()
.unwrap();
.with_context(|| format!("failed to execute curl for {url}"))?;
assert!(status.success());
assert!(filename.exists());
if !status.success() {
bail!("curl failed with exit code {:?}", status.code());
}
if !filename.exists() {
bail!("expected file {:?} to exist after download", filename);
}
Ok(())
}

View File

@@ -2,8 +2,8 @@
name = "bench_cpu_intensive"
version = "0.1.0"
description = "A very simple Tauri Application"
edition = "2021"
rust-version = "1.77.2"
edition = "2024"
rust-version = "1.88"
[build-dependencies]
tauri-build = { path = "../../../../crates/tauri-build", features = [
@@ -14,3 +14,7 @@ tauri-build = { path = "../../../../crates/tauri-build", features = [
serde_json = "1"
serde = { version = "1", features = ["derive"] }
tauri = { path = "../../../../crates/tauri", features = [] }
[features]
cef = ["tauri/cef"]
wry = ["tauri/wry"]

View File

@@ -9,8 +9,14 @@ fn app_completed_successfully() {
std::process::exit(0);
}
#[cfg_attr(feature = "cef", tauri::cef_entry_point)]
fn main() {
tauri::Builder::default()
#[cfg(feature = "cef")]
let builder = tauri::Builder::<tauri::Cef>::default();
#[cfg(not(feature = "cef"))]
let builder = tauri::Builder::<tauri::Wry>::default();
builder
.invoke_handler(tauri::generate_handler![app_completed_successfully])
.run(tauri::generate_context!())
.expect("error while running tauri application");

View File

@@ -2,8 +2,8 @@
name = "bench_files_transfer"
version = "0.1.0"
description = "A very simple Tauri Application"
edition = "2021"
rust-version = "1.77.2"
edition = "2024"
rust-version = "1.88"
[build-dependencies]
tauri-build = { path = "../../../../crates/tauri-build", features = [
@@ -14,3 +14,7 @@ tauri-build = { path = "../../../../crates/tauri-build", features = [
serde_json = "1"
serde = { version = "1", features = ["derive"] }
tauri = { path = "../../../../crates/tauri", features = [] }
[features]
cef = ["tauri/cef"]
wry = ["tauri/wry"]

View File

@@ -5,7 +5,7 @@
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
use std::fs::read;
use tauri::{command, ipc::Response, path::BaseDirectory, AppHandle, Manager, Runtime};
use tauri::{AppHandle, Manager, Runtime, command, ipc::Response, path::BaseDirectory};
#[command]
fn app_should_close(exit_code: i32) {
@@ -22,8 +22,14 @@ async fn read_file<R: Runtime>(app: AppHandle<R>) -> Result<Response, String> {
Ok(Response::new(contents))
}
#[cfg_attr(feature = "cef", tauri::cef_entry_point)]
fn main() {
tauri::Builder::default()
#[cfg(feature = "cef")]
let builder = tauri::Builder::<tauri::Cef>::default();
#[cfg(not(feature = "cef"))]
let builder = tauri::Builder::<tauri::Wry>::new();
builder
.invoke_handler(tauri::generate_handler![app_should_close, read_file])
.run(tauri::generate_context!())
.expect("error while running tauri application");

View File

@@ -2,8 +2,8 @@
name = "bench_helloworld"
version = "0.1.0"
description = "A very simple Tauri Application"
edition = "2021"
rust-version = "1.77.2"
edition = "2024"
rust-version = "1.88"
[build-dependencies]
tauri-build = { path = "../../../../crates/tauri-build", features = [
@@ -14,3 +14,7 @@ tauri-build = { path = "../../../../crates/tauri-build", features = [
serde_json = "1"
serde = { version = "1", features = ["derive"] }
tauri = { path = "../../../../crates/tauri", features = [] }
[features]
cef = ["tauri/cef"]
wry = ["tauri/wry"]

View File

@@ -9,8 +9,14 @@ fn app_loaded_successfully() {
std::process::exit(0);
}
#[cfg_attr(feature = "cef", tauri::cef_entry_point)]
fn main() {
tauri::Builder::default()
#[cfg(feature = "cef")]
let builder = tauri::Builder::<tauri::Cef>::default();
#[cfg(not(feature = "cef"))]
let builder = tauri::Builder::<tauri::Wry>::new();
builder
.invoke_handler(tauri::generate_handler![app_loaded_successfully])
.run(tauri::generate_context!())
.expect("error while running tauri application");

19
cef-helper/Cargo.toml Normal file
View File

@@ -0,0 +1,19 @@
[package]
name = "tauri-cef-helper"
version = "0.1.0"
edition = "2024"
license = "Apache-2.0 OR MIT"
publish = false
[dependencies]
cef = { version = "=146.4.1", default-features = false }
# Not actually used directly, just locking it.
cef-dll-sys = { version = "=146.4.1", default-features = false }
[features]
default = ["sandbox"]
# Mirrors `tauri-runtime-cef` default feature to enable CEF sandbox support on macOS.
sandbox = ["cef/sandbox"]
# Ensure this crate is NOT treated as part of the repo workspace.
[workspace]

27
cef-helper/src/main.rs Normal file
View File

@@ -0,0 +1,27 @@
use cef::{args::Args, *};
fn main() {
let args = Args::new();
#[cfg(all(target_os = "macos", feature = "sandbox"))]
let _sandbox = {
let mut sandbox = cef::sandbox::Sandbox::new();
sandbox.initialize(args.as_main_args());
sandbox
};
#[cfg(target_os = "macos")]
let _loader = {
let loader = library_loader::LibraryLoader::new(&std::env::current_exe().unwrap(), true);
assert!(loader.load());
loader
};
execute_process(
Some(args.as_main_args()),
None::<&mut App>,
std::ptr::null_mut(),
);
}

View File

@@ -1,5 +1,101 @@
# Changelog
## \[2.5.6]
### Dependencies
- Upgraded to `tauri-utils@2.8.3`
- Upgraded to `tauri-codegen@2.5.5`
## \[2.5.5]
### Dependencies
- Upgraded to `tauri-codegen@2.5.4`
## \[2.5.4]
### Enhancements
- [`2d28e3143`](https://www.github.com/tauri-apps/tauri/commit/2d28e3143ee3d97d7570ea03877aa00a0d6e47d0) ([#14632](https://www.github.com/tauri-apps/tauri/pull/14632) by [@sftse](https://www.github.com/tauri-apps/tauri/../../sftse)) Small code refactors for improved code readability. No user facing changes.
### Dependencies
- Upgraded to `tauri-utils@2.8.2`
- Upgraded to `tauri-codegen@2.5.3`
## \[2.5.3]
### Dependencies
- Upgraded to `tauri-utils@2.8.1`
- Upgraded to `tauri-codegen@2.5.2`
## \[2.5.2]
### Dependencies
- Upgraded to `tauri-codegen@2.5.1`
## \[2.5.1]
### Bug Fixes
- [`4b6b8690a`](https://www.github.com/tauri-apps/tauri/commit/4b6b8690ab886ebdf1307951cffbe03e31280baa) ([#14347](https://www.github.com/tauri-apps/tauri/pull/14347) by [@FabianLars](https://www.github.com/tauri-apps/tauri/../../FabianLars)) Fixed an issue that caused docs.rs builds to fail. No user facing changes.
## \[2.5.0]
### New Features
- [`3b4fac201`](https://www.github.com/tauri-apps/tauri/commit/3b4fac2017832d426dd07c5e24e26684eda57f7b) ([#14194](https://www.github.com/tauri-apps/tauri/pull/14194)) Add `tauri.conf.json > bundle > android > autoIncrementVersionCode` config option to automatically increment the Android version code.
### Dependencies
- Upgraded to `tauri-utils@2.8.0`
- Upgraded to `tauri-codegen@2.5.0`
## \[2.4.1]
### Enhancements
- [`c23bec62d`](https://www.github.com/tauri-apps/tauri/commit/c23bec62d6d5724798869681aa1534423aae28e2) ([#14083](https://www.github.com/tauri-apps/tauri/pull/14083) by [@FabianLars](https://www.github.com/tauri-apps/tauri/../../FabianLars)) Tauri now ignores `macOS.minimumSystemVersion` in `tauri dev` to prevent forced rebuilds of macOS specific dependencies when using something like `rust-analyzer` at the same time as `tauri dev`.
## \[2.4.0]
### Dependencies
- Upgraded to `tauri-utils@2.7.0`
- Upgraded to `tauri-codegen@2.4.0`
## \[2.3.1]
### Dependencies
- Upgraded to `tauri-utils@2.6.0`
- Upgraded to `tauri-codegen@2.3.1`
## \[2.2.1]
### Dependencies
- Upgraded to `tauri-codegen@2.3.0`
- Upgraded to `tauri-utils@2.5.0`
## \[2.2.0]
### Dependencies
- Upgraded to `tauri-utils@2.4.0`
- Upgraded to `tauri-codegen@2.2.0`
- [`48b12b440`](https://www.github.com/tauri-apps/tauri/commit/48b12b440478937c46fdfef9f9d95194be117020) Update to `tauri-utils@2.4.0`
## \[2.1.1]
### Dependencies
- Upgraded to `tauri-utils@2.3.1`
- Upgraded to `tauri-codegen@2.1.1`
## \[2.1.0]
### New Features

View File

@@ -1,6 +1,6 @@
[package]
name = "tauri-build"
version = "2.1.0"
version = "2.5.6"
description = "build time code to pair with https://crates.io/crates/tauri"
exclude = ["CHANGELOG.md", "/target"]
readme = "README.md"
@@ -22,14 +22,12 @@ targets = [
"x86_64-linux-android",
"x86_64-apple-ios",
]
rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs"]
[dependencies]
anyhow = "1"
quote = { version = "1", optional = true }
tauri-codegen = { version = "2.1.0", path = "../tauri-codegen", optional = true }
tauri-utils = { version = "2.3.0", path = "../tauri-utils", features = [
tauri-codegen = { version = "2.5.5", path = "../tauri-codegen", optional = true }
tauri-utils = { version = "2.8.3", path = "../tauri-utils", features = [
"build",
"resources",
] }
@@ -43,9 +41,9 @@ tauri-winres = "0.3"
semver = "1"
dirs = "6"
glob = "0.3"
toml = "0.8"
# Our code requires at least 0.8.18 so don't simplify this to 0.8
schemars = { version = "0.8.18", features = ["preserve_order"] }
toml = "0.9"
schemars = { version = "1", features = ["preserve_order"] }
cef-dll-sys = { version = "=146.4.1", optional = true }
[features]
default = ["config-json"]
@@ -54,3 +52,4 @@ isolation = ["tauri-codegen/isolation", "tauri-utils/isolation"]
config-json = []
config-json5 = ["tauri-utils/config-json5"]
config-toml = ["tauri-utils/config-toml"]
cef = ["dep:cef-dll-sys"]

View File

@@ -11,10 +11,10 @@ use std::{
use anyhow::{Context, Result};
use tauri_utils::{
acl::{
ACL_MANIFESTS_FILE_NAME, APP_ACL_KEY, CAPABILITIES_FILE_NAME,
capability::Capability,
manifest::{Manifest, PermissionFile},
schema::CAPABILITIES_SCHEMA_FOLDER_PATH,
ACL_MANIFESTS_FILE_NAME, APP_ACL_KEY, CAPABILITIES_FILE_NAME,
},
platform::Target,
write_if_changed,
@@ -157,7 +157,7 @@ fn read_plugins_manifests() -> Result<BTreeMap<String, Manifest>> {
Ok(manifests)
}
struct InlinedPuginsAcl {
struct InlinedPluginsAcl {
manifests: BTreeMap<String, Manifest>,
permission_files: BTreeMap<String, Vec<PermissionFile>>,
}
@@ -165,7 +165,7 @@ struct InlinedPuginsAcl {
fn inline_plugins(
out_dir: &Path,
inlined_plugins: HashMap<&'static str, InlinedPlugin>,
) -> Result<InlinedPuginsAcl> {
) -> Result<InlinedPluginsAcl> {
let mut acl_manifests = BTreeMap::new();
let mut permission_files_map = BTreeMap::new();
@@ -250,7 +250,7 @@ permissions = [{default_permissions}]
acl_manifests.insert(name.into(), manifest);
}
Ok(InlinedPuginsAcl {
Ok(InlinedPluginsAcl {
manifests: acl_manifests,
permission_files: permission_files_map,
})
@@ -437,7 +437,7 @@ pub fn build(out_dir: &Path, target: Target, attributes: &Attributes) -> super::
permissions_map.insert(APP_ACL_KEY.to_string(), app_acl.permission_files);
}
tauri_utils::acl::build::generate_allowed_commands(out_dir, permissions_map)?;
tauri_utils::acl::build::generate_allowed_commands(out_dir, Some(capabilities), permissions_map)?;
Ok(())
}

View File

@@ -5,11 +5,11 @@
use anyhow::{Context, Result};
use std::{
env::var,
fs::{create_dir_all, File},
fs::{File, create_dir_all},
io::{BufWriter, Write},
path::{Path, PathBuf},
};
use tauri_codegen::{context_codegen, ContextData};
use tauri_codegen::{ContextData, context_codegen};
use tauri_utils::config::FrontendDist;
// TODO docs
@@ -120,6 +120,13 @@ impl CodegenContext {
if info_plist_path.exists() {
println!("cargo:rerun-if-changed={}", info_plist_path.display());
}
if let Some(plist_path) = &config.bundle.macos.info_plist {
let info_plist_path = config_parent.join(plist_path);
if info_plist_path.exists() {
println!("cargo:rerun-if-changed={}", info_plist_path.display());
}
}
}
let code = context_codegen(ContextData {
@@ -141,9 +148,9 @@ impl CodegenContext {
.with_context(|| "unable to find OUT_DIR during tauri-build")?;
// make sure any nested directories in OUT_DIR are created
let parent = out.parent().with_context(|| {
"`Codegen` could not find the parent to `out_file` while creating the file"
})?;
let parent = out.parent().with_context(
|| "`Codegen` could not find the parent to `out_file` while creating the file",
)?;
create_dir_all(parent)?;
let mut file = File::create(&out).map(BufWriter::new).with_context(|| {

View File

@@ -16,7 +16,7 @@ use cargo_toml::Manifest;
use tauri_utils::{
config::{BundleResources, Config, WebviewInstallMode},
resources::{external_binaries, ResourcePaths},
resources::{ResourcePaths, external_binaries},
};
use std::{
@@ -57,7 +57,7 @@ fn copy_binaries(
binaries: ResourcePaths,
target_triple: &str,
path: &Path,
package_name: Option<&String>,
package_name: Option<&str>,
) -> Result<()> {
for src in binaries {
let src = src?;
@@ -165,21 +165,21 @@ fn copy_frameworks(dest_dir: &Path, frameworks: &[String]) -> Result<()> {
.with_context(|| format!("Failed to create frameworks output directory at {dest_dir:?}"))?;
for framework in frameworks.iter() {
if framework.ends_with(".framework") {
let src_path = PathBuf::from(framework);
let src_path = Path::new(framework);
let src_name = src_path
.file_name()
.expect("Couldn't get framework filename");
let dest_path = dest_dir.join(src_name);
copy_dir(&src_path, &dest_path)?;
copy_dir(src_path, &dest_path)?;
continue;
} else if framework.ends_with(".dylib") {
let src_path = PathBuf::from(framework);
let src_path = Path::new(framework);
if !src_path.exists() {
return Err(anyhow::anyhow!("Library not found: {}", framework));
}
let src_name = src_path.file_name().expect("Couldn't get library filename");
let dest_path = dest_dir.join(src_name);
copy_file(&src_path, &dest_path)?;
copy_file(src_path, &dest_path)?;
continue;
} else if framework.contains('/') {
return Err(anyhow::anyhow!(
@@ -187,17 +187,13 @@ fn copy_frameworks(dest_dir: &Path, frameworks: &[String]) -> Result<()> {
framework
));
}
if let Some(home_dir) = dirs::home_dir() {
if copy_framework_from(&home_dir.join("Library/Frameworks/"), framework, dest_dir)? {
continue;
}
if let Some(home_dir) = dirs::home_dir()
&& copy_framework_from(&home_dir.join("Library/Frameworks/"), framework, dest_dir)?
{
continue;
}
if copy_framework_from(&PathBuf::from("/Library/Frameworks/"), framework, dest_dir)?
|| copy_framework_from(
&PathBuf::from("/Network/Library/Frameworks/"),
framework,
dest_dir,
)?
if copy_framework_from("/Library/Frameworks/".as_ref(), framework, dest_dir)?
|| copy_framework_from("/Network/Library/Frameworks/".as_ref(), framework, dest_dir)?
{
continue;
}
@@ -214,6 +210,17 @@ fn cfg_alias(alias: &str, has_feature: bool) {
}
}
fn default_windows_app_manifest() -> &'static str {
let runtime = env::var("DEP_TAURI_RUNTIME")
.expect("missing `cargo:runtime` instruction, please update tauri to latest");
if runtime == "cef" {
include_str!("windows-cef-app-manifest.xml")
} else {
include_str!("windows-app-manifest.xml")
}
}
/// Attributes used on Windows.
#[allow(dead_code)]
#[derive(Debug)]
@@ -259,11 +266,11 @@ impl WindowsAttributes {
pub fn new() -> Self {
Self {
window_icon_path: Default::default(),
app_manifest: Some(include_str!("windows-app-manifest.xml").into()),
app_manifest: Some(default_windows_app_manifest().into()),
}
}
/// Creates the default attriute set wihtou the default app manifest.
/// Creates the default attribute set without the default app manifest.
#[must_use]
pub fn new_without_app_manifest() -> Self {
Self {
@@ -367,6 +374,8 @@ impl Attributes {
/// Set the glob pattern to be used to find the capabilities.
///
/// **WARNING:** The `removeUnusedCommands` option does not work with a custom capabilities path.
///
/// **Note:** You must emit [rerun-if-changed] instructions for your capabilities directory.
///
/// [rerun-if-changed]: https://doc.rust-lang.org/cargo/reference/build-scripts.html#rerun-if-changed
@@ -444,7 +453,9 @@ pub fn build() {
let error = format!("{error:#}");
println!("{error}");
if error.starts_with("unknown field") {
print!("found an unknown configuration field. This usually means that you are using a CLI version that is newer than `tauri-build` and is incompatible. ");
print!(
"found an unknown configuration field. This usually means that you are using a CLI version that is newer than `tauri-build` and is incompatible. "
);
println!(
"Please try updating the Rust crates by running `cargo update` in the Tauri app folder."
);
@@ -497,7 +508,7 @@ pub fn try_build(attributes: Attributes) -> Result<()> {
println!("cargo:rustc-env=TAURI_ANDROID_PACKAGE_NAME_PREFIX={android_package_prefix}");
if let Some(project_dir) = env::var_os("TAURI_ANDROID_PROJECT_PATH").map(PathBuf::from) {
mobile::generate_gradle_files(project_dir, &config)?;
mobile::generate_gradle_files(project_dir)?;
}
cfg_alias("dev", is_dev());
@@ -515,7 +526,7 @@ pub fn try_build(attributes: Attributes) -> Result<()> {
println!("cargo:rustc-env=TAURI_ENV_TARGET_TRIPLE={target_triple}");
// when running codegen in this build script, we need to access the env var directly
env::set_var("TAURI_ENV_TARGET_TRIPLE", &target_triple);
unsafe { env::set_var("TAURI_ENV_TARGET_TRIPLE", &target_triple) };
// TODO: far from ideal, but there's no other way to get the target dir, see <https://github.com/rust-lang/cargo/issues/5457>
let target_dir = out_dir
@@ -528,10 +539,10 @@ pub fn try_build(attributes: Attributes) -> Result<()> {
if let Some(paths) = &config.bundle.external_bin {
copy_binaries(
ResourcePaths::new(external_binaries(paths, &target_triple).as_slice(), true),
ResourcePaths::new(&external_binaries(paths, &target_triple, &target), true),
&target_triple,
target_dir,
manifest.package.as_ref().map(|p| &p.name),
manifest.package.as_ref().map(|p| p.name.as_ref()),
)?;
}
@@ -541,13 +552,13 @@ pub fn try_build(attributes: Attributes) -> Result<()> {
.resources
.clone()
.unwrap_or_else(|| BundleResources::List(Vec::new()));
if target_triple.contains("windows") {
if let Some(fixed_webview2_runtime_path) = match &config.bundle.windows.webview_install_mode {
if target_triple.contains("windows")
&& let Some(fixed_webview2_runtime_path) = match &config.bundle.windows.webview_install_mode {
WebviewInstallMode::FixedRuntime { path } => Some(path),
_ => None,
} {
resources.push(fixed_webview2_runtime_path.display().to_string());
}
{
resources.push(fixed_webview2_runtime_path.display().to_string());
}
match resources {
BundleResources::List(res) => {
@@ -557,21 +568,23 @@ pub fn try_build(attributes: Attributes) -> Result<()> {
}
if target_triple.contains("darwin") {
if let Some(frameworks) = &config.bundle.macos.frameworks {
if !frameworks.is_empty() {
let frameworks_dir = target_dir.parent().unwrap().join("Frameworks");
let _ = fs::remove_dir_all(&frameworks_dir);
// copy frameworks to the root `target` folder (instead of `target/debug` for instance)
// because the rpath is set to `@executable_path/../Frameworks`.
copy_frameworks(&frameworks_dir, frameworks)?;
if let Some(frameworks) = &config.bundle.macos.frameworks
&& !frameworks.is_empty()
{
let frameworks_dir = target_dir.parent().unwrap().join("Frameworks");
let _ = fs::remove_dir_all(&frameworks_dir);
// copy frameworks to the root `target` folder (instead of `target/debug` for instance)
// because the rpath is set to `@executable_path/../Frameworks`.
copy_frameworks(&frameworks_dir, frameworks)?;
// If we have frameworks, we need to set the @rpath
// https://github.com/tauri-apps/tauri/issues/7710
println!("cargo:rustc-link-arg=-Wl,-rpath,@executable_path/../Frameworks");
}
// If we have frameworks, we need to set the @rpath
// https://github.com/tauri-apps/tauri/issues/7710
println!("cargo:rustc-link-arg=-Wl,-rpath,@executable_path/../Frameworks");
}
if let Some(version) = &config.bundle.macos.minimum_system_version {
if !is_dev()
&& let Some(version) = &config.bundle.macos.minimum_system_version
{
println!("cargo:rustc-env=MACOSX_DEPLOYMENT_TARGET={version}");
}
}
@@ -583,25 +596,31 @@ pub fn try_build(attributes: Attributes) -> Result<()> {
);
}
#[cfg(feature = "cef")]
if target_triple.contains("unknown-linux-gnu") {
println!("cargo:rustc-link-arg=-Wl,-rpath,$ORIGIN");
}
#[cfg(feature = "cef")]
copy_cef_runtime_files(&target_triple, target_dir)?;
if target_triple.contains("windows") {
use semver::Version;
use tauri_winres::{VersionInfo, WindowsResource};
fn find_icon<F: Fn(&&String) -> bool>(config: &Config, predicate: F, default: &str) -> PathBuf {
let icon_path = config
.bundle
.icon
.iter()
.find(|i| predicate(i))
.cloned()
.unwrap_or_else(|| default.to_string());
icon_path.into()
}
let window_icon_path = attributes
.windows_attributes
.window_icon_path
.unwrap_or_else(|| find_icon(&config, |i| i.ends_with(".ico"), "icons/icon.ico"));
.unwrap_or_else(|| {
config
.bundle
.icon
.iter()
.find(|i| i.ends_with(".ico"))
.map(AsRef::as_ref)
.unwrap_or("icons/icon.ico")
.into()
});
let mut res = WindowsResource::new();
@@ -609,12 +628,12 @@ pub fn try_build(attributes: Attributes) -> Result<()> {
res.set_manifest(&manifest);
}
if let Some(version_str) = &config.version {
if let Ok(v) = Version::parse(version_str) {
let version = (v.major << 48) | (v.minor << 32) | (v.patch << 16);
res.set_version_info(VersionInfo::FILEVERSION, version);
res.set_version_info(VersionInfo::PRODUCTVERSION, version);
}
if let Some(version_str) = &config.version
&& let Ok(v) = Version::parse(version_str)
{
let version = (v.major << 48) | (v.minor << 32) | (v.patch << 16);
res.set_version_info(VersionInfo::FILEVERSION, version);
res.set_version_info(VersionInfo::PRODUCTVERSION, version);
}
if let Some(product_name) = &config.product_name {
@@ -699,3 +718,36 @@ pub fn try_build(attributes: Attributes) -> Result<()> {
Ok(())
}
#[cfg(feature = "cef")]
fn copy_directory(src: &Path, dest: &Path) -> Result<()> {
fs::create_dir_all(dest)?;
for entry in fs::read_dir(src)? {
let entry = entry?;
if entry.path().is_file() {
fs::copy(entry.path(), dest.join(entry.file_name()))?;
}
}
Ok(())
}
#[cfg(feature = "cef")]
fn copy_cef_runtime_files(target_triple: &str, target_dir: &Path) -> Result<()> {
// macOS: handled by tauri-cli's bundle flow
if target_triple.contains("darwin") {
return Ok(());
}
let Some(cef_dir) = cef_dll_sys::get_cef_dir() else {
anyhow::bail!("CEF directory not found");
};
println!("cargo:rerun-if-changed={}", cef_dir.display());
copy_directory(&cef_dir, target_dir)?;
const LOCALES_DIR: &str = "locales";
copy_directory(&cef_dir.join(LOCALES_DIR), &target_dir.join(LOCALES_DIR))?;
Ok(())
}

View File

@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
use anyhow::{anyhow, Result};
use anyhow::{Result, anyhow};
use cargo_toml::{Dependency, Manifest};
use tauri_utils::config::{AppConfig, Config, PatternKind};
@@ -62,11 +62,11 @@ pub fn check(config: &Config, manifest: &mut Manifest) -> Result<()> {
for metadata in dependencies {
let mut name = metadata.name.clone();
let mut deps = find_dependency(manifest, &metadata.name, metadata.kind);
if deps.is_empty() {
if let Some(alias) = &metadata.alias {
deps = find_dependency(manifest, alias, metadata.kind);
name.clone_from(alias);
}
if deps.is_empty()
&& let Some(alias) = &metadata.alias
{
deps = find_dependency(manifest, alias, metadata.kind);
name.clone_from(alias);
}
for dep in deps {

View File

@@ -2,18 +2,14 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
use std::{fs::write, path::PathBuf};
use std::path::PathBuf;
use anyhow::{Context, Result};
use semver::Version;
use tauri_utils::{config::Config, write_if_changed};
use tauri_utils::write_if_changed;
use crate::is_dev;
pub fn generate_gradle_files(project_dir: PathBuf, config: &Config) -> Result<()> {
pub fn generate_gradle_files(project_dir: PathBuf) -> Result<()> {
let gradle_settings_path = project_dir.join("tauri.settings.gradle");
let app_build_gradle_path = project_dir.join("app").join("tauri.build.gradle.kts");
let app_tauri_properties_path = project_dir.join("app").join("tauri.properties");
let mut gradle_settings =
"// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.\n".to_string();
@@ -21,7 +17,6 @@ pub fn generate_gradle_files(project_dir: PathBuf, config: &Config) -> Result<()
val implementation by configurations
dependencies {"
.to_string();
let mut app_tauri_properties = Vec::new();
for (env, value) in std::env::vars_os() {
let env = env.to_string_lossy();
@@ -54,32 +49,6 @@ dependencies {"
app_build_gradle.push_str("\n}");
if let Some(version) = config.version.as_ref() {
app_tauri_properties.push(format!("tauri.android.versionName={version}"));
if let Some(version_code) = config.bundle.android.version_code.as_ref() {
app_tauri_properties.push(format!("tauri.android.versionCode={version_code}"));
} else if let Ok(version) = Version::parse(version) {
let mut version_code = version.major * 1000000 + version.minor * 1000 + version.patch;
if is_dev() {
version_code = version_code.clamp(1, 2100000000);
}
if version_code == 0 {
return Err(anyhow::anyhow!(
"You must change the `version` in `tauri.conf.json`. The default value `0.0.0` is not allowed for Android package and must be at least `0.0.1`."
));
} else if version_code > 2100000000 {
return Err(anyhow::anyhow!(
"Invalid version code {}. Version code must be between 1 and 2100000000. You must change the `version` in `tauri.conf.json`.",
version_code
));
}
app_tauri_properties.push(format!("tauri.android.versionCode={version_code}"));
}
}
// Overwrite only if changed to not trigger rebuilds
write_if_changed(&gradle_settings_path, gradle_settings)
.context("failed to write tauri.settings.gradle")?;
@@ -87,28 +56,8 @@ dependencies {"
write_if_changed(&app_build_gradle_path, app_build_gradle)
.context("failed to write tauri.build.gradle.kts")?;
if !app_tauri_properties.is_empty() {
let app_tauri_properties_content = format!(
"// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.\n{}",
app_tauri_properties.join("\n")
);
if std::fs::read_to_string(&app_tauri_properties_path)
.map(|o| o != app_tauri_properties_content)
.unwrap_or(true)
{
write(&app_tauri_properties_path, app_tauri_properties_content)
.context("failed to write tauri.properties")?;
}
}
println!("cargo:rerun-if-changed={}", gradle_settings_path.display());
println!("cargo:rerun-if-changed={}", app_build_gradle_path.display());
if !app_tauri_properties.is_empty() {
println!(
"cargo:rerun-if-changed={}",
app_tauri_properties_path.display()
);
}
Ok(())
}

View File

@@ -1,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<dependency>
<dependentAssembly>

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<!-- This compatibility section is from the standar pre - built binary package, specifically from %CEF_ROOT%/tests/cefsimple/win/compatibility.manifest -->
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!--The ID below indicates application support for Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!--The ID below indicates application support for Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!--The ID below indicates application support for Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!--The ID below indicates application support for Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!--The ID below indicates application support for Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
<!-- This tag is required for XAML islands usage in the process for media scenarios. -->
<!-- This version corresponds to the Windows 10 May 2019 Update. -->
<maxversiontested Id="10.0.18362.0"/>
</application>
</compatibility>
<dependency>
<dependentAssembly>
<assemblyIdentity type="Win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"></assemblyIdentity>
</dependentAssembly>
</dependency>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" />
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

View File

@@ -1,5 +1,212 @@
# Changelog
## \[2.8.1]
### Bug Fixes
- [`6252432f0`](https://www.github.com/tauri-apps/tauri/commit/6252432f0757d896d7a61819bbff127efac5a156) ([#14945](https://www.github.com/tauri-apps/tauri/pull/14945) by [@veeceey](https://www.github.com/tauri-apps/tauri/../../veeceey)) Fix WIX installer registry search order so that the named `InstallDir` key takes priority over the NSIS default key, preventing install location from changing on updates.
### What's Changed
- [`7be58a1c6`](https://www.github.com/tauri-apps/tauri/commit/7be58a1c643a7ed6d0f484a7e1134022618eb2b2) ([#14894](https://www.github.com/tauri-apps/tauri/pull/14894) by [@Legend-Master](https://www.github.com/tauri-apps/tauri/../../Legend-Master)) Log patching bundle type information again
### Dependencies
- Upgraded to `tauri-utils@2.8.3`
## \[2.8.0]
### Enhancements
- [`c769f211f`](https://www.github.com/tauri-apps/tauri/commit/c769f211fcaa543884c9d0f87ebd2ee106c01382) ([#14824](https://www.github.com/tauri-apps/tauri/pull/14824) by [@Kf637](https://www.github.com/tauri-apps/tauri/../../Kf637)) feat(nsis): add Norwegian language support for installer.
### Bug Fixes
- [`7fca58230`](https://www.github.com/tauri-apps/tauri/commit/7fca58230f97c3e6834134419514a0c7dbbe784b) ([#14830](https://www.github.com/tauri-apps/tauri/pull/14830) by [@Legend-Master](https://www.github.com/tauri-apps/tauri/../../Legend-Master)) Updated `nsis_tauri_utils` to 0.5.3:
- Use an alternative method `CreateProcessWithTokenW` to run programs as user, this fixed a problem that the program launched with the previous method can't query its own handle
### What's Changed
- [`0575dd287`](https://www.github.com/tauri-apps/tauri/commit/0575dd287e021b61d2aedf64d62ae84a2c925fb4) ([#14521](https://www.github.com/tauri-apps/tauri/pull/14521) by [@kandrelczyk](https://www.github.com/tauri-apps/tauri/../../kandrelczyk)) Change the way bundle type information is added to binary files. Instead of looking up the value of a variable we simply look for the default value.
### Dependencies
- Upgraded to `tauri-utils@2.8.2`
- Upgraded to `tauri-macos-sign@2.3.3`
## \[2.7.5]
### Enhancements
- [`4176f93ae`](https://www.github.com/tauri-apps/tauri/commit/4176f93ae43ef66714c4934feb3df19df3a3e28a) ([#14570](https://www.github.com/tauri-apps/tauri/pull/14570) by [@chfaft](https://www.github.com/tauri-apps/tauri/../../chfaft)) Consider extensions that are defined in the wxs template.
### Bug Fixes
- [`018b4db22`](https://www.github.com/tauri-apps/tauri/commit/018b4db22e167fa67b37b0933e192a0f3556d3e5) ([#14625](https://www.github.com/tauri-apps/tauri/pull/14625) by [@Legend-Master](https://www.github.com/tauri-apps/tauri/../../Legend-Master)) Skip signing for NSIS uninstaller when using `--no-sign` flag
- [`91becd9e4`](https://www.github.com/tauri-apps/tauri/commit/91becd9e4fa2db089ddc6b21dadc06133e939e08) ([#14627](https://www.github.com/tauri-apps/tauri/pull/14627) by [@Legend-Master](https://www.github.com/tauri-apps/tauri/../../Legend-Master)) Fix NSIS plugins not being signed due to wrong path handlings
### Dependencies
- Upgraded to `tauri-macos-sign@2.3.2`
## \[2.7.4]
### Bug Fixes
- [`1496145f8`](https://www.github.com/tauri-apps/tauri/commit/1496145f8222649efeff22b819a96208670bbea1) ([#14585](https://www.github.com/tauri-apps/tauri/pull/14585) by [@FabianLars](https://www.github.com/tauri-apps/tauri/../../FabianLars)) Fixed an issue that caused the AppImage bundler to fail with 404 errors for 32-bit builds.
### Performance Improvements
- [`ce98d87ce`](https://www.github.com/tauri-apps/tauri/commit/ce98d87ce0aaa907285852eb80691197424e03c3) ([#14474](https://www.github.com/tauri-apps/tauri/pull/14474) by [@Tunglies](https://www.github.com/tauri-apps/tauri/../../Tunglies)) refactor: remove needless collect. No user facing changes.
- [`ee3cc4a91`](https://www.github.com/tauri-apps/tauri/commit/ee3cc4a91bf1315ecaefe90f423ffd55ef6c40db) ([#14475](https://www.github.com/tauri-apps/tauri/pull/14475) by [@Tunglies](https://www.github.com/tauri-apps/tauri/../../Tunglies)) perf: remove needless clones in various files for improved performance. No user facing changes.
### Dependencies
- Upgraded to `tauri-macos-sign@2.3.1`
- Upgraded to `tauri-utils@2.8.1`
- [`b5ef603d8`](https://www.github.com/tauri-apps/tauri/commit/b5ef603d84bd8044625e50dcfdabb099b2e9fdd9) ([#14478](https://www.github.com/tauri-apps/tauri/pull/14478) by [@Legend-Master](https://www.github.com/tauri-apps/tauri/../../Legend-Master)) Updated NSIS from 3.8 to 3.11
## \[2.7.3]
### Enhancements
- [`22edc65aa`](https://www.github.com/tauri-apps/tauri/commit/22edc65aad0b3e45515008e8e0866112da70c8a1) ([#14408](https://www.github.com/tauri-apps/tauri/pull/14408) by [@FabianLars](https://www.github.com/tauri-apps/tauri/../../FabianLars)) Set user-agent in bundler and cli http requests when fetching build tools.
### Bug Fixes
- [`9a1922636`](https://www.github.com/tauri-apps/tauri/commit/9a192263693d71123a9953e2a6ee60fad07500b4) ([#14410](https://www.github.com/tauri-apps/tauri/pull/14410) by [@Legend-Master](https://www.github.com/tauri-apps/tauri/../../Legend-Master)) Fix uninstall fails if you close the app manually during the 'Click Ok to kill it' dialog
## \[2.7.2]
### Enhancements
- [`7f710b8f3`](https://www.github.com/tauri-apps/tauri/commit/7f710b8f3b509ed327d76761926511cf56e66b2d) ([#14390](https://www.github.com/tauri-apps/tauri/pull/14390) by [@FabianLars](https://www.github.com/tauri-apps/tauri/../../FabianLars)) Inline linuxdeploy plugins which were previously downloaded from `https://raw.githubusercontent.com` which lately blocks many users with a 429 error.
- [`fc017ee25`](https://www.github.com/tauri-apps/tauri/commit/fc017ee2577f48615367ea519386d3f37837e2c1) ([#14368](https://www.github.com/tauri-apps/tauri/pull/14368) by [@kandrelczyk](https://www.github.com/tauri-apps/tauri/../../kandrelczyk)) Mention symbol stripping on Linux in binary patch failed warning message
## \[2.7.1]
### Dependencies
- Upgraded to `tauri-macos-sign@2.3.0`
## \[2.7.0]
### New Features
- [`2a06d1006`](https://www.github.com/tauri-apps/tauri/commit/2a06d10066a806e392efe8bfb16d943ee0b0b61d) ([#14052](https://www.github.com/tauri-apps/tauri/pull/14052)) Add a `--no-sign` flag to the `tauri build` and `tauri bundle` commands to skip the code signing step, improving the developer experience for local testing and development without requiring code signing keys.
- [`cc8c0b531`](https://www.github.com/tauri-apps/tauri/commit/cc8c0b53171173dbd1d01781a50de1a3ea159031) ([#14031](https://www.github.com/tauri-apps/tauri/pull/14031)) Support providing `plist::Value` as macOS entitlements.
### Enhancements
- [`b06b3bd09`](https://www.github.com/tauri-apps/tauri/commit/b06b3bd091b0fed26cdcfb23cacb0462a7a9cc2d) ([#14126](https://www.github.com/tauri-apps/tauri/pull/14126)) Improve error messages with more context.
### Bug Fixes
- [`06d4a4ed6`](https://www.github.com/tauri-apps/tauri/commit/06d4a4ed6c146d6c7782016cf90037b56b944445) ([#14241](https://www.github.com/tauri-apps/tauri/pull/14241)) Set `APPIMAGE_EXTRACT_AND_RUN` on top of using the `--appimage-extra-and-run` cli arg for linuxdeploy.
### Dependencies
- Upgraded to `tauri-utils@2.8.0`
### Breaking Changes
- [`ed7c9a410`](https://www.github.com/tauri-apps/tauri/commit/ed7c9a4100e08c002212265549d12130d021ad1e) ([#14108](https://www.github.com/tauri-apps/tauri/pull/14108)) Changed `MacOsSettings::info_plist_path` to `MacOsSettings::info_plist`.
## \[2.6.1]
### Bug Fixes
- [`f3df96fb3`](https://www.github.com/tauri-apps/tauri/commit/f3df96fb38e2f27ce6bf232fe87f35bcfec50ce4) ([#14065](https://www.github.com/tauri-apps/tauri/pull/14065) by [@Legend-Master](https://www.github.com/tauri-apps/tauri/../../Legend-Master)) Fix binary patching updater type fails on 32 bit Windows builds
## \[2.6.0]
### New Features
- [`a9ec12843`](https://www.github.com/tauri-apps/tauri/commit/a9ec12843aa7d0eb774bd3a53e2e63da12cfa77b) ([#13521](https://www.github.com/tauri-apps/tauri/pull/13521) by [@FabianLars](https://www.github.com/tauri-apps/tauri/../../FabianLars)) Added a `--skip-stapling` option to make `tauri build|bundle` *not* wait for notarization to finish on macOS.
### Enhancements
- [`8b465a12b`](https://www.github.com/tauri-apps/tauri/commit/8b465a12ba73e94d7a3995defd9cc362d15eeebe) ([#13913](https://www.github.com/tauri-apps/tauri/pull/13913) by [@FabianLars](https://www.github.com/tauri-apps/tauri/../../FabianLars)) The bundler now pulls the latest AppImage linuxdeploy plugin instead of using the built-in one. This should remove the libfuse requirement.
- [`4475e93e1`](https://www.github.com/tauri-apps/tauri/commit/4475e93e136e9e2bd5f3c7817fa2040924f630f6) ([#13824](https://www.github.com/tauri-apps/tauri/pull/13824) by [@FabianLars](https://www.github.com/tauri-apps/tauri/../../FabianLars)) The bundler and cli will now read TLS Certificates installed on the system when downloading tools and checking versions.
### Bug Fixes
- [`a8f1569b0`](https://www.github.com/tauri-apps/tauri/commit/a8f1569b04edf7b54a19e19ad37b421b0808f512) ([#13921](https://www.github.com/tauri-apps/tauri/pull/13921) by [@Legend-Master](https://www.github.com/tauri-apps/tauri/../../Legend-Master)) The bundler will no longer try to sign non-binary and already signed binary files on Windows
- [`bc6b125b2`](https://www.github.com/tauri-apps/tauri/commit/bc6b125b24589ffc412a4f17d899a387a0fc0bb2) ([#13909](https://www.github.com/tauri-apps/tauri/pull/13909) by [@Andrew15-5](https://www.github.com/tauri-apps/tauri/../../Andrew15-5)) The bundler now falls back to `1` for the release in case an empty string was provided instead of using `-.` in the file name.
### Dependencies
- Upgraded to `tauri-utils@2.7.0`
- Upgraded to `tauri-macos-sign@2.2.0`
## \[2.5.2]
### Bug Fixes
- [`af95fb601`](https://www.github.com/tauri-apps/tauri/commit/af95fb6014ea54a2636bfd299095608f6cd93221) ([#13870](https://www.github.com/tauri-apps/tauri/pull/13870) by [@kittuov](https://www.github.com/tauri-apps/tauri/../../kittuov)) The bundler now signs the main binary after patching it for every package type on windows
## \[2.5.1]
### Bug Fixes
- [`f94af9035`](https://www.github.com/tauri-apps/tauri/commit/f94af90359ec8b01138ae542391caa704ec18ca8) ([#13786](https://www.github.com/tauri-apps/tauri/pull/13786) by [@catalinsh](https://www.github.com/tauri-apps/tauri/../../catalinsh)) Fix NSIS per-machine installer not requesting elevation when run by non-admin users.
- [`f2dbe7309`](https://www.github.com/tauri-apps/tauri/commit/f2dbe730979d570be3ee3ecac9621204c4ceb788) ([#13772](https://www.github.com/tauri-apps/tauri/pull/13772) by [@catalinsh](https://www.github.com/tauri-apps/tauri/../../catalinsh)) Fix incorrect expected file path for `nsis_tauri_utils.dll` resulting in tauri-cli re-downloading the file on every build.
- [`7a6fd5b75`](https://www.github.com/tauri-apps/tauri/commit/7a6fd5b75d61071e2771f6277c0376ec206d302a) ([#13863](https://www.github.com/tauri-apps/tauri/pull/13863) by [@FabianLars](https://www.github.com/tauri-apps/tauri/../../FabianLars)) The AppImage bundler now pulls the AppRun binaries from our GitHub mirror, fixing 404 errors.
### Dependencies
- Upgraded to `tauri-utils@2.6.0`
## \[2.5.0]
### New Features
- [`414619c36`](https://www.github.com/tauri-apps/tauri/commit/414619c36e94e21939534dd72c0438b93da75546) ([#13536](https://www.github.com/tauri-apps/tauri/pull/13536) by [@Tunglies](https://www.github.com/tauri-apps/tauri/../../Tunglies)) Added support for the `bundleName` property in the macOS bundler configuration. This allows specifying the `CFBundleName` value for generated macOS bundles.
- [`7322f0579`](https://www.github.com/tauri-apps/tauri/commit/7322f057923aaec88960ad5556776774b745762f) ([#13502](https://www.github.com/tauri-apps/tauri/pull/13502) by [@amrbashir](https://www.github.com/tauri-apps/tauri/../../amrbashir)) Allow using `CheckIfAppIsRunning` macro inside NSIS hooks, for example `!insertmacro CheckIfAppIsRunning "another-executable.exe" "Another Executable"`.
### Bug Fixes
- [`479cee3d3`](https://www.github.com/tauri-apps/tauri/commit/479cee3d3680f9020005bdfb380d3a9482e286a1) ([#13260](https://www.github.com/tauri-apps/tauri/pull/13260) by [@FabianLars](https://www.github.com/tauri-apps/tauri/../../FabianLars)) The bundler now sets the `ARCH` env var to the current build target to prevent potential issues with `appimagetool`'s auto-detection.
- [`e045fe32c`](https://www.github.com/tauri-apps/tauri/commit/e045fe32c9b0bed954916dc42528e28ee19f75b8) ([#13334](https://www.github.com/tauri-apps/tauri/pull/13334) by [@lucasfernog](https://www.github.com/tauri-apps/tauri/../../lucasfernog)) Fix custom Windows sign command failing to sign app uninstaller if it references relative paths.
- [`bd8a7cf39`](https://www.github.com/tauri-apps/tauri/commit/bd8a7cf39df316bf27c73a303d5e650301af0104) ([#13581](https://www.github.com/tauri-apps/tauri/pull/13581) by [@martpie](https://www.github.com/tauri-apps/tauri/../../martpie)) Fixes app icon not being displayed on Gnome dock and grid view when using Wayland.
- [`b52da29d5`](https://www.github.com/tauri-apps/tauri/commit/b52da29d5dbdb675ddba438a335e6a59f620e536) ([#13429](https://www.github.com/tauri-apps/tauri/pull/13429) by [@Legend-Master](https://www.github.com/tauri-apps/tauri/../../Legend-Master)) Fix `mainBinaryName` doesn't work when there's `.` in it
### Dependencies
- Upgraded to `tauri-utils@2.5.0`
## \[2.4.0]
### New Features
- [`b0babb6df`](https://www.github.com/tauri-apps/tauri/commit/b0babb6df12dafe45c21a2c9c424fd86ffd75ca7) ([#12938](https://www.github.com/tauri-apps/tauri/pull/12938)) Added hebrew translation for the custom Tauri messages in the NSIS bundle.
- [`0aa48fb9e`](https://www.github.com/tauri-apps/tauri/commit/0aa48fb9e4b9d7b5bf3522000a76ebc1836394ed) ([#13030](https://www.github.com/tauri-apps/tauri/pull/13030)) Added `bundleVersion` to iOS and macOS configuration to support specifying a `CFBundleVersion`.
### Enhancements
- [`8d994f60f`](https://www.github.com/tauri-apps/tauri/commit/8d994f60fe05ec0f45cbe926506bbe10b0d36e3c) ([#11676](https://www.github.com/tauri-apps/tauri/pull/11676)) Sign NSIS and WiX DLLs when bundling
- [`8d994f60f`](https://www.github.com/tauri-apps/tauri/commit/8d994f60fe05ec0f45cbe926506bbe10b0d36e3c) ([#11676](https://www.github.com/tauri-apps/tauri/pull/11676)) Sign DLLs from resources.
### Bug Fixes
- [`9ea76503d`](https://www.github.com/tauri-apps/tauri/commit/9ea76503dcf8da11fab65550f4ab8d3565a424ef) ([#13186](https://www.github.com/tauri-apps/tauri/pull/13186)) Fix NSIS bundler can't include resources and sidecars with `$` in the path
- [`2dccfab53`](https://www.github.com/tauri-apps/tauri/commit/2dccfab5321fef55d45f3a4c674b6151b1c4424a) ([#13236](https://www.github.com/tauri-apps/tauri/pull/13236)) Fix `fileAssociations` missing `LSHandlerRank` on macOS.
### Dependencies
- Upgraded to `tauri-utils@2.4.0`
## \[2.3.1]
### Bug Fixes
- [`2138bbc21`](https://www.github.com/tauri-apps/tauri/commit/2138bbc21294785df5f4144670104387289f79c1) ([#13087](https://www.github.com/tauri-apps/tauri/pull/13087) by [@Legend-Master](https://www.github.com/tauri-apps/tauri/../../Legend-Master)) Fix NSIS installer displaying in wrong language if `SpanishInternational` is included
### Dependencies
- Upgraded to `tauri-utils@2.3.1`
## \[2.3.0]
### Enhancements

View File

@@ -1,6 +1,6 @@
[package]
name = "tauri-bundler"
version = "2.3.0"
version = "2.8.1"
authors = [
"George Burton <burtonageo@gmail.com>",
"Tauri Programme within The Commons Conservancy",
@@ -10,18 +10,18 @@ license = "Apache-2.0 OR MIT"
keywords = ["bundle", "cargo", "tauri"]
repository = "https://github.com/tauri-apps/tauri"
description = "Wrap rust executables in OS-specific app bundles for Tauri"
edition = "2021"
rust-version = "1.77.2"
edition = "2024"
rust-version = "1.88"
exclude = ["CHANGELOG.md", "/target", "rustfmt.toml"]
[dependencies]
tauri-utils = { version = "2.3.0", path = "../tauri-utils", features = [
tauri-utils = { version = "2.8.3", path = "../tauri-utils", features = [
"resources",
] }
image = "0.25"
flate2 = "1"
anyhow = "1"
thiserror = "2"
anyhow = "1"
serde_json = "1"
serde = { version = "1", features = ["derive"] }
strsim = "0.11"
@@ -38,11 +38,14 @@ hex = "0.4"
semver = "1"
sha1 = "0.10"
sha2 = "0.10"
zip = { version = "2", default-features = false, features = ["deflate"] }
zip = { version = "4", default-features = false, features = ["deflate"] }
dunce = "1"
url = "2"
uuid = { version = "1", features = ["v4", "v5"] }
regex = "1"
goblin = "0.9"
plist = "1"
[target."cfg(target_os = \"windows\")".dependencies]
bitness = "0.4"
@@ -50,27 +53,30 @@ windows-registry = "0.5"
glob = "0.3"
[target."cfg(target_os = \"windows\")".dependencies.windows-sys]
version = "0.59"
version = "0.60"
features = ["Win32_System_SystemInformation", "Win32_System_Diagnostics_Debug"]
[target."cfg(target_os = \"macos\")".dependencies]
icns = { package = "tauri-icns", version = "0.1" }
time = { version = "0.3", features = ["formatting"] }
plist = "1"
tauri-macos-sign = { version = "2.1.0", path = "../tauri-macos-sign" }
tauri-macos-sign = { version = "2.3.3", path = "../tauri-macos-sign" }
[target."cfg(target_os = \"linux\")".dependencies]
heck = "0.5"
ar = "0.9"
md5 = "0.7"
md5 = "0.8"
rpm = { version = "0.16", features = ["bzip2-compression"] }
[target."cfg(unix)".dependencies]
which = "8"
[lib]
name = "tauri_bundler"
path = "src/lib.rs"
[features]
default = ["rustls"]
default = ["rustls", "platform-certs"]
native-tls = ["ureq/native-tls"]
native-tls-vendored = ["native-tls", "native-tls/vendored"]
rustls = ["ureq/rustls"]
platform-certs = ["ureq/platform-verifier"]

View File

@@ -0,0 +1,109 @@
// Copyright 2019-2025 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
use std::{
env, fs,
path::{Path, PathBuf},
process::Command,
};
fn main() {
let target = env::var("TARGET").unwrap_or_default();
let host = env::var("HOST").unwrap_or_default();
// Only build/embed the CEF helper when compiling `tauri-bundler` for macOS.
if !target.contains("apple-darwin") {
return;
}
// We need `lipo` and a functioning macOS toolchain to produce a universal Mach-O.
if !host.contains("apple-darwin") {
panic!(
"Building tauri-bundler for macOS requires a macOS host to build/embed the CEF helper binary"
);
}
let out_dir = PathBuf::from(env::var("OUT_DIR").expect("OUT_DIR not set"));
let bundler_manifest_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());
let helper_root = bundler_manifest_dir
.parent() // crates/
.and_then(|p| p.parent()) // repo root
.map(|p| p.join("cef-helper"))
.expect("failed to compute cef-helper path");
let helper_manifest = helper_root.join("Cargo.toml");
let helper_main = helper_root.join("src").join("main.rs");
// Rebuild if the helper crate changes.
println!("cargo:rerun-if-changed={}", helper_manifest.display());
println!("cargo:rerun-if-changed={}", helper_main.display());
// Copy the helper crate sources into OUT_DIR so any generated files (Cargo.lock, target dir)
// stay out of the repo checkout.
let helper_src_dir = out_dir.join("cef-helper-src");
let helper_src_manifest = helper_src_dir.join("Cargo.toml");
let helper_src_main = helper_src_dir.join("src").join("main.rs");
fs::create_dir_all(helper_src_main.parent().unwrap())
.expect("failed to create cef-helper-src directory");
fs::copy(&helper_manifest, &helper_src_manifest).expect("failed to copy cef-helper Cargo.toml");
fs::copy(&helper_main, &helper_src_main).expect("failed to copy cef-helper main.rs");
let cargo = env::var("CARGO").unwrap_or_else(|_| "cargo".into());
let helper_target_dir = out_dir.join("cef-helper-target");
let aarch64 = build_helper(
&cargo,
&helper_src_manifest,
&helper_target_dir,
"aarch64-apple-darwin",
"tauri-cef-helper",
);
let x86_64 = build_helper(
&cargo,
&helper_src_manifest,
&helper_target_dir,
"x86_64-apple-darwin",
"tauri-cef-helper",
);
// Generate a small rust shim that exposes the embedded helper bytes.
let shim_path = out_dir.join("cef_helpers.rs");
let shim = format!(
"pub const CEF_HELPER_AARCH64: &[u8] = include_bytes!(r#\"{}\"#);\n\
pub const CEF_HELPER_X86_64: &[u8] = include_bytes!(r#\"{}\"#);\n",
aarch64.display(),
x86_64.display()
);
fs::write(&shim_path, shim).expect("failed to write cef_helpers.rs");
}
fn build_helper(
cargo: &str,
manifest_path: &Path,
target_dir: &Path,
target: &str,
bin_name: &str,
) -> PathBuf {
let mut cmd = Command::new(cargo);
cmd
.arg("build")
.arg("--release")
.arg("--manifest-path")
.arg(manifest_path)
.arg("--bin")
.arg(bin_name)
.arg("--target")
.arg(target)
.env("CARGO_TARGET_DIR", target_dir);
let status = cmd
.status()
.expect("failed to spawn cargo build for CEF helper");
if !status.success() {
panic!("failed to build CEF helper for target {target}");
}
target_dir.join(target).join("release").join(bin_name)
}

View File

@@ -4,6 +4,8 @@
// SPDX-License-Identifier: MIT
mod category;
#[cfg(any(target_os = "linux", target_os = "windows"))]
mod kmp;
#[cfg(target_os = "linux")]
mod linux;
#[cfg(target_os = "macos")]
@@ -13,21 +15,70 @@ mod settings;
mod updater_bundle;
mod windows;
use tauri_utils::display_path;
use tauri_utils::{display_path, platform::Target as TargetPlatform};
#[cfg(any(target_os = "linux", target_os = "windows"))]
const BUNDLE_VAR_TOKEN: &[u8] = b"__TAURI_BUNDLE_TYPE_VAR_UNK";
/// Patch a binary with bundle type information
#[cfg(any(target_os = "linux", target_os = "windows"))]
fn patch_binary(binary: &PathBuf, package_type: &PackageType) -> crate::Result<()> {
log::info!(
"Patching {} with bundle type information: {}",
display_path(binary),
package_type.short_name()
);
let mut file_data = std::fs::read(binary).expect("Could not read binary file.");
let bundle_var_index =
kmp::index_of(BUNDLE_VAR_TOKEN, &file_data).ok_or(crate::Error::MissingBundleTypeVar)?;
#[cfg(target_os = "linux")]
let bundle_type = match package_type {
crate::PackageType::Deb => b"__TAURI_BUNDLE_TYPE_VAR_DEB",
crate::PackageType::Rpm => b"__TAURI_BUNDLE_TYPE_VAR_RPM",
crate::PackageType::AppImage => b"__TAURI_BUNDLE_TYPE_VAR_APP",
_ => {
return Err(crate::Error::InvalidPackageType(
package_type.short_name().to_owned(),
"Linux".to_owned(),
));
}
};
#[cfg(target_os = "windows")]
let bundle_type = match package_type {
crate::PackageType::Nsis => b"__TAURI_BUNDLE_TYPE_VAR_NSS",
crate::PackageType::WindowsMsi => b"__TAURI_BUNDLE_TYPE_VAR_MSI",
_ => {
return Err(crate::Error::InvalidPackageType(
package_type.short_name().to_owned(),
"Windows".to_owned(),
));
}
};
file_data[bundle_var_index..bundle_var_index + BUNDLE_VAR_TOKEN.len()]
.copy_from_slice(bundle_type);
std::fs::write(binary, &file_data).map_err(|e| crate::Error::BinaryWriteError(e.to_string()))?;
Ok(())
}
pub use self::{
category::AppCategory,
settings::{
AppImageSettings, BundleBinary, BundleSettings, CustomSignCommandSettings, DebianSettings,
DmgSettings, MacOsSettings, PackageSettings, PackageType, Position, RpmSettings, Settings,
SettingsBuilder, Size, UpdaterSettings,
DmgSettings, Entitlements, IosSettings, MacOsSettings, PackageSettings, PackageType, PlistKind,
Position, RpmSettings, Settings, SettingsBuilder, Size, UpdaterSettings,
},
};
#[cfg(target_os = "macos")]
use anyhow::Context;
pub use settings::{NsisSettings, WindowsSettings, WixLanguage, WixLanguageConfig, WixSettings};
use std::{fmt::Write, path::PathBuf};
use std::{
fmt::Write,
io::{Seek, SeekFrom},
path::PathBuf,
};
/// Generated bundle metadata.
#[derive(Debug)]
@@ -48,49 +99,34 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<Bundle>> {
package_types.sort_by_key(|a| a.priority());
let target_os = settings
.target()
.split('-')
.nth(2)
.unwrap_or(std::env::consts::OS)
.replace("darwin", "macos");
let target_os = settings.target_platform();
if target_os != std::env::consts::OS {
log::warn!("Cross-platform compilation is experimental and does not support all features. Please use a matching host system for full compatibility.");
if *target_os != TargetPlatform::current() {
log::warn!(
"Cross-platform compilation is experimental and does not support all features. Please use a matching host system for full compatibility."
);
}
// Sign windows binaries before the bundling step in case neither wix and nsis bundles are enabled
if target_os == "windows" {
if settings.can_sign() {
for bin in settings.binaries() {
let bin_path = settings.binary_path(bin);
windows::sign::try_sign(&bin_path, settings)?;
}
sign_binaries_if_needed(settings, target_os)?;
// Sign the sidecar binaries
for bin in settings.external_binaries() {
let path = bin?;
let skip = std::env::var("TAURI_SKIP_SIDECAR_SIGNATURE_CHECK").is_ok_and(|v| v == "true");
if skip {
continue;
}
let main_binary = settings
.binaries()
.iter()
.find(|b| b.main())
.expect("Main binary missing in settings");
let main_binary_path = settings.binary_path(main_binary);
#[cfg(windows)]
if windows::sign::verify(&path)? {
log::info!(
"sidecar at \"{}\" already signed. Skipping...",
path.display()
);
continue;
}
windows::sign::try_sign(&path, settings)?;
}
} else {
#[cfg(not(target_os = "windows"))]
log::warn!("Signing, by default, is only supported on Windows hosts, but you can specify a custom signing command in `bundler > windows > sign_command`, for now, skipping signing the installer...");
}
}
// We make a copy of the unsigned main_binary so that we can restore it after each package_type step.
// This allows us to patch the binary correctly and avoids two issues:
// - modifying a signed binary without updating its PE checksum can break signature verification
// - codesigning tools should handle calculating+updating this, we just need to ensure
// (re)signing is performed after every `patch_binary()` operation
// - signing an already-signed binary can result in multiple signatures, causing verification errors
// TODO: change this to work on a copy while preserving the main binary unchanged
let mut main_binary_copy = tempfile::tempfile()?;
let mut main_binary_orignal = std::fs::File::open(&main_binary_path)?;
std::io::copy(&mut main_binary_orignal, &mut main_binary_copy)?;
let mut bundles = Vec::<Bundle>::new();
for package_type in &package_types {
@@ -99,6 +135,18 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<Bundle>> {
continue;
}
#[cfg(any(target_os = "linux", target_os = "windows"))]
if let Err(e) = patch_binary(&main_binary_path, package_type) {
log::warn!(
"Failed to add bundler type to the binary: {e}. Updater plugin may not be able to update this package. This shouldn't normally happen, please report it to https://github.com/tauri-apps/tauri/issues"
);
}
// sign main binary for every package type after patch
if matches!(target_os, TargetPlatform::Windows) && settings.windows().can_sign() {
windows::sign::try_sign(&main_binary_path, settings)?;
}
let bundle_paths = match package_type {
#[cfg(target_os = "macos")]
PackageType::MacOsBundle => macos::app::bundle_project(settings)?,
@@ -119,6 +167,7 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<Bundle>> {
#[cfg(target_os = "windows")]
PackageType::WindowsMsi => windows::msi::bundle_project(settings, false)?,
// note: don't restrict to windows as NSIS installers can be built in linux using cargo-xwin
PackageType::Nsis => windows::nsis::bundle_project(settings, false)?,
#[cfg(target_os = "linux")]
@@ -137,6 +186,14 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<Bundle>> {
package_type: package_type.to_owned(),
bundle_paths,
});
// Restore unsigned and unpatched binary
let mut modified_main_binary = std::fs::OpenOptions::new()
.write(true)
.truncate(true)
.open(&main_binary_path)?;
main_binary_copy.seek(SeekFrom::Start(0))?;
std::io::copy(&mut main_binary_copy, &mut modified_main_binary)?;
}
if let Some(updater) = settings.updater() {
@@ -168,49 +225,51 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<Bundle>> {
)
})
{
log::warn!("The bundler was configured to create updater artifacts but no updater-enabled targets were built. Please enable one of these targets: app, appimage, msi, nsis");
log::warn!(
"The bundler was configured to create updater artifacts but no updater-enabled targets were built. Please enable one of these targets: app, appimage, msi, nsis"
);
}
if updater.v1_compatible {
log::warn!("Legacy v1 compatible updater is deprecated and will be removed in v3, change bundle > createUpdaterArtifacts to true when your users are updated to the version with v2 updater plugin");
log::warn!(
"Legacy v1 compatible updater is deprecated and will be removed in v3, change bundle > createUpdaterArtifacts to true when your users are updated to the version with v2 updater plugin"
);
}
}
#[cfg(target_os = "macos")]
{
// Clean up .app if only building dmg or updater
if !package_types.contains(&PackageType::MacOsBundle) {
if let Some(app_bundle_paths) = bundles
if !package_types.contains(&PackageType::MacOsBundle)
&& let Some(app_bundle_paths) = bundles
.iter()
.position(|b| b.package_type == PackageType::MacOsBundle)
.map(|i| bundles.remove(i))
.map(|b| b.bundle_paths)
{
for app_bundle_path in &app_bundle_paths {
log::info!(action = "Cleaning"; "{}", app_bundle_path.display());
match app_bundle_path.is_dir() {
true => std::fs::remove_dir_all(app_bundle_path),
false => std::fs::remove_file(app_bundle_path),
}
.with_context(|| {
format!(
"Failed to clean the app bundle at {}",
app_bundle_path.display()
)
})?
{
for app_bundle_path in &app_bundle_paths {
use crate::error::ErrorExt;
log::info!(action = "Cleaning"; "{}", app_bundle_path.display());
match app_bundle_path.is_dir() {
true => std::fs::remove_dir_all(app_bundle_path),
false => std::fs::remove_file(app_bundle_path),
}
.fs_context(
"failed to clean the app bundle",
app_bundle_path.to_path_buf(),
)?;
}
}
}
if bundles.is_empty() {
return Err(anyhow::anyhow!("No bundles were built").into());
return Ok(bundles);
}
let bundles_wo_updater = bundles
let finished_bundles = bundles
.iter()
.filter(|b| b.package_type != PackageType::Updater)
.collect::<Vec<_>>();
let finished_bundles = bundles_wo_updater.len();
.count();
let pluralised = if finished_bundles == 1 {
"bundle"
} else {
@@ -235,6 +294,53 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<Bundle>> {
Ok(bundles)
}
fn sign_binaries_if_needed(settings: &Settings, target_os: &TargetPlatform) -> crate::Result<()> {
if matches!(target_os, TargetPlatform::Windows) {
if settings.windows().can_sign() {
if settings.no_sign() {
log::warn!("Skipping binary signing due to --no-sign flag.");
return Ok(());
}
for bin in settings.binaries() {
if bin.main() {
// we will sign the main binary after patching per "package type"
continue;
}
let bin_path = settings.binary_path(bin);
windows::sign::try_sign(&bin_path, settings)?;
}
// Sign the sidecar binaries
for bin in settings.external_binaries() {
let path = bin?;
let skip = std::env::var("TAURI_SKIP_SIDECAR_SIGNATURE_CHECK").is_ok_and(|v| v == "true");
if skip {
continue;
}
#[cfg(windows)]
if windows::sign::verify(&path)? {
log::info!(
"sidecar at \"{}\" already signed. Skipping...",
path.display()
);
continue;
}
windows::sign::try_sign(&path, settings)?;
}
} else {
#[cfg(not(target_os = "windows"))]
log::warn!(
"Signing, by default, is only supported on Windows hosts, but you can specify a custom signing command in `bundler > windows > sign_command`, for now, skipping signing the installer..."
);
}
}
Ok(())
}
/// Check to see if there are icons in the settings struct
pub fn check_icons(settings: &Settings) -> crate::Result<bool> {
// make a peekable iterator of the icon_files

View File

@@ -0,0 +1,61 @@
// Copyright 2016-2019 Cargo-Bundle developers <https://github.com/burtonageo/cargo-bundle>
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
// Knuth-Morris-Pratt algorithm
// based on https://github.com/howeih/rust_kmp
#[cfg(any(target_os = "linux", target_os = "windows"))]
pub fn index_of(pattern: &[u8], target: &[u8]) -> Option<usize> {
let failure_function = find_failure_function(pattern);
let mut t_i: usize = 0;
let mut p_i: usize = 0;
let target_len = target.len();
let mut result_idx = None;
let pattern_len = pattern.len();
while (t_i < target_len) && (p_i < pattern_len) {
if target[t_i] == pattern[p_i] {
if result_idx.is_none() {
result_idx.replace(t_i);
}
t_i += 1;
p_i += 1;
if p_i >= pattern_len {
return result_idx;
}
} else {
if p_i == 0 {
p_i = 0;
t_i += 1;
} else {
p_i = failure_function[p_i - 1];
}
result_idx = None;
}
}
None
}
#[cfg(any(target_os = "linux", target_os = "windows"))]
fn find_failure_function(pattern: &[u8]) -> Vec<usize> {
let mut i = 1;
let mut j = 0;
let pattern_length = pattern.len();
let end_i = pattern_length - 1;
let mut failure_function = vec![0usize; pattern_length];
while i <= end_i {
if pattern[i] == pattern[j] {
failure_function[i] = j + 1;
i += 1;
j += 1;
} else if j == 0 {
failure_function[i] = 0;
i += 1;
} else {
j = failure_function[j - 1];
}
}
failure_function
}

View File

@@ -0,0 +1,165 @@
#! /bin/bash
# abort on all errors
set -e
if [ "$DEBUG" != "" ]; then
set -x
fi
script=$(readlink -f "$0")
show_usage() {
echo "Usage: $script --appdir <path to AppDir>"
echo
echo "Bundles GStreamer plugins into an AppDir"
echo
echo "Required variables:"
echo " LINUXDEPLOY=\".../linuxdeploy\" path to linuxdeploy (e.g., AppImage); set automatically when plugin is run directly by linuxdeploy"
echo
echo "Optional variables:"
echo " GSTREAMER_INCLUDE_BAD_PLUGINS=\"1\" (default: disabled; set to empty string or unset to disable)"
echo " GSTREAMER_PLUGINS_DIR=\"...\" (directory containing GStreamer plugins; default: guessed based on main distro architecture)"
echo " GSTREAMER_HELPERS_DIR=\"...\" (directory containing GStreamer helper tools like gst-plugin-scanner; default: guessed based on main distro architecture)"
echo " GSTREAMER_VERSION=\"1.0\" (default: 1.0)"
}
while [ "$1" != "" ]; do
case "$1" in
--plugin-api-version)
echo "0"
exit 0
;;
--appdir)
APPDIR="$2"
shift
shift
;;
--help)
show_usage
exit 0
;;
*)
echo "Invalid argument: $1"
echo
show_usage
exit 1
;;
esac
done
if [ "$APPDIR" == "" ]; then
show_usage
exit 1
fi
if ! which patchelf &>/dev/null && ! type patchelf &>/dev/null; then
echo "Error: patchelf not found"
echo
show_usage
exit 2
fi
if [[ "$LINUXDEPLOY" == "" ]]; then
echo "Error: \$LINUXDEPLOY not set"
echo
show_usage
exit 3
fi
mkdir -p "$APPDIR"
export GSTREAMER_VERSION="${GSTREAMER_VERSION:-1.0}"
plugins_target_dir="$APPDIR"/usr/lib/gstreamer-"$GSTREAMER_VERSION"
helpers_target_dir="$APPDIR"/usr/lib/gstreamer"$GSTREAMER_VERSION"/gstreamer-"$GSTREAMER_VERSION"
if [ "$GSTREAMER_PLUGINS_DIR" != "" ]; then
plugins_dir="${GSTREAMER_PLUGINS_DIR}"
elif [ -d /usr/lib/"$(uname -m)"-linux-gnu/gstreamer-"$GSTREAMER_VERSION" ]; then
plugins_dir=/usr/lib/$(uname -m)-linux-gnu/gstreamer-"$GSTREAMER_VERSION"
else
plugins_dir=/usr/lib/gstreamer-"$GSTREAMER_VERSION"
fi
if [ "$GSTREAMER_HELPERS_DIR" != "" ]; then
helpers_dir="${GSTREAMER_HELPERS_DIR}"
else
helpers_dir=/usr/lib/$(uname -m)-linux-gnu/gstreamer"$GSTREAMER_VERSION"/gstreamer-"$GSTREAMER_VERSION"
fi
if [ ! -d "$plugins_dir" ]; then
echo "Error: could not find plugins directory: $plugins_dir"
exit 1
fi
mkdir -p "$plugins_target_dir"
echo "Copying plugins into $plugins_target_dir"
for i in "$plugins_dir"/*; do
[ -d "$i" ] && continue
[ ! -f "$i" ] && echo "File does not exist: $i" && continue
echo "Copying plugin: $i"
cp "$i" "$plugins_target_dir"
done
"$LINUXDEPLOY" --appdir "$APPDIR"
for i in "$plugins_target_dir"/*; do
[ -d "$i" ] && continue
[ ! -f "$i" ] && echo "File does not exist: $i" && continue
(file "$i" | grep -v ELF --silent) && echo "Ignoring non ELF file: $i" && continue
echo "Manually setting rpath for $i"
patchelf --set-rpath '$ORIGIN/..:$ORIGIN' "$i"
done
mkdir -p "$helpers_target_dir"
echo "Copying helpers in $helpers_target_dir"
for i in "$helpers_dir"/*; do
[ -d "$i" ] && continue
[ ! -f "$i" ] && echo "File does not exist: $i" && continue
echo "Copying helper: $i"
cp "$i" "$helpers_target_dir"
done
for i in "$helpers_target_dir"/*; do
[ -d "$i" ] && continue
[ ! -f "$i" ] && echo "File does not exist: $i" && continue
(file "$i" | grep -v ELF --silent) && echo "Ignoring non ELF file: $i" && continue
echo "Manually setting rpath for $i"
patchelf --set-rpath '$ORIGIN/../..' "$i"
done
echo "Installing AppRun hook"
mkdir -p "$APPDIR"/apprun-hooks
if [ "$GSTREAMER_VERSION" == "1.0" ]; then
cat > "$APPDIR"/apprun-hooks/linuxdeploy-plugin-gstreamer.sh <<\EOF
#! /bin/bash
export GST_REGISTRY_REUSE_PLUGIN_SCANNER="no"
export GST_PLUGIN_SYSTEM_PATH_1_0="${APPDIR}/usr/lib/gstreamer-1.0"
export GST_PLUGIN_PATH_1_0="${APPDIR}/usr/lib/gstreamer-1.0"
export GST_PLUGIN_SCANNER_1_0="${APPDIR}/usr/lib/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner"
export GST_PTP_HELPER_1_0="${APPDIR}/usr/lib/gstreamer1.0/gstreamer-1.0/gst-ptp-helper"
EOF
elif [ "$GSTREAMER_VERSION" == "0.10" ]; then
cat > "$APPDIR"/apprun-hooks/linuxdeploy-plugin-gstreamer.sh <<\EOF
#! /bin/bash
export GST_REGISTRY_REUSE_PLUGIN_SCANNER="no"
export GST_PLUGIN_SYSTEM_PATH_0_10="${APPDIR}/usr/lib/gstreamer-1.0"
export GST_PLUGIN_SCANNER_0_10="${APPDIR}/usr/lib/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner"
export GST_PTP_HELPER_0_10="${APPDIR}/usr/lib/gstreamer1.0/gstreamer-1.0/gst-ptp-helper"
EOF
else
echo "Warning: unknown GStreamer version: $GSTREAMER_VERSION, cannot install AppRun hook"
fi

View File

@@ -0,0 +1,327 @@
#! /usr/bin/env bash
# GTK3 environment variables: https://docs.gtk.org/gtk3/running.html
# GTK4 environment variables: https://docs.gtk.org/gtk4/running.html
# abort on all errors
set -e
if [ "$DEBUG" != "" ]; then
set -x
verbose="--verbose"
fi
script=$(readlink -f "$0")
show_usage() {
echo "Usage: $script --appdir <path to AppDir>"
echo
echo "Bundles resources for applications that use GTK into an AppDir"
echo
echo "Required variables:"
echo " LINUXDEPLOY=\".../linuxdeploy\" path to linuxdeploy (e.g., AppImage); set automatically when plugin is run directly by linuxdeploy"
#echo
#echo "Optional variables:"
#echo " DEPLOY_GTK_VERSION (major version of GTK to deploy, e.g. '2', '3' or '4'; auto-detect by default)"
}
variable_is_true() {
local var="$1"
if [ -n "$var" ] && { [ "$var" == "true" ] || [ "$var" -gt 0 ]; } 2> /dev/null; then
return 0 # true
else
return 1 # false
fi
}
get_pkgconf_variable() {
local variable="$1"
local library="$2"
local default_path="$3"
path="$("$PKG_CONFIG" --variable="$variable" "$library")"
if [ -n "$path" ]; then
echo "$path"
elif [ -n "$default_path" ]; then
echo "$default_path"
else
echo "$0: there is no '$variable' variable for '$library' library." > /dev/stderr
echo "Please check the '$library.pc' file is present in \$PKG_CONFIG_PATH (you may need to install the appropriate -dev/-devel package)." > /dev/stderr
exit 1
fi
}
copy_tree() {
local src=("${@:1:$#-1}")
local dst="${*:$#}"
for elem in "${src[@]}"; do
mkdir -p "${dst::-1}$elem"
cp "$elem" --archive --parents --target-directory="$dst" $verbose
done
}
search_tool() {
local tool="$1"
local directory="$2"
if command -v "$tool"; then
return 0
fi
PATH_ARRAY=(
"/usr/lib/$(uname -m)-linux-gnu/$directory/$tool"
"/usr/lib/$directory/$tool"
"/usr/bin/$tool"
"/usr/bin/$tool-64"
"/usr/bin/$tool-32"
)
for path in "${PATH_ARRAY[@]}"; do
if [ -x "$path" ]; then
echo "$path"
return 0
fi
done
}
#DEPLOY_GTK_VERSION="${DEPLOY_GTK_VERSION:-0}" # When not set by user, this variable use the integer '0' as a sentinel value
DEPLOY_GTK_VERSION=3 # Force GTK3 for tauri apps
APPDIR=
while [ "$1" != "" ]; do
case "$1" in
--plugin-api-version)
echo "0"
exit 0
;;
--appdir)
APPDIR="$2"
shift
shift
;;
--help)
show_usage
exit 0
;;
*)
echo "Invalid argument: $1"
echo
show_usage
exit 1
;;
esac
done
if [ "$APPDIR" == "" ]; then
show_usage
exit 1
fi
mkdir -p "$APPDIR"
# make lib64 writable again.
chmod +w "$APPDIR"/usr/lib64 || true
if command -v pkgconf > /dev/null; then
PKG_CONFIG="pkgconf"
elif command -v pkg-config > /dev/null; then
PKG_CONFIG="pkg-config"
else
echo "$0: pkg-config/pkgconf not found in PATH, aborting"
exit 1
fi
if ! command -v find &>/dev/null && ! type find &>/dev/null; then
echo -e "$0: find not found.\nInstall findutils then re-run the plugin."
exit 1
fi
if [ -z "$LINUXDEPLOY" ]; then
echo -e "$0: LINUXDEPLOY environment variable is not set.\nDownload a suitable linuxdeploy AppImage, set the environment variable and re-run the plugin."
exit 1
fi
gtk_versions=0 # Count major versions of GTK when auto-detect GTK version
if [ "$DEPLOY_GTK_VERSION" -eq 0 ]; then
echo "Determining which GTK version to deploy"
while IFS= read -r -d '' file; do
if [ "$DEPLOY_GTK_VERSION" -ne 2 ] && ldd "$file" | grep -q "libgtk-x11-2.0.so"; then
DEPLOY_GTK_VERSION=2
gtk_versions="$((gtk_versions+1))"
fi
if [ "$DEPLOY_GTK_VERSION" -ne 3 ] && ldd "$file" | grep -q "libgtk-3.so"; then
DEPLOY_GTK_VERSION=3
gtk_versions="$((gtk_versions+1))"
fi
if [ "$DEPLOY_GTK_VERSION" -ne 4 ] && ldd "$file" | grep -q "libgtk-4.so"; then
DEPLOY_GTK_VERSION=4
gtk_versions="$((gtk_versions+1))"
fi
done < <(find "$APPDIR/usr/bin" -executable -type f -print0)
fi
if [ "$gtk_versions" -gt 1 ]; then
echo "$0: can not deploy multiple GTK versions at the same time."
echo "Please set DEPLOY_GTK_VERSION to {2, 3, 4}."
exit 1
elif [ "$DEPLOY_GTK_VERSION" -eq 0 ]; then
echo "$0: failed to auto-detect GTK version."
echo "Please set DEPLOY_GTK_VERSION to {2, 3, 4}."
exit 1
fi
echo "Installing AppRun hook"
HOOKSDIR="$APPDIR/apprun-hooks"
HOOKFILE="$HOOKSDIR/linuxdeploy-plugin-gtk.sh"
mkdir -p "$HOOKSDIR"
cat > "$HOOKFILE" <<\EOF
#! /usr/bin/env bash
gsettings get org.gnome.desktop.interface gtk-theme 2> /dev/null | grep -qi "dark" && GTK_THEME_VARIANT="dark" || GTK_THEME_VARIANT="light"
APPIMAGE_GTK_THEME="${APPIMAGE_GTK_THEME:-"Adwaita:$GTK_THEME_VARIANT"}" # Allow user to override theme (discouraged)
export APPDIR="${APPDIR:-"$(dirname "$(realpath "$0")")"}" # Workaround to run extracted AppImage
export GTK_DATA_PREFIX="$APPDIR"
export GTK_THEME="$APPIMAGE_GTK_THEME" # Custom themes are broken
export GDK_BACKEND=x11 # Crash with Wayland backend on Wayland - We tested it without it and ended up with this: https://github.com/tauri-apps/tauri/issues/8541
export XDG_DATA_DIRS="$APPDIR/usr/share:/usr/share:$XDG_DATA_DIRS" # g_get_system_data_dirs() from GLib
EOF
echo "Installing GLib schemas"
# Note: schemasdir is undefined on Ubuntu 16.04
glib_schemasdir="$(get_pkgconf_variable "schemasdir" "gio-2.0" "/usr/share/glib-2.0/schemas")"
copy_tree "$glib_schemasdir" "$APPDIR/"
glib-compile-schemas "$APPDIR/$glib_schemasdir"
cat >> "$HOOKFILE" <<EOF
export GSETTINGS_SCHEMA_DIR="\$APPDIR/$glib_schemasdir"
EOF
case "$DEPLOY_GTK_VERSION" in
2)
# https://github.com/linuxdeploy/linuxdeploy-plugin-gtk/pull/20#issuecomment-826354261
echo "WARNING: Gtk+2 applications are not fully supported by this plugin"
;;
3)
echo "Installing GTK 3.0 modules"
gtk3_exec_prefix="$(get_pkgconf_variable "exec_prefix" "gtk+-3.0")"
gtk3_libdir="$(get_pkgconf_variable "libdir" "gtk+-3.0")/gtk-3.0"
#gtk3_path="$gtk3_libdir/modules" export GTK_PATH="\$APPDIR/$gtk3_path"
gtk3_immodulesdir="$gtk3_libdir/$(get_pkgconf_variable "gtk_binary_version" "gtk+-3.0")/immodules"
gtk3_printbackendsdir="$gtk3_libdir/$(get_pkgconf_variable "gtk_binary_version" "gtk+-3.0")/printbackends"
gtk3_immodules_cache_file="$(dirname "$gtk3_immodulesdir")/immodules.cache"
gtk3_immodules_query="$(search_tool "gtk-query-immodules-3.0" "libgtk-3-0")"
copy_tree "$gtk3_libdir" "$APPDIR/"
cat >> "$HOOKFILE" <<EOF
export GTK_EXE_PREFIX="\$APPDIR/$gtk3_exec_prefix"
export GTK_PATH="\$APPDIR/$gtk3_libdir:/usr/lib64/gtk-3.0:/usr/lib/x86_64-linux-gnu/gtk-3.0"
export GTK_IM_MODULE_FILE="\$APPDIR/$gtk3_immodules_cache_file"
EOF
if [ -x "$gtk3_immodules_query" ]; then
echo "Updating immodules cache in $APPDIR/$gtk3_immodules_cache_file"
"$gtk3_immodules_query" > "$APPDIR/$gtk3_immodules_cache_file"
else
echo "WARNING: gtk-query-immodules-3.0 not found"
fi
if [ ! -f "$APPDIR/$gtk3_immodules_cache_file" ]; then
echo "WARNING: immodules.cache file is missing"
fi
sed -i "s|$gtk3_libdir/3.0.0/immodules/||g" "$APPDIR/$gtk3_immodules_cache_file"
;;
4)
echo "Installing GTK 4.0 modules"
gtk4_exec_prefix="$(get_pkgconf_variable "exec_prefix" "gtk4" "/usr")"
gtk4_libdir="$(get_pkgconf_variable "libdir" "gtk4")/gtk-4.0"
gtk4_path="$gtk4_libdir/modules"
copy_tree "$gtk4_libdir" "$APPDIR/"
cat >> "$HOOKFILE" <<EOF
export GTK_EXE_PREFIX="\$APPDIR/$gtk4_exec_prefix"
export GTK_PATH="\$APPDIR/$gtk4_path"
EOF
;;
*)
echo "$0: '$DEPLOY_GTK_VERSION' is not a valid GTK major version."
echo "Please set DEPLOY_GTK_VERSION to {2, 3, 4}."
exit 1
esac
echo "Installing GDK PixBufs"
gdk_libdir="$(get_pkgconf_variable "libdir" "gdk-pixbuf-2.0")"
gdk_pixbuf_binarydir="$(get_pkgconf_variable "gdk_pixbuf_binarydir" "gdk-pixbuf-2.0")"
gdk_pixbuf_cache_file="$(get_pkgconf_variable "gdk_pixbuf_cache_file" "gdk-pixbuf-2.0")"
gdk_pixbuf_moduledir="$(get_pkgconf_variable "gdk_pixbuf_moduledir" "gdk-pixbuf-2.0")"
# Note: gdk_pixbuf_query_loaders variable is not defined on some systems
gdk_pixbuf_query="$(search_tool "gdk-pixbuf-query-loaders" "gdk-pixbuf-2.0")"
copy_tree "$gdk_pixbuf_binarydir" "$APPDIR/"
cat >> "$HOOKFILE" <<EOF
export GDK_PIXBUF_MODULE_FILE="\$APPDIR/$gdk_pixbuf_cache_file"
EOF
if [ -x "$gdk_pixbuf_query" ]; then
echo "Updating pixbuf cache in $APPDIR/$gdk_pixbuf_cache_file"
"$gdk_pixbuf_query" > "$APPDIR/$gdk_pixbuf_cache_file"
else
echo "WARNING: gdk-pixbuf-query-loaders not found"
fi
if [ ! -f "$APPDIR/$gdk_pixbuf_cache_file" ]; then
echo "WARNING: loaders.cache file is missing"
fi
sed -i "s|$gdk_pixbuf_moduledir/||g" "$APPDIR/$gdk_pixbuf_cache_file"
echo "Copying more libraries"
gobject_libdir="$(get_pkgconf_variable "libdir" "gobject-2.0")"
gio_libdir="$(get_pkgconf_variable "libdir" "gio-2.0")"
librsvg_libdir="$(get_pkgconf_variable "libdir" "librsvg-2.0")"
pango_libdir="$(get_pkgconf_variable "libdir" "pango")"
pangocairo_libdir="$(get_pkgconf_variable "libdir" "pangocairo")"
pangoft2_libdir="$(get_pkgconf_variable "libdir" "pangoft2")"
FIND_ARRAY=(
"$gdk_libdir" "libgdk_pixbuf-*.so*"
"$gobject_libdir" "libgobject-*.so*"
"$gio_libdir" "libgio-*.so*"
"$librsvg_libdir" "librsvg-*.so*"
"$pango_libdir" "libpango-*.so*"
"$pangocairo_libdir" "libpangocairo-*.so*"
"$pangoft2_libdir" "libpangoft2-*.so*"
)
LIBRARIES=()
for (( i=0; i<${#FIND_ARRAY[@]}; i+=2 )); do
directory=${FIND_ARRAY[i]}
library=${FIND_ARRAY[i+1]}
while IFS= read -r -d '' file; do
LIBRARIES+=( "--library=$file" )
done < <(find "$directory" \( -type l -o -type f \) -name "$library" -print0)
done
env LINUXDEPLOY_PLUGIN_MODE=1 "$LINUXDEPLOY" --appdir="$APPDIR" "${LIBRARIES[@]}"
# Create symbolic links as a workaround
# Details: https://github.com/linuxdeploy/linuxdeploy-plugin-gtk/issues/24#issuecomment-1030026529
echo "Manually setting rpath for GTK modules"
PATCH_ARRAY=(
"$gtk3_immodulesdir"
"$gtk3_printbackendsdir"
"$gdk_pixbuf_moduledir"
)
for directory in "${PATCH_ARRAY[@]}"; do
while IFS= read -r -d '' file; do
ln $verbose -s "${file/\/usr\/lib\//}" "$APPDIR/usr/lib"
done < <(find "$directory" -name '*.so' -print0)
done
# set write permission on lib64 again to make it deletable.
chmod +w "$APPDIR"/usr/lib64 || true
# We have to copy the files first to not get permission errors when we assign gio_extras_dir
find /usr/lib* -name libgiognutls.so -exec mkdir -p "$APPDIR"/"$(dirname '{}')" \; -exec cp --parents '{}' "$APPDIR/" \; || true
# related files that we seemingly don't need:
# libgiolibproxy.so - libgiognomeproxy.so - glib-pacrunner
gio_extras_dir=$(find "$APPDIR"/usr/lib* -name libgiognutls.so -exec dirname '{}' \; 2>/dev/null)
cat >> "$HOOKFILE" <<EOF
export GIO_EXTRA_MODULES="\$APPDIR/${gio_extras_dir#"$APPDIR"/}"
EOF
#binary patch absolute paths in libwebkit files
find "$APPDIR"/usr/lib* -name 'libwebkit*' -exec sed -i -e "s|/usr|././|g" '{}' \;

View File

@@ -3,13 +3,13 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
use super::debian;
use super::{super::debian, write_and_make_executable};
use crate::{
bundle::settings::Arch,
utils::{fs_utils, http_utils::download, CommandExt},
Settings,
bundle::settings::Arch,
error::{Context, ErrorExt},
utils::{CommandExt, fs_utils, http_utils::download},
};
use anyhow::Context;
use std::{
fs,
path::{Path, PathBuf},
@@ -27,13 +27,17 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
Arch::Armhf => "armhf",
target => {
return Err(crate::Error::ArchError(format!(
"Unsupported architecture: {:?}",
target
"Unsupported architecture: {target:?}"
)));
}
};
let tools_arch = settings.target().split('-').next().unwrap();
let tools_arch = if settings.binary_arch() == Arch::Armhf {
"armhf"
} else {
settings.target().split('-').next().unwrap()
};
let output_path = settings.project_out_directory().join("bundle/appimage");
if output_path.exists() {
fs::remove_dir_all(&output_path)?;
@@ -48,7 +52,11 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
fs::create_dir_all(&tools_path)?;
let linuxdeploy_path = prepare_tools(&tools_path, tools_arch)?;
let linuxdeploy_path = prepare_tools(
&tools_path,
tools_arch,
settings.log_level() != log::Level::Error,
)?;
let package_dir = settings.project_out_directory().join("bundle/appimage_deb");
@@ -116,13 +124,13 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
// xdg-open will be handled by the `files` config instead
if settings.deep_link_protocols().is_some() && !app_dir_usr_bin.join("xdg-open").exists() {
fs::copy("/usr/bin/xdg-mime", app_dir_usr_bin.join("xdg-mime"))
.context("xdg-mime binary not found")?;
.fs_context("xdg-mime binary not found", "/usr/bin/xdg-mime".to_string())?;
}
// we also check if the user may have provided their own copy already
if settings.appimage().bundle_xdg_open && !app_dir_usr_bin.join("xdg-open").exists() {
fs::copy("/usr/bin/xdg-open", app_dir_usr_bin.join("xdg-open"))
.context("xdg-open binary not found")?;
.fs_context("xdg-open binary not found", "/usr/bin/xdg-open".to_string())?;
}
let search_dirs = [
@@ -181,6 +189,9 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
let mut cmd = Command::new(linuxdeploy_path);
cmd.env("OUTPUT", &appimage_path);
cmd.env("ARCH", tools_arch);
// Looks like the cli arg isn't enough for the updated AppImage output-plugin.
cmd.env("APPIMAGE_EXTRACT_AND_RUN", "1");
cmd.args([
"--appimage-extract-and-run",
"--verbosity",
@@ -212,11 +223,11 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
}
// returns the linuxdeploy path to keep linuxdeploy_arch contained
fn prepare_tools(tools_path: &Path, arch: &str) -> crate::Result<PathBuf> {
fn prepare_tools(tools_path: &Path, arch: &str, verbose: bool) -> crate::Result<PathBuf> {
let apprun = tools_path.join(format!("AppRun-{arch}"));
if !apprun.exists() {
let data = download(&format!(
"https://github.com/AppImage/AppImageKit/releases/download/continuous/AppRun-{arch}"
"https://github.com/tauri-apps/binary-releases/releases/download/apprun-old/AppRun-{arch}"
))?;
write_and_make_executable(&apprun, data)?;
}
@@ -224,22 +235,45 @@ fn prepare_tools(tools_path: &Path, arch: &str) -> crate::Result<PathBuf> {
let linuxdeploy_arch = if arch == "i686" { "i383" } else { arch };
let linuxdeploy = tools_path.join(format!("linuxdeploy-{linuxdeploy_arch}.AppImage"));
if !linuxdeploy.exists() {
let data = download(&format!("https://github.com/tauri-apps/binary-releases/releases/download/linuxdeploy/linuxdeploy-{linuxdeploy_arch}.AppImage"))?;
let data = download(&format!(
"https://github.com/tauri-apps/binary-releases/releases/download/linuxdeploy/linuxdeploy-{linuxdeploy_arch}.AppImage"
))?;
write_and_make_executable(&linuxdeploy, data)?;
}
let gtk = tools_path.join("linuxdeploy-plugin-gtk.sh");
if !gtk.exists() {
let data = download("https://raw.githubusercontent.com/tauri-apps/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh")?;
let data = download(
"https://raw.githubusercontent.com/tauri-apps/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh",
)?;
write_and_make_executable(&gtk, data)?;
}
let gstreamer = tools_path.join("linuxdeploy-plugin-gstreamer.sh");
if !gstreamer.exists() {
let data = download("https://raw.githubusercontent.com/tauri-apps/linuxdeploy-plugin-gstreamer/master/linuxdeploy-plugin-gstreamer.sh")?;
let data = download(
"https://raw.githubusercontent.com/tauri-apps/linuxdeploy-plugin-gstreamer/master/linuxdeploy-plugin-gstreamer.sh",
)?;
write_and_make_executable(&gstreamer, data)?;
}
let appimage = tools_path.join("linuxdeploy-plugin-appimage.AppImage");
if !appimage.exists() {
// This is optional, linuxdeploy will fall back to its built-in version if the download failed.
let data = download(&format!(
"https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-{arch}.AppImage"
));
match data {
Ok(data) => write_and_make_executable(&appimage, data)?,
Err(err) => {
log::error!("Download of AppImage plugin failed. Using older built-in version instead.");
if verbose {
log::debug!("{err:?}");
}
}
}
}
// This should prevent linuxdeploy to be detected by appimage integration tools
let _ = Command::new("dd")
.args([
@@ -254,12 +288,3 @@ fn prepare_tools(tools_path: &Path, arch: &str) -> crate::Result<PathBuf> {
Ok(linuxdeploy)
}
fn write_and_make_executable(path: &Path, data: Vec<u8>) -> std::io::Result<()> {
use std::os::unix::fs::PermissionsExt;
fs::write(path, data)?;
fs::set_permissions(path, fs::Permissions::from_mode(0o770))?;
Ok(())
}

View File

@@ -0,0 +1,31 @@
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
use std::{
fs,
path::{Path, PathBuf},
};
use crate::Settings;
mod linuxdeploy;
mod sharun_cef;
// TODO: Consider auto fallback to linuxdeploy on unsupported systems.
pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
if settings.bundle_settings().cef_path.is_some() {
sharun_cef::bundle_project(settings)
} else {
linuxdeploy::bundle_project(settings)
}
}
fn write_and_make_executable(path: &Path, data: Vec<u8>) -> std::io::Result<()> {
use std::os::unix::fs::PermissionsExt;
fs::write(path, data)?;
fs::set_permissions(path, fs::Permissions::from_mode(0o770))?;
Ok(())
}

View File

@@ -0,0 +1,207 @@
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
use std::{fs, path::PathBuf, process::Command};
use anyhow::Context;
use crate::{
Settings,
bundle::{linux::debian, settings::Arch},
utils::{CommandExt, fs_utils, http_utils::download},
};
use super::write_and_make_executable;
// TODO: Test if bundling xdg-mime makes sense (eg does it even work if it's not on the host system?)
// TODO: Monitor TLS support / certificates - seems to be working in initial tests
pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
// for backwards compat we keep the amd64 and i386 rewrites in the filename
let appimage_arch = match settings.binary_arch() {
Arch::X86_64 => "amd64",
//Arch::X86 => "i386",
Arch::AArch64 => "aarch64",
//Arch::Armhf => "armhf",
target => {
return Err(crate::Error::ArchError(format!(
"Unsupported architecture: {target:?}"
)));
}
};
//let tools_arch = settings.target().split('-').next().unwrap();
let output_path = settings.project_out_directory().join("bundle/appimage");
if output_path.exists() {
fs::remove_dir_all(&output_path)?;
}
let tools_path = settings
.local_tools_directory()
.map(|d| d.join(".tauri"))
.unwrap_or_else(|| {
dirs::cache_dir().map_or_else(|| output_path.to_path_buf(), |p| p.join("tauri"))
});
fs::create_dir_all(&tools_path)?;
// TODO: mirror
let quick_sharun = tools_path.join("quick-sharun.sh");
if !quick_sharun.exists() {
let data = download(
"https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/quick-sharun.sh",
)?;
write_and_make_executable(&quick_sharun, data)?;
}
let package_dir = settings
.project_out_directory()
.join("bundle/appimage_deb/");
let main_binary = settings.main_binary()?;
let product_name = settings.product_name();
let mut settings = settings.clone();
if main_binary.name().contains(' ') {
let main_binary_path = settings.binary_path(main_binary);
let project_out_dir = settings.project_out_directory();
let main_binary_name_kebab = heck::AsKebabCase(main_binary.name()).to_string();
let new_path = project_out_dir.join(&main_binary_name_kebab);
fs::copy(main_binary_path, new_path)?;
let main_binary = settings.main_binary_mut()?;
main_binary.set_name(main_binary_name_kebab);
}
// generate deb_folder structure
let (data_dir, icons) = debian::generate_data(&settings, &package_dir)
.with_context(|| "Failed to build data folders and files")?;
fs_utils::copy_custom_files(&settings.appimage().files, &data_dir)
.with_context(|| "Failed to copy custom files")?;
fs::create_dir_all(data_dir.join("usr/bin/"))?;
fs::create_dir_all(data_dir.join("usr/lib/"))?;
fs::create_dir_all(data_dir.join("usr/lib/locales"))?;
let cef_path = settings
.bundle_settings()
.cef_path
.clone()
.expect("this module is only called when cef_path is set");
let cef_files = [
// required
"libcef.so",
"icudtl.dat",
"v8_context_snapshot.bin",
// required end
// "optional" - but not really since we want support for all of this
"chrome_100_percent.pak",
"chrome_200_percent.pak",
"resources.pak",
// ANGEL support
"libEGL.so",
"libGLESv2.so",
// SwANGLE support
"libvk_swiftshader.so",
"vk_swiftshader_icd.json",
"libvulkan.so.1",
// sandbox - may need to be behind a setting?
"chrome-sandbox",
// TODO: seccomp
];
for f in cef_files {
let dest = if f == "chrome-sandbox" {
data_dir.join("usr/bin/").join(f)
} else {
data_dir.join("usr/lib/").join(f)
};
fs::copy(cef_path.join(f), &dest)?;
let _ = Command::new("strip").arg(&dest).output_ok();
}
let locales = [
"en-US.pak",
"en-US_FEMININE.pak",
"en-US_MASCULINE.pak",
"en-US_NEUTER.pak",
];
for f in locales {
fs::copy(
cef_path.join("locales").join(f),
data_dir.join("usr/lib/locales").join(f),
)?;
}
fs::create_dir_all(&output_path)?;
let app_dir_path = output_path.join(format!("{}.AppDir", settings.product_name()));
let appimage_filename = format!(
"{}_{}_{appimage_arch}.AppImage",
settings.product_name(),
settings.version_string()
);
let appimage_path = output_path.join(&appimage_filename);
fs::create_dir_all(&tools_path)?;
let larger_icon = icons
.iter()
.filter(|i| i.width == i.height)
.max_by_key(|i| i.width)
.expect("couldn't find a square icon to use as AppImage icon");
log::info!(action = "Bundling"; "{} ({})", appimage_filename, appimage_path.display());
// TODO:
let _verbosity = match settings.log_level() {
log::Level::Error => "-q", // errors only
log::Level::Info => "", // errors + "normal logs" (mostly rpath)
log::Level::Trace => "-v", // You can expect way over 1k lines from just lib4bin on this level
_ => "",
};
let bins = settings.copy_binaries(&app_dir_path.join("usr/bin/"))?;
let bins = bins
.iter()
.map(|b| format!(" \"{}\"", b.to_string_lossy()))
.collect::<String>();
// TODO: Consider to not rely on quick-sharun when we have more time
Command::new("/bin/sh")
.current_dir(&output_path)
.env("APPDIR", &app_dir_path)
.env("OUTNAME", &appimage_filename)
.env(
"DESKTOP",
data_dir.join(format!("usr/share/applications/{product_name}.desktop")),
)
.env("ICON", &larger_icon.path)
.env("OUTPUT_APPIMAGE", "1")
.env("URUNTIME2APPIMAGE_SOURCE", "https://raw.githubusercontent.com/FabianLars/Anylinux-AppImages/refs/heads/main/useful-tools/uruntime2appimage.sh")
.env("DEPLOY_CHROMIUM", "1")
.env("ADD_HOOKS", "fix-namespaces.hook")
.args([
"-c",
&format!(
r#""{}" "{}" {bins} "{}" "{}""#,
quick_sharun.to_string_lossy(),
data_dir
.join(format!("usr/bin/{}", main_binary.name()))
.to_string_lossy(),
// TODO: This may have to be in lib instead
data_dir.join("usr/bin/chrome-sandbox").to_string_lossy(),
data_dir.join("usr/lib/").to_string_lossy()
),
])
.output_ok()
.context("quick-sharun command failed to run.")?;
{
use std::os::unix::fs::PermissionsExt;
fs::set_permissions(&appimage_path, fs::Permissions::from_mode(0o770)).expect("perms");
}
fs::remove_dir_all(package_dir).expect("rmdir");
Ok(vec![appimage_path])
}

View File

@@ -24,17 +24,22 @@
// generate postinst or prerm files.
use super::freedesktop;
use crate::{bundle::settings::Arch, utils::fs_utils, Settings};
use anyhow::Context;
use flate2::{write::GzEncoder, Compression};
use crate::{
Settings,
bundle::settings::Arch,
error::{Context, ErrorExt},
utils::{CommandExt, fs_utils},
};
use flate2::{Compression, write::GzEncoder};
use tar::HeaderMode;
use walkdir::WalkDir;
use std::{
fs::{self, File, OpenOptions},
io::{self, Write},
os::unix::fs::{MetadataExt, OpenOptionsExt},
os::unix::fs::{MetadataExt, OpenOptionsExt, symlink},
path::{Path, PathBuf},
process::Command,
};
/// Bundles the project.
@@ -49,8 +54,7 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
Arch::Riscv64 => "riscv64",
target => {
return Err(crate::Error::ArchError(format!(
"Unsupported architecture: {:?}",
target
"Unsupported architecture: {target:?}"
)));
}
};
@@ -65,30 +69,108 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
let base_dir = settings.project_out_directory().join("bundle/deb");
let package_dir = base_dir.join(&package_base_name);
if package_dir.exists() {
fs::remove_dir_all(&package_dir)
.with_context(|| format!("Failed to remove old {package_base_name}"))?;
fs::remove_dir_all(&package_dir).fs_context(
"Failed to Remove old package directory",
package_dir.clone(),
)?;
}
let package_path = base_dir.join(&package_name);
log::info!(action = "Bundling"; "{} ({})", package_name, package_path.display());
let (data_dir, _) = generate_data(settings, &package_dir)
.with_context(|| "Failed to build data folders and files")?;
let (data_dir, _) =
generate_data(settings, &package_dir).context("Failed to build data folders and files")?;
fs_utils::copy_custom_files(&settings.deb().files, &data_dir)
.with_context(|| "Failed to copy custom files")?;
.context("Failed to copy custom files")?;
// Handle CEF support if cef_path is set,
// using https://github.com/chromiumembedded/cef/blob/master/tools/distrib/linux/README.redistrib.txt as a reference
//
// Dealing with rpath or LD_LIBRARY_PATH is annoying so we'll somewhat follow the approach of spotify(cef) and electron apps and move the binary out of /usr/bin for now.
// This still requires adding $ORIGIN to RUNPATH, which we currently do in tauri-build.
if let Some(cef_path) = settings.bundle_settings().cef_path.as_ref() {
let share_dir = data_dir.join("usr/share").join(settings.product_name());
fs::create_dir_all(&share_dir)?;
// TODO: we may have to copy all binaries.
let main_bin = settings
.binaries()
.iter()
.find(|b| b.main())
.expect("one main binary should always exist")
.name();
fs::rename(
data_dir.join("usr/bin").join(main_bin),
share_dir.join(main_bin),
)?;
symlink(
format!("../share/{}/{main_bin}", settings.product_name()),
data_dir.join("usr/bin").join(main_bin),
)?;
let cef_files = [
// required
"libcef.so",
"icudtl.dat",
"v8_context_snapshot.bin",
// required end
// "optional" - but not really since we want support for all of this
"chrome_100_percent.pak",
"chrome_200_percent.pak",
"resources.pak",
// ANGEL support
"libEGL.so",
"libGLESv2.so",
// SwANGLE support
"libvk_swiftshader.so",
"vk_swiftshader_icd.json",
"libvulkan.so.1",
// sandbox
"chrome-sandbox",
];
for f in cef_files {
let file_dest = share_dir.join(f);
fs::copy(cef_path.join(f), &file_dest)?;
if f.ends_with(".so") {
// since libcef.so is 1.5GB unstripped we will error out if strip fails.
Command::new("strip").arg(file_dest).output_ok()?;
}
}
// TODO: Check if/when we need the other lang files
let locales = [
"en-US.pak",
"en-US_FEMININE.pak",
"en-US_MASCULINE.pak",
"en-US_NEUTER.pak",
];
let cef_path = cef_path.join("locales");
let share_dir = share_dir.join("locales");
fs::create_dir_all(&share_dir)?;
for f in locales {
fs::copy(cef_path.join(f), share_dir.join(f))?;
}
// cef_path and share_dir still point to locales!
}
// Generate control files.
let control_dir = package_dir.join("control");
generate_control_file(settings, arch, &control_dir, &data_dir)
.with_context(|| "Failed to create control file")?;
generate_scripts(settings, &control_dir).with_context(|| "Failed to create control scripts")?;
generate_md5sums(&control_dir, &data_dir).with_context(|| "Failed to create md5sums file")?;
.context("Failed to create control file")?;
generate_scripts(settings, &control_dir).context("Failed to create control scripts")?;
generate_md5sums(&control_dir, &data_dir).context("Failed to create md5sums file")?;
// Generate `debian-binary` file; see
// http://www.tldp.org/HOWTO/Debian-Binary-Package-Building-HOWTO/x60.html#AEN66
let debian_binary_path = package_dir.join("debian-binary");
create_file_with_data(&debian_binary_path, "2.0\n")
.with_context(|| "Failed to create debian-binary file")?;
.context("Failed to create debian-binary file")?;
log::info!(action = "Bundling"; "Creating .deb archive...");
// Apply tar/gzip/ar to create the final package file.
let control_tar_gz_path =
@@ -114,8 +196,9 @@ pub fn generate_data(
for bin in settings.binaries() {
let bin_path = settings.binary_path(bin);
fs_utils::copy_file(&bin_path, &bin_dir.join(bin.name()))
.with_context(|| format!("Failed to copy binary from {bin_path:?}"))?;
let trgt = bin_dir.join(bin.name());
fs_utils::copy_file(&bin_path, &trgt)
.with_context(|| format!("Failed to copy binary from {bin_path:?} to {trgt:?}"))?;
}
copy_resource_files(settings, &data_dir).with_context(|| "Failed to copy resource files")?;
@@ -164,7 +247,7 @@ fn generate_control_file(
let dest_path = control_dir.join("control");
let mut file = fs_utils::create_file(&dest_path)?;
let package = heck::AsKebabCase(settings.product_name());
writeln!(file, "Package: {}", package)?;
writeln!(file, "Package: {package}")?;
writeln!(file, "Version: {}", settings.version_string())?;
writeln!(file, "Architecture: {arch}")?;
// Installed-Size must be divided by 1024, see https://www.debian.org/doc/debian-policy/ch-controlfields.html#installed-size
@@ -183,16 +266,16 @@ fn generate_control_file(
writeln!(file, "Maintainer: {authors}")?;
if let Some(section) = &settings.deb().section {
writeln!(file, "Section: {}", section)?;
writeln!(file, "Section: {section}")?;
}
if let Some(priority) = &settings.deb().priority {
writeln!(file, "Priority: {}", priority)?;
writeln!(file, "Priority: {priority}")?;
} else {
writeln!(file, "Priority: optional")?;
}
if let Some(homepage) = settings.homepage_url() {
writeln!(file, "Homepage: {}", homepage)?;
writeln!(file, "Homepage: {homepage}")?;
}
let dependencies = settings.deb().depends.as_ref().cloned().unwrap_or_default();
@@ -305,7 +388,7 @@ fn generate_md5sums(control_dir: &Path, data_dir: &Path) -> crate::Result<()> {
let mut file = File::open(path)?;
let mut hash = md5::Context::new();
io::copy(&mut file, &mut hash)?;
for byte in hash.compute().iter() {
for byte in hash.finalize().iter() {
write!(md5sums_file, "{byte:02x}")?;
}
let rel_path = path.strip_prefix(data_dir)?;
@@ -354,17 +437,33 @@ fn create_tar_from_dir<P: AsRef<Path>, W: Write>(src_dir: P, dest_file: W) -> cr
if src_path == src_dir {
continue;
}
let dest_path = src_path.strip_prefix(src_dir)?;
let stat = fs::metadata(src_path)?;
let mut header = tar::Header::new_gnu();
header.set_metadata_in_mode(&stat, HeaderMode::Deterministic);
header.set_mtime(stat.mtime() as u64);
if entry.file_type().is_dir() {
tar_builder.append_data(&mut header, dest_path, &mut io::empty())?;
let dest_path = src_path.strip_prefix(src_dir)?;
let stat_metadata = fs::symlink_metadata(src_path)?;
// TODO: This should probably only trigger for the main binary for cef apps
if stat_metadata.is_symlink() {
let mut header = tar::Header::new_gnu();
header.set_metadata_in_mode(&stat_metadata, HeaderMode::Deterministic);
header.set_mtime(stat_metadata.mtime() as u64);
header.set_entry_type(tar::EntryType::Symlink);
let target_path = fs::read_link(src_path)?;
tar_builder.append_link(&mut header, dest_path, target_path)?;
} else {
let mut src_file = fs::File::open(src_path)?;
tar_builder.append_data(&mut header, dest_path, &mut src_file)?;
let stat = fs::metadata(src_path)?;
let mut header = tar::Header::new_gnu();
header.set_metadata_in_mode(&stat, HeaderMode::Deterministic);
header.set_mtime(stat.mtime() as u64);
if src_path.ends_with("chrome-sandbox") {
header.set_mode(0o4755);
}
if entry.file_type().is_dir() {
tar_builder.append_data(&mut header, dest_path, &mut io::empty())?;
} else {
let mut src_file = fs::File::open(src_path)?;
tar_builder.append_data(&mut header, dest_path, &mut src_file)?;
}
}
}
let dest_file = tar_builder.into_inner()?;

View File

@@ -4,6 +4,7 @@ Categories={{categories}}
Comment={{comment}}
{{/if}}
Exec={{exec}}
StartupWMClass={{exec}}
Icon={{icon}}
Name={{name}}
Terminal=false

View File

@@ -17,18 +17,18 @@
use std::collections::BTreeMap;
use std::ffi::OsStr;
use std::fs::{read_to_string, File};
use std::fs::{File, read_to_string};
use std::io::BufReader;
use std::path::{Path, PathBuf};
use anyhow::Context;
use handlebars::Handlebars;
use image::{self, codecs::png::PngDecoder, ImageDecoder};
use image::{self, ImageDecoder, codecs::png::PngDecoder};
use serde::Serialize;
use crate::{
utils::{self, fs_utils},
Settings,
error::Context,
utils::{self, fs_utils},
};
#[derive(PartialEq, Eq, PartialOrd, Ord)]
@@ -114,11 +114,13 @@ pub fn generate_desktop_file(
if let Some(template) = custom_template_path {
handlebars
.register_template_string("main.desktop", read_to_string(template)?)
.with_context(|| "Failed to setup custom handlebar template")?;
.map_err(Into::into)
.context("Failed to setup custom handlebar template")?;
} else {
handlebars
.register_template_string("main.desktop", include_str!("./main.desktop"))
.with_context(|| "Failed to setup default handlebar template")?;
.map_err(Into::into)
.context("Failed to setup default handlebar template")?;
}
#[derive(Serialize)]

View File

@@ -3,14 +3,14 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
use crate::{bundle::settings::Arch, Settings};
use crate::{Settings, bundle::settings::Arch, error::ErrorExt, utils::CommandExt};
use anyhow::Context;
use rpm::{self, signature::pgp, Dependency, FileMode, FileOptions};
use rpm::{self, Dependency, FileMode, FileOptions, signature::pgp};
use std::{
env,
fs::{self, File},
path::{Path, PathBuf},
process::Command,
};
use tauri_utils::config::RpmCompression;
@@ -21,7 +21,10 @@ use super::freedesktop;
pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
let product_name = settings.product_name();
let version = settings.version_string();
let release = settings.rpm().release.as_str();
let release = match settings.rpm().release.as_str() {
"" => "1", // Considered the default. If left empty, you get file with "-.".
v => v,
};
let epoch = settings.rpm().epoch;
let arch = match settings.binary_arch() {
Arch::X86_64 => "x86_64",
@@ -32,8 +35,7 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
Arch::Riscv64 => "riscv64",
target => {
return Err(crate::Error::ArchError(format!(
"Unsupported architecture: {:?}",
target
"Unsupported architecture: {target:?}"
)));
}
};
@@ -46,10 +48,13 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
let base_dir = settings.project_out_directory().join("bundle/rpm");
let package_dir = base_dir.join(&package_base_name);
if package_dir.exists() {
fs::remove_dir_all(&package_dir)
.with_context(|| format!("Failed to remove old {package_base_name}"))?;
fs::remove_dir_all(&package_dir).fs_context(
"Failed to remove old package directory",
package_dir.clone(),
)?;
}
fs::create_dir_all(&package_dir)?;
fs::create_dir_all(&package_dir)
.fs_context("Failed to create package directory", package_dir.clone())?;
let package_path = base_dir.join(&package_name);
log::info!(action = "Bundling"; "{} ({})", package_name, package_path.display());
@@ -137,7 +142,23 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
for bin in settings.binaries() {
let src = settings.binary_path(bin);
let dest = Path::new("/usr/bin").join(bin.name());
builder = builder.with_file(src, FileOptions::new(dest.to_string_lossy()))?;
// This may cause issues when you try to submit the app to the distro repos but this is how apps like spotify do it as well (in .deb)
if settings.bundle_settings().cef_path.is_some() && bin.main() {
let cef_bin_dest = Path::new("/usr/share")
.join(settings.product_name())
.join(bin.name());
let empty_file_path = &package_dir.join("empty");
File::create(empty_file_path)?;
builder = builder.with_file(src, FileOptions::new(cef_bin_dest.to_string_lossy()))?;
builder = builder.with_file(
empty_file_path,
FileOptions::new(dest.to_string_lossy())
.symlink(cef_bin_dest.to_string_lossy().replace("/usr", ".."))
.mode(0o120555),
)?;
} else {
builder = builder.with_file(src, FileOptions::new(dest.to_string_lossy()))?;
}
}
// Add external binaries
@@ -174,8 +195,8 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
builder = builder.post_uninstall_script(script);
}
// Add resources
if settings.resource_files().count() > 0 {
// Add resources and/or prepare for CEF files
if settings.resource_files().count() > 0 || settings.bundle_settings().cef_path.is_some() {
let resource_dir = Path::new("/usr/lib").join(settings.product_name());
// Create an empty file, needed to add a directory to the RPM package
// (cf https://github.com/rpm-rs/rpm/issues/177)
@@ -193,6 +214,72 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
builder = builder.with_file(resource.path(), FileOptions::new(dest.to_string_lossy()))?;
}
}
// Handle CEF support if cef_path is set,
// using https://github.com/chromiumembedded/cef/blob/master/tools/distrib/linux/README.redistrib.txt as a reference
//
// Dealing with rpath or LD_LIBRARY_PATH is annoying so we'll somewhat follow the spotify approach and move the binary out of /usr/bin for now.
// This still requires adding $ORIGIN to RUNPATH, which we currently do in tauri-build.
// TODO: This may cause issues when you try to submit the app to the distro repos but we can revisit this later.
if let Some(cef_path) = settings.bundle_settings().cef_path.as_ref() {
let cef_resource_dir = Path::new("/usr/share").join(settings.product_name());
// TODO: We probably want this in a shared and versioned location.
let cef_temp_dir = package_dir.join("cef_temp");
fs::create_dir_all(&cef_temp_dir).fs_context(
"Failed to create temporary cef directory",
cef_temp_dir.clone(),
)?;
let cef_files = [
// required
"libcef.so",
"icudtl.dat",
"v8_context_snapshot.bin",
// required end
// "optional" - but not really since we want support for all of this
"chrome_100_percent.pak",
"chrome_200_percent.pak",
"resources.pak",
// ANGEL support
"libEGL.so",
"libGLESv2.so",
// SwANGLE support
"libvk_swiftshader.so",
"vk_swiftshader_icd.json",
"libvulkan.so.1",
// sandbox - may need to be behind a setting?
"chrome-sandbox",
];
for f in cef_files {
let temp_file = cef_temp_dir.join(f);
fs::copy(cef_path.join(f), &temp_file)?;
if f.ends_with(".so") {
// since libcef.so is 1.5GB unstripped we will error out if strip fails.
Command::new("strip").arg(&temp_file).output_ok()?;
}
let mut fileopts = FileOptions::new(cef_resource_dir.join(f).to_string_lossy());
if f == "chrome-sandbox" {
fileopts = fileopts.mode(0o104755);
}
builder = builder.with_file(temp_file, fileopts).unwrap();
}
let locales = [
"en-US.pak",
"en-US_FEMININE.pak",
"en-US_MASCULINE.pak",
"en-US_NEUTER.pak",
];
let cef_path = cef_path.join("locales");
let cef_resource_dir = cef_resource_dir.join("locales");
for f in locales {
builder = builder.with_file(
cef_path.join(f),
FileOptions::new(cef_resource_dir.join(f).to_string_lossy()),
)?;
}
}
// Add Desktop entry file
let (desktop_src_path, desktop_dest_path) =
@@ -223,6 +310,8 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
}
}
log::info!(action = "Bundling"; "Creating .rpm file...");
let pkg = if let Ok(raw_secret_key) = env::var("TAURI_SIGNING_RPM_KEY") {
let mut signer = pgp::Signer::load_from_asc(&raw_secret_key)?;
if let Ok(passphrase) = env::var("TAURI_SIGNING_RPM_KEY_PASSPHRASE") {
@@ -235,6 +324,5 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
let mut f = fs::File::create(&package_path)?;
pkg.write(&mut f)?;
Ok(vec![package_path])
}

View File

@@ -23,16 +23,17 @@
// files into the `Contents` directory of the bundle.
use super::{
icon::create_icns_file,
sign::{notarize, notarize_auth, sign, NotarizeAuthError, SignTarget},
icon::{app_icon_name_from_assets_car, create_assets_car_file, create_icns_file},
sign::{SignTarget, notarize, notarize_auth, notarize_without_stapling, sign},
};
use crate::{
utils::{fs_utils, CommandExt},
Error::GenericError,
Settings,
bundle::settings::PlistKind,
error::{Context, ErrorExt, NotarizeAuthError},
utils::{CommandExt, fs_utils},
};
use anyhow::Context;
use std::{
ffi::OsStr,
fs,
@@ -49,6 +50,25 @@ const NESTED_CODE_FOLDER: [&str; 6] = [
"Libraries",
];
const CEF_FRAMEWORK: &str = "Chromium Embedded Framework.framework";
mod embedded_cef_helper {
// Generated by `crates/tauri-bundler/build.rs` when compiling on macOS.
include!(concat!(env!("OUT_DIR"), "/cef_helpers.rs"));
}
fn lipo_create_universal(output: &Path, aarch64: &Path, x86_64: &Path) -> crate::Result<()> {
Command::new("lipo")
.arg("-create")
.arg("-output")
.arg(output)
.arg(aarch64)
.arg(x86_64)
.output_ok()
.with_context(|| "failed to create universal CEF helper binary using lipo")?;
Ok(())
}
/// Bundles the project.
/// Returns a vector of PathBuf that shows where the .app was created.
pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
@@ -65,25 +85,29 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
if app_bundle_path.exists() {
fs::remove_dir_all(&app_bundle_path)
.with_context(|| format!("Failed to remove old {}", app_product_name))?;
.fs_context("failed to remove old app bundle", &app_bundle_path)?;
}
let bundle_directory = app_bundle_path.join("Contents");
fs::create_dir_all(&bundle_directory).with_context(|| {
format!(
"Failed to create bundle directory at {:?}",
bundle_directory
)
})?;
fs::create_dir_all(&bundle_directory)
.fs_context("failed to create bundle directory", &bundle_directory)?;
let resources_dir = bundle_directory.join("Resources");
let bin_dir = bundle_directory.join("MacOS");
let mut sign_paths = Vec::new();
let bundle_icon_file: Option<PathBuf> =
{ create_icns_file(&resources_dir, settings).with_context(|| "Failed to create app icon")? };
let bundle_icon_file =
create_icns_file(&resources_dir, settings).with_context(|| "Failed to create app icon")?;
create_info_plist(&bundle_directory, bundle_icon_file, settings)
.with_context(|| "Failed to create Info.plist")?;
let assets_car_file = create_assets_car_file(&resources_dir, settings)
.with_context(|| "Failed to create app Assets.car")?;
create_info_plist(
&bundle_directory,
bundle_icon_file,
assets_car_file,
settings,
)
.with_context(|| "Failed to create Info.plist")?;
let framework_paths = copy_frameworks_to_bundle(&bundle_directory, settings)
.with_context(|| "Failed to bundle frameworks")?;
@@ -107,7 +131,28 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
copy_custom_files_to_bundle(&bundle_directory, settings)?;
if let Some(keychain) = super::sign::keychain(settings.macos().signing_identity.as_deref())? {
// Handle CEF support if cef_path is set
if let Some(cef_path) = settings.bundle_settings().cef_path.as_ref() {
let helper_paths = create_cef_helpers(&bundle_directory, settings, cef_path)?;
// Add helper apps to sign paths
sign_paths.extend(helper_paths.into_iter().map(|path| SignTarget {
path,
is_an_executable: true,
}));
let cef_framework_path = copy_cef_framework(&bundle_directory, cef_path)?;
// Add CEF framework to sign paths
add_framework_sign_path(
&cef_path.join(CEF_FRAMEWORK),
&cef_framework_path,
&mut sign_paths,
);
}
if settings.no_sign() {
log::warn!("Skipping signing due to --no-sign flag.",);
} else if let Some(keychain) =
super::sign::keychain(settings.macos().signing_identity.as_deref())?
{
// Sign frameworks and sidecar binaries first, per apple, signing must be done inside out
// https://developer.apple.com/forums/thread/701514
sign_paths.push(SignTarget {
@@ -125,13 +170,17 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
// notarization is required for distribution
match notarize_auth() {
Ok(auth) => {
notarize(&keychain, app_bundle_path.clone(), &auth)?;
if settings.macos().skip_stapling {
notarize_without_stapling(&keychain, app_bundle_path.clone(), &auth)?;
} else {
notarize(&keychain, app_bundle_path.clone(), &auth)?;
}
}
Err(e) => {
if matches!(e, NotarizeAuthError::MissingTeamId) {
return Err(anyhow::anyhow!("{e}").into());
return Err(e.into());
} else {
log::warn!("skipping app notarization, {}", e.to_string());
log::warn!("skipping app notarization, {e}");
}
}
}
@@ -160,7 +209,7 @@ fn copy_binaries_to_bundle(
let bin_path = settings.binary_path(bin);
let dest_path = dest_dir.join(bin.name());
fs_utils::copy_file(&bin_path, &dest_path)
.with_context(|| format!("Failed to copy binary from {:?}", bin_path))?;
.with_context(|| format!("Failed to copy binary from {bin_path:?}"))?;
paths.push(dest_path);
}
Ok(paths)
@@ -169,6 +218,12 @@ fn copy_binaries_to_bundle(
/// Copies user-defined files to the app under Contents.
fn copy_custom_files_to_bundle(bundle_directory: &Path, settings: &Settings) -> crate::Result<()> {
for (contents_path, path) in settings.macos().files.iter() {
if !path.try_exists()? {
return Err(GenericError(format!(
"Failed to copy {path:?} to {contents_path:?}. {path:?} does not exist."
)));
}
let contents_path = if contents_path.is_absolute() {
contents_path.strip_prefix("/").unwrap()
} else {
@@ -176,10 +231,14 @@ fn copy_custom_files_to_bundle(bundle_directory: &Path, settings: &Settings) ->
};
if path.is_file() {
fs_utils::copy_file(path, &bundle_directory.join(contents_path))
.with_context(|| format!("Failed to copy file {:?} to {:?}", path, contents_path))?;
} else {
.with_context(|| format!("Failed to copy file {path:?} to {contents_path:?}"))?;
} else if path.is_dir() {
fs_utils::copy_dir(path, &bundle_directory.join(contents_path))
.with_context(|| format!("Failed to copy directory {:?} to {:?}", path, contents_path))?;
.with_context(|| format!("Failed to copy directory {path:?} to {contents_path:?}"))?;
} else {
return Err(GenericError(format!(
"{path:?} is not a file or directory."
)));
}
}
Ok(())
@@ -189,14 +248,9 @@ fn copy_custom_files_to_bundle(bundle_directory: &Path, settings: &Settings) ->
fn create_info_plist(
bundle_dir: &Path,
bundle_icon_file: Option<PathBuf>,
assets_car_file: Option<PathBuf>,
settings: &Settings,
) -> crate::Result<()> {
let format = time::format_description::parse("[year][month][day].[hour][minute][second]")
.map_err(time::error::Error::from)?;
let build_number = time::OffsetDateTime::now_utc()
.format(&format)
.map_err(time::error::Error::from)?;
let mut plist = plist::Dictionary::new();
plist.insert("CFBundleDevelopmentRegion".into(), "English".into());
plist.insert("CFBundleDisplayName".into(), settings.product_name().into());
@@ -204,29 +258,34 @@ fn create_info_plist(
"CFBundleExecutable".into(),
settings.main_binary_name()?.into(),
);
if let Some(path) = bundle_icon_file {
plist.insert(
"CFBundleIconFile".into(),
path
.file_name()
.expect("No file name")
.to_string_lossy()
.into_owned()
.into(),
);
}
plist.insert(
"CFBundleIdentifier".into(),
settings.bundle_identifier().into(),
);
plist.insert("CFBundleInfoDictionaryVersion".into(), "6.0".into());
plist.insert("CFBundleName".into(), settings.product_name().into());
if let Some(bundle_name) = settings
.macos()
.bundle_name
.as_deref()
.unwrap_or_else(|| settings.product_name())
.into()
{
plist.insert("CFBundleName".into(), bundle_name.into());
}
plist.insert("CFBundlePackageType".into(), "APPL".into());
plist.insert(
"CFBundleShortVersionString".into(),
settings.version_string().into(),
);
plist.insert("CFBundleVersion".into(), build_number.into());
plist.insert(
"CFBundleVersion".into(),
settings
.macos()
.bundle_version
.as_deref()
.unwrap_or_else(|| settings.version_string())
.into(),
);
plist.insert("CSResourcesFileMapped".into(), true.into());
if let Some(category) = settings.app_category() {
plist.insert(
@@ -239,6 +298,55 @@ fn create_info_plist(
}
if let Some(associations) = settings.file_associations() {
let exported_associations = associations
.iter()
.filter_map(|association| {
association.exported_type.as_ref().map(|exported_type| {
let mut dict = plist::Dictionary::new();
dict.insert(
"UTTypeIdentifier".into(),
exported_type.identifier.clone().into(),
);
if let Some(description) = &association.description {
dict.insert("UTTypeDescription".into(), description.clone().into());
}
if let Some(conforms_to) = &exported_type.conforms_to {
dict.insert(
"UTTypeConformsTo".into(),
plist::Value::Array(conforms_to.iter().map(|s| s.clone().into()).collect()),
);
}
let mut specification = plist::Dictionary::new();
specification.insert(
"public.filename-extension".into(),
plist::Value::Array(
association
.ext
.iter()
.map(|s| s.to_string().into())
.collect(),
),
);
if let Some(mime_type) = &association.mime_type {
specification.insert("public.mime-type".into(), mime_type.clone().into());
}
dict.insert("UTTypeTagSpecification".into(), specification.into());
plist::Value::Dictionary(dict)
})
})
.collect::<Vec<_>>();
if !exported_associations.is_empty() {
plist.insert(
"UTExportedTypeDeclarations".into(),
plist::Value::Array(exported_associations),
);
}
plist.insert(
"CFBundleDocumentTypes".into(),
plist::Value::Array(
@@ -246,16 +354,27 @@ fn create_info_plist(
.iter()
.map(|association| {
let mut dict = plist::Dictionary::new();
dict.insert(
"CFBundleTypeExtensions".into(),
plist::Value::Array(
association
.ext
.iter()
.map(|ext| ext.to_string().into())
.collect(),
),
);
if !association.ext.is_empty() {
dict.insert(
"CFBundleTypeExtensions".into(),
plist::Value::Array(
association
.ext
.iter()
.map(|ext| ext.to_string().into())
.collect(),
),
);
}
if let Some(content_types) = &association.content_types {
dict.insert(
"LSItemContentTypes".into(),
plist::Value::Array(content_types.iter().map(|s| s.to_string().into()).collect()),
);
}
dict.insert(
"CFBundleTypeName".into(),
association
@@ -269,6 +388,7 @@ fn create_info_plist(
"CFBundleTypeRole".into(),
association.role.to_string().into(),
);
dict.insert("LSHandlerRank".into(), association.rank.to_string().into());
plist::Value::Dictionary(dict)
})
.collect(),
@@ -276,12 +396,34 @@ fn create_info_plist(
);
}
if let Some(path) = bundle_icon_file {
plist.insert(
"CFBundleIconFile".into(),
path
.file_name()
.expect("No file name")
.to_string_lossy()
.into_owned()
.into(),
);
}
if let Some(assets_car_file) = assets_car_file {
if let Some(icon_name) = app_icon_name_from_assets_car(&assets_car_file) {
// only set CFBundleIconName for the Assets.car, CFBundleIconFile is the fallback icns file
plist.insert("CFBundleIconName".into(), icon_name.clone().into());
} else {
log::warn!("Failed to get icon name from Assets.car file");
}
}
if let Some(protocols) = settings.deep_link_protocols() {
plist.insert(
"CFBundleURLTypes".into(),
plist::Value::Array(
protocols
.iter()
.filter(|p| !p.schemes.is_empty())
.map(|protocol| {
let mut dict = plist::Dictionary::new();
dict.insert(
@@ -332,8 +474,11 @@ fn create_info_plist(
plist.insert("NSAppTransportSecurity".into(), security.into());
}
if let Some(user_plist_path) = &settings.macos().info_plist_path {
let user_plist = plist::Value::from_file(user_plist_path)?;
if let Some(user_plist) = &settings.macos().info_plist {
let user_plist = match user_plist {
PlistKind::Path(path) => plist::Value::from_file(path)?,
PlistKind::Plist(value) => value.clone(),
};
if let Some(dict) = user_plist.into_dictionary() {
for (key, value) in dict {
plist.insert(key, value);
@@ -348,7 +493,7 @@ fn create_info_plist(
// Copies the framework under `{src_dir}/{framework}.framework` to `{dest_dir}/{framework}.framework`.
fn copy_framework_from(dest_dir: &Path, framework: &str, src_dir: &Path) -> crate::Result<bool> {
let src_name = format!("{}.framework", framework);
let src_name = format!("{framework}.framework");
let src_path = src_dir.join(&src_name);
if src_path.exists() {
fs_utils::copy_dir(&src_path, &dest_dir.join(&src_name))?;
@@ -365,18 +510,12 @@ fn copy_frameworks_to_bundle(
) -> crate::Result<Vec<SignTarget>> {
let mut paths = Vec::new();
let frameworks = settings
.macos()
.frameworks
.as_ref()
.cloned()
.unwrap_or_default();
let frameworks = settings.macos().frameworks.clone().unwrap_or_default();
if frameworks.is_empty() {
return Ok(paths);
}
let dest_dir = bundle_directory.join("Frameworks");
fs::create_dir_all(bundle_directory)
.with_context(|| format!("Failed to create Frameworks directory at {:?}", dest_dir))?;
fs::create_dir_all(&dest_dir).fs_context("failed to create Frameworks directory", &dest_dir)?;
for framework in frameworks.iter() {
if framework.ends_with(".framework") {
let src_path = PathBuf::from(framework);
@@ -390,10 +529,7 @@ fn copy_frameworks_to_bundle(
} else if framework.ends_with(".dylib") {
let src_path = PathBuf::from(framework);
if !src_path.exists() {
return Err(crate::Error::GenericError(format!(
"Library not found: {}",
framework
)));
return Err(GenericError(format!("Library not found: {framework}")));
}
let src_name = src_path.file_name().expect("Couldn't get library filename");
let dest_path = dest_dir.join(src_name);
@@ -404,15 +540,14 @@ fn copy_frameworks_to_bundle(
});
continue;
} else if framework.contains('/') {
return Err(crate::Error::GenericError(format!(
"Framework path should have .framework extension: {}",
framework
return Err(GenericError(format!(
"Framework path should have .framework extension: {framework}"
)));
}
if let Some(home_dir) = dirs::home_dir() {
if copy_framework_from(&dest_dir, framework, &home_dir.join("Library/Frameworks/"))? {
continue;
}
if let Some(home_dir) = dirs::home_dir()
&& copy_framework_from(&dest_dir, framework, &home_dir.join("Library/Frameworks/"))?
{
continue;
}
if copy_framework_from(&dest_dir, framework, &PathBuf::from("/Library/Frameworks/"))?
|| copy_framework_from(
@@ -423,9 +558,8 @@ fn copy_frameworks_to_bundle(
{
continue;
}
return Err(crate::Error::GenericError(format!(
"Could not locate framework: {}",
framework
return Err(GenericError(format!(
"Could not locate framework: {framework}"
)));
}
Ok(paths)
@@ -517,3 +651,337 @@ fn add_nested_code_sign_path(src_path: &Path, dest_path: &Path, sign_paths: &mut
}
}
}
/// Creates CEF helper .app bundles.
/// Returns the paths to the created helper apps for signing.
fn create_cef_helpers(
bundle_directory: &Path,
settings: &Settings,
_cef_path: &Path,
) -> crate::Result<Vec<PathBuf>> {
let mut helper_paths = Vec::new();
let exec_name = settings.main_binary_name()?;
let frameworks_dir = bundle_directory.join("Frameworks");
fs::create_dir_all(&frameworks_dir).fs_context(
"failed to create Frameworks directory for CEF helpers",
frameworks_dir.to_path_buf(),
)?;
let arch = settings.binary_arch();
// Create helper .app bundles
let helpers = vec![
format!("{} Helper (GPU)", exec_name),
format!("{} Helper (Renderer)", exec_name),
format!("{} Helper (Plugin)", exec_name),
format!("{} Helper (Alerts)", exec_name),
format!("{} Helper", exec_name),
];
// If building an universal app bundle, create a universal helper binary once (outside the loop),
// then copy it into each helper .app.
let universal_helper: Option<(tempfile::TempDir, PathBuf)> =
if arch == crate::bundle::settings::Arch::Universal {
let tmp = tempfile::tempdir().map_err(|e| {
crate::Error::GenericError(format!(
"failed to create temp dir for CEF helper lipo: {e}"
))
})?;
let aarch64 = tmp.path().join("tauri-cef-helper.aarch64");
let x86_64 = tmp.path().join("tauri-cef-helper.x86_64");
let universal = tmp.path().join("tauri-cef-helper.universal");
fs::write(&aarch64, embedded_cef_helper::CEF_HELPER_AARCH64).fs_context(
"failed to write embedded CEF helper (aarch64)",
aarch64.clone(),
)?;
fs::write(&x86_64, embedded_cef_helper::CEF_HELPER_X86_64).fs_context(
"failed to write embedded CEF helper (x86_64)",
x86_64.clone(),
)?;
lipo_create_universal(&universal, &aarch64, &x86_64)?;
Some((tmp, universal))
} else {
None
};
for helper_name in helpers {
let helper_app = frameworks_dir.join(format!("{helper_name}.app"));
let helper_contents = helper_app.join("Contents");
let helper_macos = helper_contents.join("MacOS");
let helper_resources = helper_contents.join("Resources");
// Create directory structure
fs::create_dir_all(&helper_macos).fs_context(
"failed to create helper MacOS directory",
helper_macos.to_path_buf(),
)?;
fs::create_dir_all(&helper_resources).fs_context(
"failed to create helper Resources directory",
helper_resources.to_path_buf(),
)?;
// Create Info.plist for helper
let mut plist = plist::Dictionary::new();
plist.insert("CFBundleDevelopmentRegion".into(), "English".into());
plist.insert("CFBundleDisplayName".into(), helper_name.clone().into());
plist.insert("CFBundleExecutable".into(), helper_name.clone().into());
plist.insert(
"CFBundleIdentifier".into(),
format!("{}.helper", settings.bundle_identifier()).into(),
);
plist.insert("CFBundleInfoDictionaryVersion".into(), "6.0".into());
plist.insert("CFBundleName".into(), helper_name.clone().into());
plist.insert("CFBundlePackageType".into(), "APPL".into());
plist.insert(
"CFBundleShortVersionString".into(),
settings.version_string().into(),
);
plist.insert(
"CFBundleVersion".into(),
settings
.macos()
.bundle_version
.as_deref()
.unwrap_or_else(|| settings.version_string())
.into(),
);
plist.insert("LSMinimumSystemVersion".into(), "11.0".into());
plist.insert("LSUIElement".into(), "1".into());
plist::Value::Dictionary(plist).to_file_xml(helper_contents.join("Info.plist"))?;
let helper_exec = helper_macos.join(&helper_name);
match arch {
crate::bundle::settings::Arch::AArch64 => {
fs::write(&helper_exec, embedded_cef_helper::CEF_HELPER_AARCH64).fs_context(
"failed to write embedded CEF helper executable",
helper_exec.clone(),
)?;
}
crate::bundle::settings::Arch::X86_64 => {
fs::write(&helper_exec, embedded_cef_helper::CEF_HELPER_X86_64).fs_context(
"failed to write embedded CEF helper executable",
helper_exec.clone(),
)?;
}
crate::bundle::settings::Arch::Universal => {
let (_temp_dir, universal_path) = universal_helper
.as_ref()
.expect("universal helper binary was not generated");
fs_utils::copy_file(universal_path, &helper_exec)?;
}
other => {
return Err(GenericError(format!(
"CEF helper embedding is only supported for aarch64, x86_64, and universal on macOS (got {other:?})"
)));
}
}
#[cfg(unix)]
{
use std::os::unix::fs::PermissionsExt;
if let Ok(metadata) = fs::metadata(&helper_exec) {
let mut perms = metadata.permissions();
perms.set_mode(0o755);
fs::set_permissions(&helper_exec, perms)?;
}
}
helper_paths.push(helper_app);
}
Ok(helper_paths)
}
/// Copies the CEF framework from cef_path to the app bundle.
/// Returns the path to the copied framework.
fn copy_cef_framework(bundle_directory: &Path, cef_path: &Path) -> crate::Result<PathBuf> {
let framework_src = cef_path.join(CEF_FRAMEWORK);
if !framework_src.exists() {
return Err(GenericError(format!(
"CEF framework not found at {}",
framework_src.display()
)));
}
let frameworks_dir = bundle_directory.join("Frameworks");
fs::create_dir_all(&frameworks_dir).fs_context(
"failed to create Frameworks directory for CEF",
frameworks_dir.to_path_buf(),
)?;
let framework_dst = frameworks_dir.join(CEF_FRAMEWORK);
if framework_dst.exists() {
fs::remove_dir_all(&framework_dst).fs_context(
"failed to remove existing CEF framework",
framework_dst.to_path_buf(),
)?;
}
fs_utils::copy_dir(&framework_src, &framework_dst).with_context(|| {
format!(
"Failed to copy CEF framework from {} to {}",
framework_src.display(),
framework_dst.display()
)
})?;
Ok(framework_dst)
}
#[cfg(test)]
mod tests {
use super::*;
use crate::bundle::{BundleSettings, MacOsSettings, PackageSettings, SettingsBuilder};
use std::{
collections::HashMap,
fs,
path::{Path, PathBuf},
};
/// Helper that builds a `Settings` instance and bundle directory for tests.
/// It receives a mapping of bundle-relative paths to source paths and
/// returns the generated bundle directory and settings.
fn create_test_bundle(
project_dir: &Path,
files: HashMap<PathBuf, PathBuf>,
) -> (PathBuf, crate::bundle::Settings) {
let macos_settings = MacOsSettings {
files,
..Default::default()
};
let settings = SettingsBuilder::new()
.project_out_directory(project_dir)
.package_settings(PackageSettings {
product_name: "TestApp".into(),
version: "0.1.0".into(),
description: "test".into(),
homepage: None,
authors: None,
default_run: None,
})
.bundle_settings(BundleSettings {
macos: macos_settings,
..Default::default()
})
.target("x86_64-apple-darwin".into())
.build()
.expect("failed to build settings");
let bundle_dir = project_dir.join("TestApp.app/Contents");
fs::create_dir_all(&bundle_dir).expect("failed to create bundle dir");
(bundle_dir, settings)
}
#[test]
fn test_copy_custom_file_to_bundle_file() {
let tmp_dir = tempfile::tempdir().expect("failed to create temp dir");
// Prepare a single file to copy.
let src_file = tmp_dir.path().join("sample.txt");
fs::write(&src_file, b"hello tauri").expect("failed to write sample file");
let files_map = HashMap::from([(PathBuf::from("Resources/sample.txt"), src_file.clone())]);
let (bundle_dir, settings) = create_test_bundle(tmp_dir.path(), files_map);
copy_custom_files_to_bundle(&bundle_dir, &settings)
.expect("copy_custom_files_to_bundle failed");
let dest_file = bundle_dir.join("Resources/sample.txt");
assert!(dest_file.exists() && dest_file.is_file());
assert_eq!(fs::read_to_string(dest_file).unwrap(), "hello tauri");
}
#[test]
fn test_copy_custom_file_to_bundle_dir() {
let tmp_dir = tempfile::tempdir().expect("failed to create temp dir");
// Create a source directory with a nested file.
let src_dir = tmp_dir.path().join("assets");
fs::create_dir_all(&src_dir).expect("failed to create assets directory");
let nested_file = src_dir.join("nested.txt");
fs::write(&nested_file, b"nested").expect("failed to write nested file");
let files_map = HashMap::from([(PathBuf::from("MyAssets"), src_dir.clone())]);
let (bundle_dir, settings) = create_test_bundle(tmp_dir.path(), files_map);
copy_custom_files_to_bundle(&bundle_dir, &settings)
.expect("copy_custom_files_to_bundle failed");
let dest_nested_file = bundle_dir.join("MyAssets/nested.txt");
assert!(
dest_nested_file.exists(),
"{dest_nested_file:?} does not exist"
);
assert!(
dest_nested_file.is_file(),
"{dest_nested_file:?} is not a file"
);
assert_eq!(
fs::read_to_string(dest_nested_file).unwrap().trim(),
"nested"
);
}
#[test]
fn test_copy_custom_files_to_bundle_missing_source() {
let tmp_dir = tempfile::tempdir().expect("failed to create temp dir");
// Intentionally reference a non-existent path.
let missing_path = tmp_dir.path().join("does_not_exist.txt");
let files_map = HashMap::from([(PathBuf::from("Missing.txt"), missing_path)]);
let (bundle_dir, settings) = create_test_bundle(tmp_dir.path(), files_map);
let result = copy_custom_files_to_bundle(&bundle_dir, &settings);
assert!(result.is_err());
assert!(result.err().unwrap().to_string().contains("does not exist"));
}
#[test]
fn test_copy_custom_files_to_bundle_invalid_source() {
let tmp_dir = tempfile::tempdir().expect("failed to create temp dir");
let files_map = HashMap::from([(PathBuf::from("Invalid.txt"), PathBuf::from("///"))]);
let (bundle_dir, settings) = create_test_bundle(tmp_dir.path(), files_map);
let result = copy_custom_files_to_bundle(&bundle_dir, &settings);
assert!(result.is_err());
assert!(
result
.err()
.unwrap()
.to_string()
.contains("Failed to copy directory")
);
}
#[test]
fn test_copy_custom_files_to_bundle_dev_null() {
let tmp_dir = tempfile::tempdir().expect("failed to create temp dir");
let files_map = HashMap::from([(PathBuf::from("Invalid.txt"), PathBuf::from("/dev/null"))]);
let (bundle_dir, settings) = create_test_bundle(tmp_dir.path(), files_map);
let result = copy_custom_files_to_bundle(&bundle_dir, &settings);
assert!(result.is_err());
assert!(
result
.err()
.unwrap()
.to_string()
.contains("is not a file or directory.")
);
}
}

View File

@@ -5,13 +5,12 @@
use super::{app, icon::create_icns_file};
use crate::{
bundle::{settings::Arch, Bundle},
utils::CommandExt,
PackageType, Settings,
bundle::{Bundle, settings::Arch},
error::{Context, ErrorExt},
utils::CommandExt,
};
use anyhow::Context;
use std::{
env,
fs::{self, write},
@@ -49,8 +48,7 @@ pub fn bundle_project(settings: &Settings, bundles: &[Bundle]) -> crate::Result<
Arch::Universal => "universal",
target => {
return Err(crate::Error::ArchError(format!(
"Unsupported architecture: {:?}",
target
"Unsupported architecture: {target:?}"
)));
}
}
@@ -59,7 +57,7 @@ pub fn bundle_project(settings: &Settings, bundles: &[Bundle]) -> crate::Result<
let dmg_path = output_path.join(&dmg_name);
let product_name = settings.product_name();
let bundle_file_name = format!("{}.app", product_name);
let bundle_file_name = format!("{product_name}.app");
let bundle_dir = settings.project_out_directory().join("bundle/macos");
let support_directory_path = output_path
@@ -69,10 +67,9 @@ pub fn bundle_project(settings: &Settings, bundles: &[Bundle]) -> crate::Result<
for path in &[&support_directory_path, &output_path] {
if path.exists() {
fs::remove_dir_all(path).with_context(|| format!("Failed to remove old {}", dmg_name))?;
fs::remove_dir_all(path).fs_context("failed to remove old dmg", path.to_path_buf())?;
}
fs::create_dir_all(path)
.with_context(|| format!("Failed to create output directory at {:?}", path))?;
fs::create_dir_all(path).fs_context("failed to create output directory", path.to_path_buf())?;
}
// create paths for script
@@ -174,12 +171,11 @@ pub fn bundle_project(settings: &Settings, bundles: &[Bundle]) -> crate::Result<
// Issue #592 - Building MacOS dmg files on CI
// https://github.com/tauri-apps/tauri/issues/592
if env::var_os("TAURI_BUNDLER_DMG_IGNORE_CI").unwrap_or_default() != "true" {
if let Some(value) = env::var_os("CI") {
if value == "true" {
bundle_dmg_cmd.arg("--skip-jenkins");
}
}
if env::var_os("TAURI_BUNDLER_DMG_IGNORE_CI").unwrap_or_default() != "true"
&& let Some(value) = env::var_os("CI")
&& value == "true"
{
bundle_dmg_cmd.arg("--skip-jenkins");
}
log::info!(action = "Running"; "bundle_dmg.sh");
@@ -196,17 +192,18 @@ pub fn bundle_project(settings: &Settings, bundles: &[Bundle]) -> crate::Result<
// Sign DMG if needed
// skipping self-signing DMGs https://github.com/tauri-apps/tauri/issues/12288
let identity = settings.macos().signing_identity.as_deref();
if identity != Some("-") {
if let Some(keychain) = super::sign::keychain(identity)? {
super::sign::sign(
&keychain,
vec![super::sign::SignTarget {
path: dmg_path.clone(),
is_an_executable: false,
}],
settings,
)?;
}
if !settings.no_sign()
&& identity != Some("-")
&& let Some(keychain) = super::sign::keychain(identity)?
{
super::sign::sign(
&keychain,
vec![super::sign::SignTarget {
path: dmg_path.clone(),
is_an_executable: false,
}],
settings,
)?;
}
Ok(Bundled {

View File

@@ -4,13 +4,14 @@
// SPDX-License-Identifier: MIT
use crate::bundle::Settings;
use crate::utils::{self, fs_utils};
use crate::utils::{self, CommandExt, fs_utils};
use std::{
cmp::min,
ffi::OsStr,
fs::{self, File},
io::{self, BufWriter},
path::{Path, PathBuf},
process::Command,
};
use image::GenericImageView;
@@ -63,6 +64,11 @@ pub fn create_icns_file(out_dir: &Path, settings: &Settings) -> crate::Result<Op
let mut images_to_resize: Vec<(image::DynamicImage, u32, u32)> = vec![];
for icon_path in settings.icon_files() {
let icon_path = icon_path?;
if icon_path.extension().map_or(false, |ext| ext == "car") {
continue;
}
let icon = image::open(&icon_path)?;
let density = if utils::is_retina(&icon_path) { 2 } else { 1 };
let (w, h) = icon.dimensions();
@@ -113,3 +119,208 @@ fn make_icns_image(img: image::DynamicImage) -> io::Result<icns::Image> {
};
icns::Image::from_data(pixel_format, img.width(), img.height(), img.into_bytes())
}
/// Creates an Assets.car file from a .icon file if there are any in the settings.
/// Uses an existing Assets.car file if it exists in the settings.
/// Returns the path to the Assets.car file.
pub fn create_assets_car_file(
out_dir: &Path,
settings: &Settings,
) -> crate::Result<Option<PathBuf>> {
let Some(icons) = settings.icons() else {
return Ok(None);
};
// If one of the icon files is already a CAR file, just use that.
let mut icon_composer_icon_path = None;
for icon in icons {
let icon_path = Path::new(&icon).to_path_buf();
if icon_path.extension() == Some(OsStr::new("car")) {
let dest_path = out_dir.join("Assets.car");
fs_utils::copy_file(&icon_path, &dest_path)?;
return Ok(Some(dest_path));
}
if icon_path.extension() == Some(OsStr::new("icon")) {
icon_composer_icon_path.replace(icon_path);
}
}
let Some(icon_composer_icon_path) = icon_composer_icon_path else {
return Ok(None);
};
// Check actool version - must be >= 26
if let Some(version) = get_actool_version() {
// Parse the major version number (before the dot)
let major_version: Option<u32> = version.split('.').next().and_then(|s| s.parse().ok());
if let Some(major) = major_version {
if major < 26 {
log::error!(
"actool version is less than 26, skipping Assets.car file creation. Please update Xcode to 26 or above and try again."
);
return Ok(None);
}
} else {
// If we can't parse the version, return None to be safe
log::error!("failed to parse actool version, skipping Assets.car file creation");
return Ok(None);
}
} else {
log::error!("failed to get actool version, skipping Assets.car file creation");
// If we can't get the version, return None to be safe
return Ok(None);
}
// Create a temporary directory for actool work
let temp_dir = tempfile::tempdir()
.map_err(|e| crate::Error::GenericError(format!("failed to create temp dir: {e}")))?;
let icon_dest_path = temp_dir.path().join("Icon.icon");
let output_path = temp_dir.path().join("out");
// Copy the input .icon directory to the temp directory
if icon_composer_icon_path.is_dir() {
fs_utils::copy_dir(&icon_composer_icon_path, &icon_dest_path)?;
} else {
return Err(crate::Error::GenericError(format!(
"{} must be a directory",
icon_composer_icon_path.display()
)));
}
// Create the output directory
fs::create_dir_all(&output_path)?;
// Run actool command
let mut cmd = Command::new("actool");
cmd.arg(&icon_dest_path);
cmd.arg("--compile");
cmd.arg(&output_path);
cmd.arg("--output-format");
cmd.arg("human-readable-text");
cmd.arg("--notices");
cmd.arg("--warnings");
cmd.arg("--output-partial-info-plist");
cmd.arg(output_path.join("assetcatalog_generated_info.plist"));
cmd.arg("--app-icon");
cmd.arg("Icon");
cmd.arg("--include-all-app-icons");
cmd.arg("--accent-color");
cmd.arg("AccentColor");
cmd.arg("--enable-on-demand-resources");
cmd.arg("NO");
cmd.arg("--development-region");
cmd.arg("en");
cmd.arg("--target-device");
cmd.arg("mac");
cmd.arg("--minimum-deployment-target");
cmd.arg("26.0");
cmd.arg("--platform");
cmd.arg("macosx");
cmd.output_ok()?;
let assets_car_path = output_path.join("Assets.car");
if !assets_car_path.exists() {
return Err(crate::Error::GenericError(
"actool did not generate Assets.car file".to_owned(),
));
}
// copy to out_dir
fs_utils::copy_file(&assets_car_path, &out_dir.join("Assets.car"))?;
Ok(Some(out_dir.join("Assets.car")))
}
#[derive(serde::Deserialize)]
struct AssetsCarInfo {
#[serde(rename = "AssetType", default)]
asset_type: String,
#[serde(rename = "Name", default)]
name: String,
}
pub fn app_icon_name_from_assets_car(assets_car_path: &Path) -> Option<String> {
let Ok(output) = Command::new("assetutil")
.arg("--info")
.arg(assets_car_path)
.output_ok()
.inspect_err(|e| log::error!("Failed to get app icon name from Assets.car file: {e}"))
else {
return None;
};
let output = String::from_utf8(output.stdout).ok()?;
let assets_car_info: Vec<AssetsCarInfo> = serde_json::from_str(&output)
.inspect_err(|e| log::error!("Failed to parse Assets.car file info: {e}"))
.ok()?;
assets_car_info
.iter()
.find(|info| info.asset_type == "Icon Image")
.map(|info| info.name.clone())
}
/// Returns the actool short bundle version by running `actool --version --output-format=human-readable-text`.
/// Returns `None` if the command fails or the output cannot be parsed.
pub fn get_actool_version() -> Option<String> {
let Ok(output) = Command::new("actool")
.arg("--version")
.arg("--output-format=human-readable-text")
.output_ok()
.inspect_err(|e| log::error!("Failed to get actool version: {e}"))
else {
return None;
};
let output = String::from_utf8(output.stdout).ok()?;
parse_actool_version(&output)
}
fn parse_actool_version(output: &str) -> Option<String> {
// The output format is:
// /* com.apple.actool.version */
// bundle-version: 24411
// short-bundle-version: 26.1
for line in output.lines() {
let line = line.trim();
if let Some(version) = line.strip_prefix("short-bundle-version:") {
return Some(version.trim().to_string());
}
}
None
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_parse_actool_version() {
let output = r#"/* com.apple.actool.version */
some other line
bundle-version: 24411
short-bundle-version: 26.1
another line
"#;
let version = parse_actool_version(output).expect("Failed to parse version");
assert_eq!(version, "26.1");
}
#[test]
fn test_parse_actool_version_missing_fields() {
let output = r#"/* com.apple.actool.version */
bundle-version: 24411
"#;
assert!(parse_actool_version(output).is_none());
}
#[test]
fn test_parse_actool_version_empty() {
assert!(parse_actool_version("").is_none());
}
}

View File

@@ -14,12 +14,12 @@
// explanation.
use crate::{
utils::{self, fs_utils},
Settings,
error::{Context, ErrorExt},
utils::{self, fs_utils},
};
use anyhow::Context;
use image::{codecs::png::PngDecoder, GenericImageView, ImageDecoder};
use image::{GenericImageView, ImageDecoder, codecs::png::PngDecoder};
use std::{
collections::BTreeSet,
@@ -45,16 +45,16 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
if app_bundle_path.exists() {
fs::remove_dir_all(&app_bundle_path)
.with_context(|| format!("Failed to remove old {}", app_product_name))?;
.fs_context("failed to remove old app bundle", &app_bundle_path)?;
}
fs::create_dir_all(&app_bundle_path)
.with_context(|| format!("Failed to create bundle directory at {:?}", app_bundle_path))?;
.fs_context("failed to create bundle directory", &app_bundle_path)?;
for src in settings.resource_files() {
let src = src?;
let dest = app_bundle_path.join(tauri_utils::resources::resource_relpath(&src));
fs_utils::copy_file(&src, &dest)
.with_context(|| format!("Failed to copy resource file {:?}", src))?;
.with_context(|| format!("Failed to copy resource file {src:?}"))?;
}
let icon_filenames = generate_icon_files(&app_bundle_path, settings)
@@ -65,7 +65,7 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
for bin in settings.binaries() {
let bin_path = settings.binary_path(bin);
fs_utils::copy_file(&bin_path, &app_bundle_path.join(bin.name()))
.with_context(|| format!("Failed to copy binary from {:?}", bin_path))?;
.with_context(|| format!("Failed to copy binary from {bin_path:?}"))?;
}
Ok(vec![app_bundle_path])
@@ -106,7 +106,10 @@ fn generate_icon_files(bundle_dir: &Path, settings: &Settings) -> crate::Result<
// Fall back to non-PNG files for any missing sizes.
for icon_path in settings.icon_files() {
let icon_path = icon_path?;
if icon_path.extension() == Some(OsStr::new("png")) {
if icon_path
.extension()
.map_or(false, |ext| ext == "png" || ext == "car")
{
continue;
} else if icon_path.extension() == Some(OsStr::new("icns")) {
let icon_family = icns::IconFamily::read(File::open(&icon_path)?)?;
@@ -178,7 +181,11 @@ fn generate_info_plist(
writeln!(
file,
" <key>CFBundleVersion</key>\n <string>{}</string>",
settings.version_string()
settings
.ios()
.bundle_version
.as_deref()
.unwrap_or_else(|| settings.version_string())
)?;
writeln!(
file,
@@ -193,7 +200,7 @@ fn generate_info_plist(
if !icon_filenames.is_empty() {
writeln!(file, " <key>CFBundleIconFiles</key>\n <array>")?;
for filename in icon_filenames {
writeln!(file, " <string>{}</string>", filename)?;
writeln!(file, " <string>{filename}</string>")?;
}
writeln!(file, " </array>")?;
}

View File

@@ -6,10 +6,10 @@
use std::{
env::{var, var_os},
ffi::OsString,
path::{Path, PathBuf},
path::PathBuf,
};
use crate::Settings;
use crate::{Entitlements, Settings, error::NotarizeAuthError};
pub struct SignTarget {
pub path: PathBuf,
@@ -21,13 +21,16 @@ pub fn keychain(identity: Option<&str>) -> crate::Result<Option<tauri_macos_sign
var_os("APPLE_CERTIFICATE"),
var_os("APPLE_CERTIFICATE_PASSWORD"),
) {
// import user certificate - useful for for CI build
// import user certificate - useful for CI build
let keychain =
tauri_macos_sign::Keychain::with_certificate(&certificate_encoded, &certificate_password)?;
tauri_macos_sign::Keychain::with_certificate(&certificate_encoded, &certificate_password)
.map_err(Box::new)?;
if let Some(identity) = identity {
let certificate_identity = keychain.signing_identity();
if !certificate_identity.contains(identity) {
return Err(anyhow::anyhow!("certificate from APPLE_CERTIFICATE \"{certificate_identity}\" environment variable does not match provided identity \"{identity}\"").into());
return Err(crate::Error::GenericError(format!(
"certificate from APPLE_CERTIFICATE \"{certificate_identity}\" environment variable does not match provided identity \"{identity}\""
)));
}
}
Ok(Some(keychain))
@@ -48,16 +51,23 @@ pub fn sign(
log::info!(action = "Signing"; "with identity \"{}\"", keychain.signing_identity());
for target in targets {
let entitlements_path = if target.is_an_executable {
settings.macos().entitlements.as_ref().map(Path::new)
} else {
None
let (entitlements_path, _temp_file) = match settings.macos().entitlements.as_ref() {
Some(Entitlements::Path(path)) => (Some(path.to_owned()), None),
Some(Entitlements::Plist(plist)) => {
let mut temp_file = tempfile::NamedTempFile::new()?;
plist::to_writer_xml(temp_file.as_file_mut(), &plist)?;
(Some(temp_file.path().to_path_buf()), Some(temp_file))
}
None => (None, None),
};
keychain.sign(
&target.path,
entitlements_path,
target.is_an_executable && settings.macos().hardened_runtime,
)?;
keychain
.sign(
&target.path,
entitlements_path.as_deref(),
target.is_an_executable && settings.macos().hardened_runtime,
)
.map_err(Box::new)?;
}
Ok(())
@@ -68,17 +78,19 @@ pub fn notarize(
app_bundle_path: PathBuf,
credentials: &tauri_macos_sign::AppleNotarizationCredentials,
) -> crate::Result<()> {
tauri_macos_sign::notarize(keychain, &app_bundle_path, credentials).map_err(Into::into)
tauri_macos_sign::notarize(keychain, &app_bundle_path, credentials)
.map_err(Box::new)
.map_err(Into::into)
}
#[derive(Debug, thiserror::Error)]
pub enum NotarizeAuthError {
#[error(
"The team ID is now required for notarization with app-specific password as authentication. Please set the `APPLE_TEAM_ID` environment variable. You can find the team ID in https://developer.apple.com/account#MembershipDetailsCard."
)]
MissingTeamId,
#[error(transparent)]
Anyhow(#[from] anyhow::Error),
pub fn notarize_without_stapling(
keychain: &tauri_macos_sign::Keychain,
app_bundle_path: PathBuf,
credentials: &tauri_macos_sign::AppleNotarizationCredentials,
) -> crate::Result<()> {
tauri_macos_sign::notarize_without_stapling(keychain, &app_bundle_path, credentials)
.map_err(Box::new)
.map_err(Into::into)
}
pub fn notarize_auth() -> Result<tauri_macos_sign::AppleNotarizationCredentials, NotarizeAuthError>
@@ -97,10 +109,18 @@ pub fn notarize_auth() -> Result<tauri_macos_sign::AppleNotarizationCredentials,
}
(Some(_apple_id), Some(_password), None) => Err(NotarizeAuthError::MissingTeamId),
_ => {
match (var_os("APPLE_API_KEY"), var_os("APPLE_API_ISSUER"), var("APPLE_API_KEY_PATH")) {
match (
var_os("APPLE_API_KEY"),
var_os("APPLE_API_ISSUER"),
var("APPLE_API_KEY_PATH"),
) {
(Some(key_id), Some(issuer), Ok(key_path)) => {
Ok(tauri_macos_sign::AppleNotarizationCredentials::ApiKey { key_id, key: tauri_macos_sign::ApiKey::Path( key_path.into()), issuer })
},
Ok(tauri_macos_sign::AppleNotarizationCredentials::ApiKey {
key_id,
key: tauri_macos_sign::ApiKey::Path(key_path.into()),
issuer,
})
}
(Some(key_id), Some(issuer), Err(_)) => {
let mut api_key_file_name = OsString::from("AuthKey_");
api_key_file_name.push(&key_id);
@@ -122,12 +142,18 @@ pub fn notarize_auth() -> Result<tauri_macos_sign::AppleNotarizationCredentials,
}
if let Some(key_path) = key_path {
Ok(tauri_macos_sign::AppleNotarizationCredentials::ApiKey { key_id, key: tauri_macos_sign::ApiKey::Path(key_path), issuer })
Ok(tauri_macos_sign::AppleNotarizationCredentials::ApiKey {
key_id,
key: tauri_macos_sign::ApiKey::Path(key_path),
issuer,
})
} else {
Err(anyhow::anyhow!("could not find API key file. Please set the APPLE_API_KEY_PATH environment variables to the path to the {api_key_file_name:?} file").into())
Err(NotarizeAuthError::MissingApiKey {
file_name: api_key_file_name.to_string_lossy().into_owned(),
})
}
}
_ => Err(anyhow::anyhow!("no APPLE_ID & APPLE_PASSWORD & APPLE_TEAM_ID or APPLE_API_KEY & APPLE_API_ISSUER & APPLE_API_KEY_PATH environment variables found").into())
_ => Err(NotarizeAuthError::MissingCredentials),
}
}
}
@@ -135,9 +161,5 @@ pub fn notarize_auth() -> Result<tauri_macos_sign::AppleNotarizationCredentials,
fn find_api_key(folder: PathBuf, file_name: &OsString) -> Option<PathBuf> {
let path = folder.join(file_name);
if path.exists() {
Some(path)
} else {
None
}
if path.exists() { Some(path) } else { None }
}

View File

@@ -46,9 +46,9 @@ pub fn target_triple() -> Result<String, crate::Error> {
.expect("could not find `target_arch` when running `rustc --print cfg`."),
Err(err) => {
log::warn!(
"failed to determine target arch using rustc, error: `{}`. The fallback is the architecture of the machine that compiled this crate.",
err,
);
"failed to determine target arch using rustc, error: `{}`. The fallback is the architecture of the machine that compiled this crate.",
err,
);
if cfg!(target_arch = "x86") {
"i686".into()
} else if cfg!(target_arch = "x86_64") {

View File

@@ -4,15 +4,15 @@
// SPDX-License-Identifier: MIT
use super::category::AppCategory;
use crate::{bundle::platform::target_triple, utils::fs_utils};
use anyhow::Context;
use crate::{bundle::platform::target_triple, error::Context, utils::fs_utils};
pub use tauri_utils::config::WebviewInstallMode;
use tauri_utils::{
config::{
BundleType, DeepLinkProtocol, FileAssociation, NSISInstallerMode, NsisCompression,
RpmCompression,
},
resources::{external_binaries, ResourcePaths},
platform::Target as TargetPlatform,
resources::{ResourcePaths, external_binaries},
};
use std::{
@@ -231,7 +231,7 @@ pub struct AppImageSettings {
pub struct RpmSettings {
/// The list of RPM dependencies your application relies on.
pub depends: Option<Vec<String>>,
/// the list of of RPM dependencies your application recommends.
/// the list of RPM dependencies your application recommends.
pub recommends: Option<Vec<String>>,
/// The list of RPM dependencies your application provides.
pub provides: Option<Vec<String>>,
@@ -306,6 +306,13 @@ pub struct DmgSettings {
pub application_folder_position: Position,
}
/// The iOS bundle settings.
#[derive(Clone, Debug, Default)]
pub struct IosSettings {
/// The version of the build that identifies an iteration of the bundle.
pub bundle_version: Option<String>,
}
/// The macOS bundle settings.
#[derive(Clone, Debug, Default)]
pub struct MacOsSettings {
@@ -323,6 +330,12 @@ pub struct MacOsSettings {
/// List of custom files to add to the application bundle.
/// Maps the path in the Contents directory in the app to the path of the file to include (relative to the current working directory).
pub files: HashMap<PathBuf, PathBuf>,
/// The version of the build that identifies an iteration of the bundle.
pub bundle_version: Option<String>,
/// The name of the build that identifies a string of the bundle.
///
/// If not set, defaults to the package's product name.
pub bundle_name: Option<String>,
/// A version string indicating the minimum MacOS version that the bundled app supports (e.g. `"10.11"`).
/// If you are using this config field, you may also want have your `build.rs` script emit `cargo:rustc-env=MACOSX_DEPLOYMENT_TARGET=10.11`.
pub minimum_system_version: Option<String>,
@@ -332,16 +345,43 @@ pub struct MacOsSettings {
pub exception_domain: Option<String>,
/// Code signing identity.
pub signing_identity: Option<String>,
/// Whether to wait for notarization to finish and `staple` the ticket onto the app.
///
/// Gatekeeper will look for stapled tickets to tell whether your app was notarized without
/// reaching out to Apple's servers which is helpful in offline environments.
///
/// Enabling this option will also result in `tauri build` not waiting for notarization to finish
/// which is helpful for the very first time your app is notarized as this can take multiple hours.
/// On subsequent runs, it's recommended to disable this setting again.
pub skip_stapling: bool,
/// Preserve the hardened runtime version flag, see <https://developer.apple.com/documentation/security/hardened_runtime>
///
/// Settings this to `false` is useful when using an ad-hoc signature, making it less strict.
pub hardened_runtime: bool,
/// Provider short name for notarization.
pub provider_short_name: Option<String>,
/// Path or contents of the entitlements.plist file.
pub entitlements: Option<Entitlements>,
/// Path to the Info.plist file or raw plist value to merge with the bundle Info.plist.
pub info_plist: Option<PlistKind>,
}
/// Entitlements for macOS code signing.
#[derive(Debug, Clone)]
pub enum Entitlements {
/// Path to the entitlements.plist file.
pub entitlements: Option<String>,
/// Path to the Info.plist file for the bundle.
pub info_plist_path: Option<PathBuf>,
Path(PathBuf),
/// Raw plist::Value.
Plist(plist::Value),
}
/// Plist format.
#[derive(Debug, Clone)]
pub enum PlistKind {
/// Path to a .plist file.
Path(PathBuf),
/// Raw plist value.
Plist(plist::Value),
}
/// Configuration for a target language for the WiX build.
@@ -549,6 +589,12 @@ pub struct WindowsSettings {
pub sign_command: Option<CustomSignCommandSettings>,
}
impl WindowsSettings {
pub(crate) fn can_sign(&self) -> bool {
self.sign_command.is_some() || self.certificate_thumbprint.is_some()
}
}
#[allow(deprecated)]
mod _default {
use super::*;
@@ -643,12 +689,16 @@ pub struct BundleSettings {
pub rpm: RpmSettings,
/// DMG-specific settings.
pub dmg: DmgSettings,
/// iOS-specific settings.
pub ios: IosSettings,
/// MacOS-specific settings.
pub macos: MacOsSettings,
/// Updater configuration.
pub updater: Option<UpdaterSettings>,
/// Windows-specific settings.
pub windows: WindowsSettings,
/// Path to the CEF (Chromium Embedded Framework) root directory.
pub cef_path: Option<PathBuf>,
}
/// A binary to bundle.
@@ -747,10 +797,16 @@ pub struct Settings {
local_tools_directory: Option<PathBuf>,
/// the bundle settings.
bundle_settings: BundleSettings,
/// Same as `bundle_settings.icon`, but without the .icon directory.
icon_files: Option<Vec<String>>,
/// the binaries to bundle.
binaries: Vec<BundleBinary>,
/// The target platform.
target_platform: TargetPlatform,
/// The target triple.
target: String,
/// Whether to disable code signing during the bundling process.
no_sign: bool,
}
/// A builder for [`Settings`].
@@ -764,6 +820,7 @@ pub struct SettingsBuilder {
binaries: Vec<BundleBinary>,
target: Option<String>,
local_tools_directory: Option<PathBuf>,
no_sign: bool,
}
impl SettingsBuilder {
@@ -833,6 +890,13 @@ impl SettingsBuilder {
self
}
/// Sets whether to skip code signing.
#[must_use]
pub fn no_sign(mut self, no_sign: bool) -> Self {
self.no_sign = no_sign;
self
}
/// Builds a Settings from the CLI args.
///
/// Package settings will be read from Cargo.toml.
@@ -844,6 +908,15 @@ impl SettingsBuilder {
} else {
target_triple()?
};
let target_platform = TargetPlatform::from_triple(&target);
let icon_files = self.bundle_settings.icon.as_ref().map(|paths| {
paths
.iter()
.filter(|p| !p.ends_with(".icon"))
.cloned()
.collect()
});
Ok(Settings {
log_level: self.log_level.unwrap_or(log::Level::Error),
@@ -861,10 +934,13 @@ impl SettingsBuilder {
.bundle_settings
.external_bin
.as_ref()
.map(|bins| external_binaries(bins, &target)),
.map(|bins| external_binaries(bins, &target, &target_platform)),
..self.bundle_settings
},
icon_files,
target_platform,
target,
no_sign: self.no_sign,
})
}
}
@@ -890,6 +966,16 @@ impl Settings {
&self.target
}
/// Returns the [`TargetPlatform`].
pub fn target_platform(&self) -> &TargetPlatform {
&self.target_platform
}
/// Raw list of icons.
pub fn icons(&self) -> Option<&Vec<String>> {
self.bundle_settings.icon.as_ref()
}
/// Returns the architecture for the binary being bundled (e.g. "arm", "x86" or "x86_64").
pub fn binary_arch(&self) -> Arch {
if self.target.starts_with("x86_64") {
@@ -918,7 +1004,6 @@ impl Settings {
.iter()
.find(|bin| bin.main)
.context("failed to find main binary, make sure you have a `package > default-run` in the Cargo.toml file")
.map_err(Into::into)
}
/// Returns the file name of the binary being bundled.
@@ -928,7 +1013,6 @@ impl Settings {
.iter_mut()
.find(|bin| bin.main)
.context("failed to find main binary, make sure you have a `package > default-run` in the Cargo.toml file")
.map_err(Into::into)
}
/// Returns the file name of the binary being bundled.
@@ -939,24 +1023,27 @@ impl Settings {
.find(|bin| bin.main)
.context("failed to find main binary, make sure you have a `package > default-run` in the Cargo.toml file")
.map(|b| b.name())
.map_err(Into::into)
}
/// Returns the path to the specified binary.
pub fn binary_path(&self, binary: &BundleBinary) -> PathBuf {
let target_os = self
.target()
.split('-')
.nth(2)
.unwrap_or(std::env::consts::OS);
let target_os = self.target_platform();
let path = self.project_out_directory.join(binary.name());
let mut path = self.project_out_directory.join(binary.name());
if target_os == "windows" {
path.with_extension("exe")
} else {
path
}
if matches!(target_os, TargetPlatform::Windows) {
// Append the `.exe` extension without overriding the existing extensions
let extension = if let Some(extension) = path.extension() {
let mut extension = extension.to_os_string();
extension.push(".exe");
extension
} else {
"exe".into()
};
path.set_extension(extension);
};
path
}
/// Returns the list of binaries to bundle.
@@ -974,22 +1061,17 @@ impl Settings {
///
/// Fails if the host/target's native package type is not supported.
pub fn package_types(&self) -> crate::Result<Vec<PackageType>> {
let target_os = self
.target
.split('-')
.nth(2)
.unwrap_or(std::env::consts::OS)
.replace("darwin", "macos");
let target_os = self.target_platform();
let platform_types = match target_os.as_str() {
"macos" => vec![PackageType::MacOsBundle, PackageType::Dmg],
"ios" => vec![PackageType::IosBundle],
"linux" => vec![PackageType::Deb, PackageType::Rpm, PackageType::AppImage],
"windows" => vec![PackageType::WindowsMsi, PackageType::Nsis],
let platform_types = match target_os {
TargetPlatform::MacOS => vec![PackageType::MacOsBundle, PackageType::Dmg],
TargetPlatform::Ios => vec![PackageType::IosBundle],
TargetPlatform::Linux => vec![PackageType::Deb, PackageType::Rpm, PackageType::AppImage],
TargetPlatform::Windows => vec![PackageType::WindowsMsi, PackageType::Nsis],
os => {
return Err(crate::Error::GenericError(format!(
"Native {os} bundles not yet supported."
)))
)));
}
};
@@ -1028,7 +1110,7 @@ impl Settings {
/// Returns an iterator over the icon files to be used for this bundle.
pub fn icon_files(&self) -> ResourcePaths<'_> {
match self.bundle_settings.icon {
match self.icon_files {
Some(ref paths) => ResourcePaths::new(paths.as_slice(), false),
None => ResourcePaths::new(&[], false),
}
@@ -1190,11 +1272,21 @@ impl Settings {
&self.bundle_settings.dmg
}
/// Returns the iOS settings.
pub fn ios(&self) -> &IosSettings {
&self.bundle_settings.ios
}
/// Returns the MacOS settings.
pub fn macos(&self) -> &MacOsSettings {
&self.bundle_settings.macos
}
/// Returns the bundle settings.
pub fn bundle_settings(&self) -> &BundleSettings {
&self.bundle_settings
}
/// Returns the Windows settings.
pub fn windows(&self) -> &WindowsSettings {
&self.bundle_settings.windows
@@ -1204,4 +1296,14 @@ impl Settings {
pub fn updater(&self) -> Option<&UpdaterSettings> {
self.bundle_settings.updater.as_ref()
}
/// Whether to skip signing.
pub fn no_sign(&self) -> bool {
self.no_sign
}
/// Set whether to skip signing.
pub fn set_no_sign(&mut self, no_sign: bool) {
self.no_sign = no_sign;
}
}

View File

@@ -4,17 +4,18 @@
// SPDX-License-Identifier: MIT
use crate::{
Settings,
bundle::{
Bundle,
windows::{
NSIS_OUTPUT_FOLDER_NAME, NSIS_UPDATER_OUTPUT_FOLDER_NAME, WIX_OUTPUT_FOLDER_NAME,
WIX_UPDATER_OUTPUT_FOLDER_NAME,
},
Bundle,
},
error::{Context, ErrorExt},
utils::fs_utils,
Settings,
};
use tauri_utils::display_path;
use tauri_utils::{display_path, platform::Target as TargetPlatform};
use std::{
fs::{self, File},
@@ -22,19 +23,13 @@ use std::{
path::{Path, PathBuf},
};
use anyhow::Context;
use zip::write::SimpleFileOptions;
// Build update
pub fn bundle_project(settings: &Settings, bundles: &[Bundle]) -> crate::Result<Vec<PathBuf>> {
let target_os = settings
.target()
.split('-')
.nth(2)
.unwrap_or(std::env::consts::OS)
.replace("darwin", "macos");
let target_os = settings.target_platform();
if target_os == "windows" {
if matches!(target_os, TargetPlatform::Windows) {
return bundle_update_windows(settings, bundles);
}
@@ -124,11 +119,11 @@ fn bundle_update_linux(bundles: &[Bundle]) -> crate::Result<Vec<PathBuf>> {
// Right now in windows we hot replace the bin and request a restart
// No assets are replaced
fn bundle_update_windows(settings: &Settings, bundles: &[Bundle]) -> crate::Result<Vec<PathBuf>> {
use crate::PackageType;
use crate::bundle::settings::WebviewInstallMode;
#[cfg(target_os = "windows")]
use crate::bundle::windows::msi;
use crate::bundle::windows::nsis;
use crate::PackageType;
// find our installers or rebuild
let mut bundle_paths = Vec::new();
@@ -176,24 +171,24 @@ fn bundle_update_windows(settings: &Settings, bundles: &[Bundle]) -> crate::Resu
source_path
.components()
.fold((PathBuf::new(), String::new()), |(mut p, mut b), c| {
if let std::path::Component::Normal(name) = c {
if let Some(name) = name.to_str() {
// installers bundled for updater should be put in a directory named `${bundle_name}-updater`
if name == WIX_UPDATER_OUTPUT_FOLDER_NAME || name == NSIS_UPDATER_OUTPUT_FOLDER_NAME {
b = name.strip_suffix("-updater").unwrap().to_string();
p.push(&b);
return (p, b);
}
if let std::path::Component::Normal(name) = c
&& let Some(name) = name.to_str()
{
// installers bundled for updater should be put in a directory named `${bundle_name}-updater`
if name == WIX_UPDATER_OUTPUT_FOLDER_NAME || name == NSIS_UPDATER_OUTPUT_FOLDER_NAME {
b = name.strip_suffix("-updater").unwrap().to_string();
p.push(&b);
return (p, b);
}
if name == WIX_OUTPUT_FOLDER_NAME || name == NSIS_OUTPUT_FOLDER_NAME {
b = name.to_string();
}
if name == WIX_OUTPUT_FOLDER_NAME || name == NSIS_OUTPUT_FOLDER_NAME {
b = name.to_string();
}
}
p.push(c);
(p, b)
});
let archived_path = archived_path.with_extension(format!("{}.zip", bundle_name));
let archived_path = archived_path.with_extension(format!("{bundle_name}.zip"));
log::info!(action = "Bundling"; "{}", display_path(&archived_path));
@@ -221,7 +216,9 @@ pub fn create_zip(src_file: &Path, dst_file: &Path) -> crate::Result<PathBuf> {
.unix_permissions(0o755);
zip.start_file(file_name.to_string_lossy(), options)?;
let mut f = File::open(src_file)?;
let mut f =
File::open(src_file).fs_context("failed to open updater ZIP file", src_file.to_path_buf())?;
let mut buffer = Vec::new();
f.read_to_end(&mut buffer)?;
zip.write_all(&buffer)?;
@@ -232,7 +229,7 @@ pub fn create_zip(src_file: &Path, dst_file: &Path) -> crate::Result<PathBuf> {
#[cfg(any(target_os = "linux", target_os = "macos"))]
fn create_tar(src_dir: &Path, dest_path: &Path) -> crate::Result<PathBuf> {
use flate2::{write::GzEncoder, Compression};
use flate2::{Compression, write::GzEncoder};
let dest_file = fs_utils::create_file(dest_path)?;
let gzip_encoder = GzEncoder::new(dest_file, Compression::default());

View File

@@ -5,6 +5,7 @@
#[cfg(target_os = "windows")]
pub mod msi;
pub mod nsis;
pub mod sign;

View File

@@ -70,12 +70,16 @@
<Property Id="ARPURLUPDATEINFO" Value="{{homepage}}"/>
{{/if}}
<!-- NOTE: The order of RegistrySearch elements below matters. In WIX, when multiple
RegistrySearch elements are listed under a single Property, the LAST successful
match wins. We list the NSIS default-key search first and the MSI InstallDir
search second so that the MSI-specific path takes priority when both keys exist. -->
<Property Id="INSTALLDIR">
<!-- First attempt: Search for "InstallDir" -->
<RegistrySearch Id="PrevInstallDirWithName" Root="HKCU" Key="Software\\{{manufacturer}}\\{{product_name}}" Name="InstallDir" Type="raw" />
<!-- Second attempt: If the first fails, search for the default key value (this is how the nsis installer currently stores the path) -->
<!-- First attempt: Search for the default key value (this is how the nsis installer stores the path) -->
<RegistrySearch Id="PrevInstallDirNoName" Root="HKCU" Key="Software\\{{manufacturer}}\\{{product_name}}" Type="raw" />
<!-- Second attempt: Search for "InstallDir" which takes priority if found (this is how the msi installer stores the path) -->
<RegistrySearch Id="PrevInstallDirWithName" Root="HKCU" Key="Software\\{{manufacturer}}\\{{product_name}}" Name="InstallDir" Type="raw" />
</Property>
<!-- launch app checkbox -->

View File

@@ -7,21 +7,21 @@ use crate::{
bundle::{
settings::{Arch, Settings},
windows::{
sign::try_sign,
sign::{should_sign, try_sign},
util::{
download_webview2_bootstrapper, download_webview2_offline_installer,
WIX_OUTPUT_FOLDER_NAME, WIX_UPDATER_OUTPUT_FOLDER_NAME,
WIX_OUTPUT_FOLDER_NAME, WIX_UPDATER_OUTPUT_FOLDER_NAME, download_webview2_bootstrapper,
download_webview2_offline_installer,
},
},
},
error::{Context, ErrorExt},
utils::{
fs_utils::copy_file,
http_utils::{download_and_verify, extract_zip, HashAlgorithm},
CommandExt,
fs_utils::copy_file,
http_utils::{HashAlgorithm, download_and_verify, extract_zip},
},
};
use anyhow::{bail, Context};
use handlebars::{html_escape, to_json, Handlebars};
use handlebars::{Handlebars, html_escape, to_json};
use regex::Regex;
use serde::{Deserialize, Serialize};
use std::{
@@ -177,7 +177,7 @@ impl ResourceDirectory {
directories.push_str(wix_string.as_str());
}
let wix_string = if self.name.is_empty() {
format!("{}{}", files, directories)
format!("{files}{directories}")
} else {
format!(
r#"<Directory Id="I{id}" Name="{name}">{files}{directories}</Directory>"#,
@@ -221,9 +221,8 @@ fn app_installer_output_path(
Arch::AArch64 => "arm64",
target => {
return Err(crate::Error::ArchError(format!(
"Unsupported architecture: {:?}",
target
)))
"Unsupported architecture: {target:?}"
)));
}
};
@@ -280,37 +279,40 @@ fn clear_env_for_wix(cmd: &mut Command) {
}
}
fn validate_wix_version(version_str: &str) -> anyhow::Result<()> {
fn validate_wix_version(version_str: &str) -> crate::Result<()> {
let components = version_str
.split('.')
.flat_map(|c| c.parse::<u64>().ok())
.collect::<Vec<_>>();
anyhow::ensure!(
components.len() >= 3,
"app wix version should be in the format major.minor.patch.build (build is optional)"
);
if components.len() < 3 {
crate::error::bail!(
"app wix version should be in the format major.minor.patch.build (build is optional)"
);
}
if components[0] > 255 {
bail!("app version major number cannot be greater than 255");
crate::error::bail!("app version major number cannot be greater than 255");
}
if components[1] > 255 {
bail!("app version minor number cannot be greater than 255");
crate::error::bail!("app version minor number cannot be greater than 255");
}
if components[2] > 65535 {
bail!("app version patch number cannot be greater than 65535");
crate::error::bail!("app version patch number cannot be greater than 65535");
}
if components.len() == 4 && components[3] > 65535 {
bail!("app version build number cannot be greater than 65535");
crate::error::bail!("app version build number cannot be greater than 65535");
}
Ok(())
}
// WiX requires versions to be numeric only in a `major.minor.patch.build` format
fn convert_version(version_str: &str) -> anyhow::Result<String> {
let version = semver::Version::parse(version_str).context("invalid app version")?;
fn convert_version(version_str: &str) -> crate::Result<String> {
let version = semver::Version::parse(version_str)
.map_err(Into::into)
.context("invalid app version")?;
if !version.build.is_empty() {
let build = version.build.parse::<u64>();
if build.map(|b| b <= 65535).unwrap_or_default() {
@@ -319,7 +321,9 @@ fn convert_version(version_str: &str) -> anyhow::Result<String> {
version.major, version.minor, version.patch, version.build
));
} else {
bail!("optional build metadata in app version must be numeric-only and cannot be greater than 65535 for msi target");
crate::error::bail!(
"optional build metadata in app version must be numeric-only and cannot be greater than 65535 for msi target"
);
}
}
@@ -331,7 +335,9 @@ fn convert_version(version_str: &str) -> anyhow::Result<String> {
version.major, version.minor, version.patch, version.pre
));
} else {
bail!("optional pre-release identifier in app version must be numeric-only and cannot be greater than 65535 for msi target");
crate::error::bail!(
"optional pre-release identifier in app version must be numeric-only and cannot be greater than 65535 for msi target"
);
}
}
@@ -352,9 +358,8 @@ fn run_candle(
Arch::AArch64 => "arm64",
target => {
return Err(crate::Error::ArchError(format!(
"unsupported architecture: {:?}",
target
)))
"unsupported architecture: {target:?}"
)));
}
};
@@ -389,11 +394,7 @@ fn run_candle(
cmd.arg(ext);
}
clear_env_for_wix(&mut cmd);
cmd
.args(&args)
.current_dir(cwd)
.output_ok()
.context("error running candle.exe")?;
cmd.args(&args).current_dir(cwd).output_ok()?;
Ok(())
}
@@ -418,11 +419,7 @@ fn run_light(
cmd.arg(ext);
}
clear_env_for_wix(&mut cmd);
cmd
.args(&args)
.current_dir(build_path)
.output_ok()
.context("error running light.exe")?;
cmd.args(&args).current_dir(build_path).output_ok()?;
Ok(())
}
@@ -443,9 +440,8 @@ pub fn build_wix_app_installer(
Arch::AArch64 => "arm64",
target => {
return Err(crate::Error::ArchError(format!(
"unsupported architecture: {:?}",
target
)))
"unsupported architecture: {target:?}"
)));
}
};
@@ -472,6 +468,15 @@ pub fn build_wix_app_installer(
}
fs::create_dir_all(&output_path)?;
// when we're performing code signing, we'll sign some WiX DLLs, so we make a local copy
let wix_toolset_path = if settings.windows().can_sign() {
let wix_path = output_path.join("wix");
crate::utils::fs_utils::copy_dir(wix_toolset_path, &wix_path)?;
wix_path
} else {
wix_toolset_path.to_path_buf()
};
let mut data = BTreeMap::new();
let silent_webview_install = if let WebviewInstallMode::DownloadBootstrapper { silent }
@@ -696,7 +701,9 @@ pub fn build_wix_app_installer(
.iter()
.flat_map(|p| &p.schemes)
.collect::<Vec<_>>();
data.insert("deep_link_protocols", to_json(schemes));
if !schemes.is_empty() {
data.insert("deep_link_protocols", to_json(schemes));
}
}
if let Some(path) = custom_template_path {
@@ -750,22 +757,28 @@ pub fn build_wix_app_installer(
}
let main_wxs_path = output_path.join("main.wxs");
fs::write(main_wxs_path, handlebars.render("main.wxs", &data)?)?;
fs::write(&main_wxs_path, handlebars.render("main.wxs", &data)?)?;
let mut candle_inputs = vec![("main.wxs".into(), Vec::new())];
let mut candle_inputs = vec![];
let current_dir = std::env::current_dir()?;
let extension_regex = Regex::new("\"http://schemas.microsoft.com/wix/(\\w+)\"")?;
for fragment_path in fragment_paths {
let fragment_path = current_dir.join(fragment_path);
let fragment_content = fs::read_to_string(&fragment_path)?;
let fragment_handlebars = Handlebars::new();
let fragment = fragment_handlebars.render_template(&fragment_content, &data)?;
let input_paths =
std::iter::once(main_wxs_path).chain(fragment_paths.iter().map(|p| current_dir.join(p)));
for input_path in input_paths {
let input_content = fs::read_to_string(&input_path)?;
let input_handlebars = Handlebars::new();
let input = input_handlebars.render_template(&input_content, &data)?;
let mut extensions = Vec::new();
for cap in extension_regex.captures_iter(&fragment) {
extensions.push(wix_toolset_path.join(format!("Wix{}.dll", &cap[1])));
for cap in extension_regex.captures_iter(&input) {
let path = wix_toolset_path.join(format!("Wix{}.dll", &cap[1]));
if settings.windows().can_sign() {
try_sign(&path, settings)?;
}
extensions.push(path);
}
candle_inputs.push((fragment_path, extensions));
candle_inputs.push((input_path, extensions));
}
let mut fragment_extensions = HashSet::new();
@@ -773,11 +786,18 @@ pub fn build_wix_app_installer(
fragment_extensions.insert(wix_toolset_path.join("WixUIExtension.dll"));
fragment_extensions.insert(wix_toolset_path.join("WixUtilExtension.dll"));
// sign default extensions
if settings.windows().can_sign() {
for path in &fragment_extensions {
try_sign(path, settings)?;
}
}
for (path, extensions) in candle_inputs {
for ext in &extensions {
fragment_extensions.insert(ext.clone());
}
run_candle(settings, wix_toolset_path, &output_path, path, extensions)?;
run_candle(settings, &wix_toolset_path, &output_path, path, extensions)?;
}
let mut output_paths = Vec::new();
@@ -824,7 +844,7 @@ pub fn build_wix_app_installer(
let locale_contents = locale_contents.replace(
"</WixLocalization>",
&format!("{}</WixLocalization>", unset_locale_strings),
&format!("{unset_locale_strings}</WixLocalization>"),
);
let locale_path = output_path.join("locale.wxl");
{
@@ -853,7 +873,7 @@ pub fn build_wix_app_installer(
log::info!(action = "Running"; "light to produce {}", display_path(&msi_path));
run_light(
wix_toolset_path,
&wix_toolset_path,
&output_path,
arguments,
&(fragment_extensions.clone().into_iter().collect()),
@@ -861,7 +881,7 @@ pub fn build_wix_app_installer(
)?;
fs::rename(&msi_output_path, &msi_path)?;
if settings.can_sign() {
if settings.windows().can_sign() {
try_sign(&msi_path, settings)?;
}
@@ -968,9 +988,12 @@ fn generate_resource_data(settings: &Settings) -> crate::Result<ResourceMap> {
if added_resources.contains(&resource_path) {
continue;
}
added_resources.push(resource_path.clone());
if settings.windows().can_sign() && should_sign(&resource_path)? {
try_sign(&resource_path, settings)?;
}
let resource_entry = ResourceFile {
id: format!("I{}", Uuid::new_v4().as_simple()),
guid: Uuid::new_v4().to_string(),
@@ -1038,40 +1061,136 @@ fn generate_resource_data(settings: &Settings) -> crate::Result<ResourceMap> {
directory_entry.add_file(resource_entry);
}
let mut dlls = Vec::new();
// Adding WebViewer2Loader.dll in case windows-gnu toolchain is used
if settings.target().ends_with("-gnu") {
let loader_path =
dunce::simplified(&settings.project_out_directory().join("WebView2Loader.dll")).to_path_buf();
// TODO: The bundler should not include all DLLs it finds. Instead it should only include WebView2Loader.dll if present and leave the rest to the resources config.
let out_dir = settings.project_out_directory();
for dll in glob::glob(
&PathBuf::from(glob::Pattern::escape(&out_dir.to_string_lossy()))
.join("*.dll")
.to_string_lossy(),
)? {
let path = dll?;
let resource_path = dunce::simplified(&path);
let relative_path = path
.strip_prefix(out_dir)
.unwrap()
.to_string_lossy()
.into_owned();
if !added_resources.iter().any(|r| r.ends_with(&relative_path)) {
dlls.push(ResourceFile {
if loader_path.exists() {
if settings.windows().can_sign() {
try_sign(&loader_path, settings)?;
}
added_resources.push(loader_path.clone());
let loader_resource = ResourceFile {
id: format!("I{}", Uuid::new_v4().as_simple()),
guid: Uuid::new_v4().to_string(),
path: resource_path.to_path_buf(),
});
path: loader_path,
};
resources
.entry("".to_string())
.and_modify(|r| r.files.push(loader_resource.clone()))
.or_insert(ResourceDirectory {
path: "".to_string(),
name: "".to_string(),
directories: vec![],
files: vec![loader_resource],
});
}
}
if !dlls.is_empty() {
// Handle CEF support if cef_path is set,
// using https://github.com/chromiumembedded/cef/blob/master/tools/distrib/win/README.redistrib.txt as a reference
if let Some(cef_path) = settings.bundle_settings().cef_path.as_ref() {
let project_out = settings.project_out_directory();
let cef_filenames = [
// required
"libcef.dll",
"chrome_elf.dll",
"icudtl.dat",
"v8_context_snapshot.bin",
// required end
// "optional" - but not really since we want support for all of this
"chrome_100_percent.pak",
"chrome_200_percent.pak",
"resources.pak",
// Direct3D support
"d3dcompiler_47.dll",
// DirectX compiler support
// TODO: check if x64 means no arm64
"dxil.dll",
"dxcompiler.dll",
// ANGEL support
"libEGL.dll",
"libGLESv2.dll",
// SwANGLE support
"vk_swiftshader.dll",
"vk_swiftshader_icd.json",
"vulkan-1.dll",
// sandbox - may need to be behind a setting?
"bootstrap.exe",
"bootstrapc.exe",
];
let mut cef_files = Vec::with_capacity(cef_filenames.len());
for f in cef_filenames {
let from = cef_path.join(f);
let path = dunce::simplified(&project_out.join(f)).to_path_buf();
fs::copy(&from, &path).fs_context("failed to copy CEF file for MSI bundle", from)?;
if settings.windows().can_sign() && should_sign(&path)? {
try_sign(&path, settings)?;
}
cef_files.push(ResourceFile {
id: format!("I{}", Uuid::new_v4().as_simple()),
guid: Uuid::new_v4().to_string(),
path,
});
}
for f in &cef_files {
added_resources.push(f.path.clone());
}
resources
.entry("".to_string())
.and_modify(|r| r.files.append(&mut dlls))
.and_modify(|r| r.files.append(&mut cef_files))
.or_insert(ResourceDirectory {
path: "".to_string(),
name: "".to_string(),
directories: vec![],
files: dlls,
files: cef_files,
});
// TODO: locales?
// crash without at least en
let locale_names = [
"en-US.pak",
"en-US_FEMININE.pak",
"en-US_MASCULINE.pak",
"en-US_NEUTER.pak",
];
let locales_out = dunce::simplified(&project_out.join("locales")).to_path_buf();
fs::create_dir_all(&locales_out).fs_context(
"failed to create locales directory for CEF",
locales_out.clone(),
)?;
let mut locales = Vec::with_capacity(locale_names.len());
for f in locale_names {
let target_file = PathBuf::from("locales").join(f);
let from = cef_path.join("locales").join(f);
let path = dunce::simplified(&locales_out.join(f)).to_path_buf();
fs::copy(&from, &path).fs_context("failed to copy CEF locale for MSI bundle", from)?;
locales.push(ResourceFile {
id: format!("I{}", Uuid::new_v4().as_simple()),
guid: Uuid::new_v4().to_string(),
path,
});
}
for f in &locales {
added_resources.push(f.path.clone());
}
resources
.entry("locales".to_string())
.and_modify(|r| r.files.append(&mut locales))
.or_insert(ResourceDirectory {
path: "locales".to_string(),
name: "locales".to_string(),
directories: vec![],
files: locales,
});
}

View File

@@ -47,7 +47,7 @@ ${StrLoc}
!define COPYRIGHT "{{copyright}}"
!define OUTFILE "{{out_file}}"
!define ARCH "{{arch}}"
!define PLUGINSPATH "{{additional_plugins_path}}"
!define ADDITIONALPLUGINSPATH "{{additional_plugins_path}}"
!define ALLOWDOWNGRADES "{{allow_downgrades}}"
!define DISPLAYLANGUAGESELECTOR "{{display_language_selector}}"
!define INSTALLWEBVIEW2MODE "{{install_webview2_mode}}"
@@ -85,10 +85,8 @@ VIAddVersionKey "LegalCopyright" "${COPYRIGHT}"
VIAddVersionKey "FileVersion" "${VERSION}"
VIAddVersionKey "ProductVersion" "${VERSION}"
; Plugins path, currently exists for linux only
!if "${PLUGINSPATH}" != ""
!addplugindir "${PLUGINSPATH}"
!endif
# additional plugins
!addplugindir "${ADDITIONALPLUGINSPATH}"
; Uninstaller signing command
!if "${UNINSTALLERSIGNCOMMAND}" != ""
@@ -97,7 +95,7 @@ VIAddVersionKey "ProductVersion" "${VERSION}"
; Handle install mode, `perUser`, `perMachine` or `both`
!if "${INSTALLMODE}" == "perMachine"
RequestExecutionLevel highest
RequestExecutionLevel admin
!endif
!if "${INSTALLMODE}" == "currentUser"
@@ -620,7 +618,7 @@ Section Install
!insertmacro NSIS_HOOK_PREINSTALL
!endif
!insertmacro CheckIfAppIsRunning
!insertmacro CheckIfAppIsRunning "${MAINBINARYNAME}.exe" "${PRODUCTNAME}"
; Copy main executable
File "${MAINBINARYSRCPATH}"
@@ -630,12 +628,12 @@ Section Install
CreateDirectory "$INSTDIR\\{{this}}"
{{/each}}
{{#each resources}}
File /a "/oname={{this.[1]}}" "{{@key}}"
File /a "/oname={{this.[1]}}" "{{no-escape @key}}"
{{/each}}
; Copy external binaries
{{#each binaries}}
File /a "/oname={{this}}" "{{@key}}"
File /a "/oname={{this}}" "{{no-escape @key}}"
{{/each}}
; Create file associations
@@ -757,7 +755,7 @@ Section Uninstall
!insertmacro NSIS_HOOK_PREUNINSTALL
!endif
!insertmacro CheckIfAppIsRunning
!insertmacro CheckIfAppIsRunning "${MAINBINARYNAME}.exe" "${PRODUCTNAME}"
; Delete the app directory and its content from disk
; Copy main executable

View File

@@ -1,14 +1,14 @@
LangString addOrReinstall ${LANG_ARABIC} "إضافة أو إزالة المكونات"
LangString alreadyInstalled ${LANG_ARABIC} "التطبيق مثبت بالفعل"
LangString alreadyInstalledLong ${LANG_ARABIC} "${PRODUCTNAME} ${VERSION} مثبت بالفعل. قم باختيار العملية التى تريدها ثم اضغط على التالى."
LangString appRunning ${LANG_ARABIC} "${PRODUCTNAME} مازال يعمل! من فضلك، قم بإغلاق التطبيق أولاً ثم حاول مرة أخرى."
LangString appRunningOkKill ${LANG_ARABIC} "${PRODUCTNAME} مازال يعمل!$\nاضغط OK لإغلاقه"
LangString appRunning ${LANG_ARABIC} "{{product_name}} مازال يعمل! من فضلك، قم بإغلاق التطبيق أولاً ثم حاول مرة أخرى."
LangString appRunningOkKill ${LANG_ARABIC} "{{product_name}} مازال يعمل!$\nاضغط OK لإغلاقه"
LangString chooseMaintenanceOption ${LANG_ARABIC} "قم باختيار نوع الصيانة التى تريدها."
LangString choowHowToInstall ${LANG_ARABIC} "قم باختيار طريقة تنصيب ${PRODUCTNAME}."
LangString createDesktop ${LANG_ARABIC} "اضف اختصار على سطح المكتب"
LangString dontUninstall ${LANG_ARABIC} "عدم إزالة"
LangString dontUninstallDowngrade ${LANG_ARABIC} "عدم إزالة (التخفيض بدون إزالة غير مسموح لهذا المثبت)"
LangString failedToKillApp ${LANG_ARABIC} "فشل فى غلف ${PRODUCTNAME}. من فضلك، قم بإغلاق التطبيق أولاً ثم حاول مرة أخرى."
LangString failedToKillApp ${LANG_ARABIC} "فشل فى غلف {{product_name}}. من فضلك، قم بإغلاق التطبيق أولاً ثم حاول مرة أخرى."
LangString installingWebview2 ${LANG_ARABIC} "تنصيب WebView2..."
LangString newerVersionInstalled ${LANG_ARABIC} "يوجد نسخة جديدة من ${PRODUCTNAME} مثبتة بالغعل! لا ينصح بتنصيب نسخة اقدم من النسخة الحالية. اذا مازلت ترغب فى تنصيب النسخة الأقدم، فينصح بإزالة النسخة الحالية أولاً. قم باختيار العملية التى تريدها ثم اضغط على التالى للاستمرار."
LangString older ${LANG_ARABIC} "أقدم"

View File

@@ -1,14 +1,14 @@
LangString addOrReinstall ${LANG_BULGARIAN} "Добавяне/Преинсталиране на компоненти"
LangString alreadyInstalled ${LANG_BULGARIAN} "Вече инсталиран"
LangString alreadyInstalledLong ${LANG_BULGARIAN} "${PRODUCTNAME} ${VERSION} е вече е инсталиран. Изберете операцията, която искате да извършите и натиснете Напред, за да продължите."
LangString appRunning ${LANG_BULGARIAN} "${PRODUCTNAME} е отворен! Моля, затворете го първо и опитайте отново."
LangString appRunningOkKill ${LANG_BULGARIAN} "${PRODUCTNAME} е отворен!$\nНатиснете ОК, за да го затворите."
LangString appRunning ${LANG_BULGARIAN} "{{product_name}} е отворен! Моля, затворете го първо и опитайте отново."
LangString appRunningOkKill ${LANG_BULGARIAN} "{{product_name}} е отворен!$\nНатиснете ОК, за да го затворите."
LangString chooseMaintenanceOption ${LANG_BULGARIAN} "Изберете опция за поддръжка."
LangString choowHowToInstall ${LANG_BULGARIAN} "Изберете как искате да инсталирате ${PRODUCTNAME}."
LangString createDesktop ${LANG_BULGARIAN} "Създайте пряк път на работния плот"
LangString dontUninstall ${LANG_BULGARIAN} "Не деинсталирайте"
LangString dontUninstallDowngrade ${LANG_BULGARIAN} "Не деинсталирайте (Понижаването без деинсталация е забранено за този инсталатор)"
LangString failedToKillApp ${LANG_BULGARIAN} "Неуспешно прекратяване на ${PRODUCTNAME}. Моля, затворете го първо и опитайте отново."
LangString failedToKillApp ${LANG_BULGARIAN} "Неуспешно прекратяване на {{product_name}}. Моля, затворете го първо и опитайте отново."
LangString installingWebview2 ${LANG_BULGARIAN} "Инсталиране на WebView2..."
LangString newerVersionInstalled ${LANG_BULGARIAN} "Вече е инсталирана по-нова версия на ${PRODUCTNAME}! Не се препоръчва да инсталирате по-стара версия. Ако наистина желаете да инсталирате тази по-стара версия, по-добре е да деинсталирате текущата версия първо. Изберете операцията, която искате да извършите и натиснете Напред, за да продължите."
LangString older ${LANG_BULGARIAN} "по-стара"

View File

@@ -1,14 +1,14 @@
LangString addOrReinstall ${LANG_DUTCH} "(Her)installeer componenten"
LangString alreadyInstalled ${LANG_DUTCH} "Al geïnstalleerd"
LangString alreadyInstalledLong ${LANG_DUTCH} "${PRODUCTNAME} ${VERSION} is al geïnstalleerd. Kies een van de volgende opties en klik op Volgende om door te gaan."
LangString appRunning ${LANG_DUTCH} "${PRODUCTNAME} is geopend! Sluit het programma eerst en probeer het dan opnieuw."
LangString appRunningOkKill ${LANG_DUTCH} "${PRODUCTNAME} is geopend!$\nKlik op OK om het te stoppen."
LangString appRunning ${LANG_DUTCH} "{{product_name}} is geopend! Sluit het programma eerst en probeer het dan opnieuw."
LangString appRunningOkKill ${LANG_DUTCH} "{{product_name}} is geopend!$\nKlik op OK om het te stoppen."
LangString chooseMaintenanceOption ${LANG_DUTCH} "Kies de onderhoudsoptie die u wilt uitvoeren."
LangString choowHowToInstall ${LANG_DUTCH} "Kies hoe u ${PRODUCTNAME} wilt installeren."
LangString createDesktop ${LANG_DUTCH} "Maak een snelkoppeling aan op het bureaublad"
LangString dontUninstall ${LANG_DUTCH} "Deïnstalleer niet"
LangString dontUninstallDowngrade ${LANG_DUTCH} "Deïnstalleer niet (Downgraden zonder deïnstalleren is uitgeschakeld voor deze installer)"
LangString failedToKillApp ${LANG_DUTCH} "Het is niet gelukt ${PRODUCTNAME} te stoppen. Sluit het eerst zelf en probeer het dan nog een keer"
LangString failedToKillApp ${LANG_DUTCH} "Het is niet gelukt {{product_name}} te stoppen. Sluit het eerst zelf en probeer het dan nog een keer"
LangString installingWebview2 ${LANG_DUTCH} "WebView2 wordt geïnstalleerd..."
LangString newerVersionInstalled ${LANG_DUTCH} "Een nieuwere versie van ${PRODUCTNAME} is al geïnstalleerd! Het word niet aangeraden om een oudere versie te installeren. Als u echt deze oudere versie wilt installeren, kunt u beter de huidige versie eerst deïnstalleren. Kies een van de volgende opties en klik op Volgende om door te gaan."
LangString older ${LANG_DUTCH} "oudere"

View File

@@ -1,14 +1,14 @@
LangString addOrReinstall ${LANG_ENGLISH} "Add/Reinstall components"
LangString alreadyInstalled ${LANG_ENGLISH} "Already Installed"
LangString alreadyInstalledLong ${LANG_ENGLISH} "${PRODUCTNAME} ${VERSION} is already installed. Select the operation you want to perform and click Next to continue."
LangString appRunning ${LANG_ENGLISH} "${PRODUCTNAME} is running! Please close it first then try again."
LangString appRunningOkKill ${LANG_ENGLISH} "${PRODUCTNAME} is running!$\nClick OK to kill it"
LangString appRunning ${LANG_ENGLISH} "{{product_name}} is running! Please close it first then try again."
LangString appRunningOkKill ${LANG_ENGLISH} "{{product_name}} is running!$\nClick OK to kill it"
LangString chooseMaintenanceOption ${LANG_ENGLISH} "Choose the maintenance option to perform."
LangString choowHowToInstall ${LANG_ENGLISH} "Choose how you want to install ${PRODUCTNAME}."
LangString createDesktop ${LANG_ENGLISH} "Create desktop shortcut"
LangString dontUninstall ${LANG_ENGLISH} "Do not uninstall"
LangString dontUninstallDowngrade ${LANG_ENGLISH} "Do not uninstall (Downgrading without uninstall is disabled for this installer)"
LangString failedToKillApp ${LANG_ENGLISH} "Failed to kill ${PRODUCTNAME}. Please close it first then try again"
LangString failedToKillApp ${LANG_ENGLISH} "Failed to kill {{product_name}}. Please close it first then try again"
LangString installingWebview2 ${LANG_ENGLISH} "Installing WebView2..."
LangString newerVersionInstalled ${LANG_ENGLISH} "A newer version of ${PRODUCTNAME} is already installed! It is not recommended that you install an older version. If you really want to install this older version, it's better to uninstall the current version first. Select the operation you want to perform and click Next to continue."
LangString older ${LANG_ENGLISH} "older"

View File

@@ -1,14 +1,14 @@
LangString addOrReinstall ${LANG_FRENCH} "Ajouter/Réinstaller un composant."
LangString alreadyInstalled ${LANG_FRENCH} "Déja installé."
LangString alreadyInstalledLong ${LANG_FRENCH} "${PRODUCTNAME} ${VERSION} est déja installé. Sélectionnez l'opération que vous souhaitez effectuer, puis cliquez sur Suivant pour continuer."
LangString appRunning ${LANG_FRENCH} "${PRODUCTNAME} est en cours d'exécution. Veuillez fermer l'application avant de réessayer."
LangString appRunningOkKill ${LANG_FRENCH} "${PRODUCTNAME} est en cours d'exécution.$\nCliquez sur OK pour fermer l'application."
LangString appRunning ${LANG_FRENCH} "{{product_name}} est en cours d'exécution. Veuillez fermer l'application avant de réessayer."
LangString appRunningOkKill ${LANG_FRENCH} "{{product_name}} est en cours d'exécution.$\nCliquez sur OK pour fermer l'application."
LangString chooseMaintenanceOption ${LANG_FRENCH} "Veuillez choisir l'option de maintenance à effectuer."
LangString choowHowToInstall ${LANG_FRENCH} "Veuillez choisir l'emplacement d'installation de ${PRODUCTNAME}."
LangString createDesktop ${LANG_FRENCH} "Créer un raccourci sur le bureau."
LangString dontUninstall ${LANG_FRENCH} "Ne pas désinstaller"
LangString dontUninstallDowngrade ${LANG_FRENCH} "Ne pas désinstaller (revenir à une ancienne version sans désinstallation est désactivé pour cet installateur)"
LangString failedToKillApp ${LANG_FRENCH} "La fermeture de ${PRODUCTNAME} a échoué. Veuillez fermer l'application et réessayer."
LangString failedToKillApp ${LANG_FRENCH} "La fermeture de {{product_name}} a échoué. Veuillez fermer l'application et réessayer."
LangString installingWebview2 ${LANG_FRENCH} "Installation de WebView2..."
LangString newerVersionInstalled ${LANG_FRENCH} "Une version plus récente de ${PRODUCTNAME} est déja installée. Il n'est pas recommandé d'installer une ancienne version. Si vous souhaitez installer cette ancienne version, il est conseillé de désinstaller la version courante en premier. Veuillez sélectionner l'opération que vous souhaitez effectuer, puis cliquez sur Suivant pour continer."
LangString older ${LANG_FRENCH} "ancien"

View File

@@ -1,14 +1,14 @@
LangString addOrReinstall ${LANG_GERMAN} "Komponenten hinzufügen/neu installieren"
LangString alreadyInstalled ${LANG_GERMAN} "Bereits installiert"
LangString alreadyInstalledLong ${LANG_GERMAN} "${PRODUCTNAME} ${VERSION} ist bereits installiert. Wählen Sie den gewünschten Vorgang aus und klicken Sie auf Weiter, um fortzufahren."
LangString appRunning ${LANG_GERMAN} "${PRODUCTNAME} wird ausgeführt! Bitte schließen Sie es zuerst und versuchen Sie es dann erneut."
LangString appRunningOkKill ${LANG_GERMAN} "${PRODUCTNAME} läuft! $\nKlicken Sie auf OK, um es zu beenden"
LangString appRunning ${LANG_GERMAN} "{{product_name}} wird ausgeführt! Bitte schließen Sie es zuerst und versuchen Sie es dann erneut."
LangString appRunningOkKill ${LANG_GERMAN} "{{product_name}} läuft! $\nKlicken Sie auf OK, um es zu beenden"
LangString chooseMaintenanceOption ${LANG_GERMAN} "Wählen Sie die auszuführende Wartungsoption."
LangString choowHowToInstall ${LANG_GERMAN} "Wählen Sie, wie Sie ${PRODUCTNAME} installieren möchten."
LangString createDesktop ${LANG_GERMAN} "Desktop-Verknüpfung erstellen"
LangString dontUninstall ${LANG_GERMAN} "Nicht deinstallieren"
LangString dontUninstallDowngrade ${LANG_GERMAN} "Nicht deinstallieren (Downgrading ohne Deinstallation ist für dieses Installationsprogramm deaktiviert)"
LangString failedToKillApp ${LANG_GERMAN} "Failed to kill ${PRODUCTNAME}. Bitte schließen Sie es zuerst und versuchen Sie es dann erneut"
LangString failedToKillApp ${LANG_GERMAN} "Failed to kill {{product_name}}. Bitte schließen Sie es zuerst und versuchen Sie es dann erneut"
LangString installingWebview2 ${LANG_GERMAN} "Installiere WebView2..."
LangString newerVersionInstalled ${LANG_GERMAN} "Eine neuere Version von ${PRODUCTNAME} ist bereits installiert! Es wird nicht empfohlen, eine ältere Version zu installieren. Wenn Sie diese ältere Version wirklich installieren wollen, ist es besser, die aktuelle Version zuerst zu deinstallieren. Wählen Sie den gewünschten Vorgang aus und klicken Sie auf Weiter, um fortzufahren."
LangString älter ${LANG_GERMAN} "älter"

View File

@@ -0,0 +1,27 @@
LangString addOrReinstall ${LANG_HEBREW} "הוסף או התקן מחדש"
LangString alreadyInstalled ${LANG_HEBREW} "כבר מותקן"
LangString alreadyInstalledLong ${LANG_HEBREW} "${PRODUCTNAME} ${VERSION} כבר מותקן. בחר את הפעולה שברצונך לבצע ולחץ על הבא כדי להמשיך."
LangString appRunning ${LANG_HEBREW} "{{product_name}} פועל! נא לסגור אותו ולנסות שוב."
LangString appRunningOkKill ${LANG_HEBREW} "{{product_name}} פועל!$\nלחץ אישור כדי לסגור אותו."
LangString chooseMaintenanceOption ${LANG_HEBREW} "בחר את פעולת התחזוקה לביצוע"
LangString choowHowToInstall ${LANG_HEBREW} "בחר איך תרצה להתקין את ${PRODUCTNAME}."
LangString createDesktop ${LANG_HEBREW} "צור קיצור דרך בשולחן העבודה"
LangString dontUninstall ${LANG_HEBREW} "אל תסיר"
LangString dontUninstallDowngrade ${LANG_HEBREW} "אל תסיר (התקנת גרסה ישנה ללא הסרת הגרסה הנוכחית מושעית עבור התקנה זו)"
LangString failedToKillApp ${LANG_HEBREW} "עצירת {{product_name}} נכשלה. נא לסגור את היישום ולנסות שוב."
LangString installingWebview2 ${LANG_HEBREW} "מתקין את WebView2..."
LangString newerVersionInstalled ${LANG_HEBREW} "גרסה חדשה יותר של ${PRODUCTNAME} כבר מותקנת! לא מומלץ להתקין גרסה ישנה. אם בכל זאת תרצה להתקין את הגרסה הזו, מומלץ קודם להסיר את הגרסה הנוכחית. בחר את הפעולה שברצונך לבצע ולחץ הבא להמשך."
LangString older ${LANG_HEBREW} "ישנה"
LangString olderOrUnknownVersionInstalled ${LANG_HEBREW} "גרסה $R4 של ${PRODUCTNAME} מותקנת במערכת שלך. מומלץ להסיר את הגרסה הנוכחית לפני ההתקנה. בחר את הפעולה שברצונך לבצע ולחץ הבא להמשך."
LangString silentDowngrades ${LANG_HEBREW} "התקנת גרסה ישנה לא נתמכת בהתקנה זו, אין אפשרות להמשיך עם ההתקנה השקטה, נא להמשיך עם ההתקנה בממשק הגרפי.$\n"
LangString unableToUninstall ${LANG_HEBREW} "לא ניתן להסיר!"
LangString uninstallApp ${LANG_HEBREW} "הסר את ${PRODUCTNAME}"
LangString uninstallBeforeInstalling ${LANG_HEBREW} "הסר את הגרסה הנוכחית לפני התקנת גרסה זו"
LangString unknown ${LANG_HEBREW} "לא ידועה"
LangString webview2AbortError ${LANG_HEBREW} "התקנת WebView2 נכשלה! היישום אינו יכולה לפעול בלי זה. נסה להפעיל את ההתקנה שוב."
LangString webview2DownloadError ${LANG_HEBREW} "שגיאה: הורדת WebView2 נכשלה - $0"
LangString webview2DownloadSuccess ${LANG_HEBREW} "מאתחל WebView2 הורד בהצלחה"
LangString webview2Downloading ${LANG_HEBREW} "מוריד את מאתחל WebView2..."
LangString webview2InstallError ${LANG_HEBREW} "שגיאה: התקנת WebView2 נכשלה עם קוד שגיאה $1"
LangString webview2InstallSuccess ${LANG_HEBREW} "WebView2 הותקן בהצלחה"
LangString deleteAppData ${LANG_HEBREW} "מחק את נתוני היישום"

View File

@@ -1,14 +1,14 @@
LangString addOrReinstall ${LANG_ITALIAN} "Aggiungi/Reinstalla componenti"
LangString alreadyInstalled ${LANG_ITALIAN} "Già installato"
LangString alreadyInstalledLong ${LANG_ITALIAN} "${PRODUCTNAME} ${VERSION} è già installato. Seleziona l'operazione che vuoi eseguire e clicca Avanti per continuare."
LangString appRunning ${LANG_ITALIAN} "${PRODUCTNAME} è in esecuzione! Chiudi e poi riprova."
LangString appRunningOkKill ${LANG_ITALIAN} "${PRODUCTNAME} è in esecuzione!$\nSeleziona OK per chiuderlo"
LangString appRunning ${LANG_ITALIAN} "{{product_name}} è in esecuzione! Chiudi e poi riprova."
LangString appRunningOkKill ${LANG_ITALIAN} "{{product_name}} è in esecuzione!$\nSeleziona OK per chiuderlo"
LangString chooseMaintenanceOption ${LANG_ITALIAN} "Seleziona l'operazione di manutenzione da eseguire."
LangString choowHowToInstall ${LANG_ITALIAN} "Seleziona come vuoi installare ${PRODUCTNAME}."
LangString createDesktop ${LANG_ITALIAN} "Crea scorciatoia sul Desktop"
LangString dontUninstall ${LANG_ITALIAN} "Non disinstallare"
LangString dontUninstallDowngrade ${LANG_ITALIAN} "Non disinstallare (Il downgrade senza la disinstallazione è disabilitato per questo installer)"
LangString failedToKillApp ${LANG_ITALIAN} "Impossibile chiudere ${PRODUCTNAME}. Chiudi e poi riprova"
LangString failedToKillApp ${LANG_ITALIAN} "Impossibile chiudere {{product_name}}. Chiudi e poi riprova"
LangString installingWebview2 ${LANG_ITALIAN} "Installando WebView2..."
LangString newerVersionInstalled ${LANG_ITALIAN} "Una versione più recente di ${PRODUCTNAME} è già installata! Non è consigliato installare una versione più vecchia. Se vuoi comunque procedere, è meglio prima disinstallare la versione corrente. Seleziona l'operazione che vuoi eseguire e clicca Avanti per continuare."
LangString older ${LANG_ITALIAN} "più vecchia"

View File

@@ -1,14 +1,14 @@
LangString addOrReinstall ${LANG_JAPANESE} "コンポーネントの追加・再インストール"
LangString alreadyInstalled ${LANG_JAPANESE} "既にインストールされています"
LangString alreadyInstalledLong ${LANG_JAPANESE} "${PRODUCTNAME} ${VERSION} は既にインストールされています。実行したい操作を選択し、「次へ」をクリックして続行します。"
LangString appRunning ${LANG_JAPANESE} "${PRODUCTNAME} は動作中です。動作中のプログラムを終了し、もう一度やり直してください。"
LangString appRunningOkKill ${LANG_JAPANESE} "${PRODUCTNAME} は動作中です。$\n「OK」を押すと動作中のプログラムを終了します。"
LangString appRunning ${LANG_JAPANESE} "{{product_name}} は動作中です。動作中のプログラムを終了し、もう一度やり直してください。"
LangString appRunningOkKill ${LANG_JAPANESE} "{{product_name}} は動作中です。$\n「OK」を押すと動作中のプログラムを終了します。"
LangString chooseMaintenanceOption ${LANG_JAPANESE} "メンテナンスオプションを選択して実行します。"
LangString choowHowToInstall ${LANG_JAPANESE} "${PRODUCTNAME} のインストール方法を選択してください。"
LangString createDesktop ${LANG_JAPANESE} "デスクトップショートカットを作成する"
LangString dontUninstall ${LANG_JAPANESE} "アンインストールしない"
LangString dontUninstallDowngrade ${LANG_JAPANESE} "アンインストールしない (このインストーラーでは、アンインストールをせずにダウングレードすることはできません)"
LangString failedToKillApp ${LANG_JAPANESE} "${PRODUCTNAME} の終了に失敗しました。動作中のプログラムを終了し、もう一度やり直してください。"
LangString failedToKillApp ${LANG_JAPANESE} "{{product_name}} の終了に失敗しました。動作中のプログラムを終了し、もう一度やり直してください。"
LangString installingWebview2 ${LANG_JAPANESE} "WebView2 をインストール中です..."
LangString newerVersionInstalled ${LANG_JAPANESE} "既に新しいバージョンの ${PRODUCTNAME} がインストールされています。古いバージョンをインストールすることは推奨されません。どうしてもこの旧バージョンをインストールしたい場合は、先に現行バージョンをアンインストールしておく方がよいでしょう。実行したい操作を選択し、「次へ」をクリックして続行します。"
LangString older ${LANG_JAPANESE} ""

View File

@@ -1,14 +1,14 @@
LangString addOrReinstall ${LANG_KOREAN} "컴포넌트 추가 및 재설치"
LangString alreadyInstalled ${LANG_KOREAN} "이미 설치되어 있습니다"
LangString alreadyInstalledLong ${LANG_KOREAN} "${PRODUCTNAME} ${VERSION}이(가) 이미 설치되어 있습니다. 수행하고자 하는 작업을 선택하고 '다음'을 클릭하여 계속합니다."
LangString appRunning ${LANG_KOREAN} "${PRODUCTNAME}이(가) 실행 중입니다! 먼저 닫은 후 다시 시도하세요."
LangString appRunningOkKill ${LANG_KOREAN} "${PRODUCTNAME}이(가) 실행 중입니다!$\n'OK'를 누르면 실행 중인 프로그램을 종료합니다."
LangString appRunning ${LANG_KOREAN} "{{product_name}}이(가) 실행 중입니다! 먼저 닫은 후 다시 시도하세요."
LangString appRunningOkKill ${LANG_KOREAN} "{{product_name}}이(가) 실행 중입니다!$\n'OK'를 누르면 실행 중인 프로그램을 종료합니다."
LangString chooseMaintenanceOption ${LANG_KOREAN} "수행하려는 관리 옵션을 선택합니다."
LangString choowHowToInstall ${LANG_KOREAN} "${PRODUCTNAME}의 설치 방법을 선택하세요.."
LangString createDesktop ${LANG_KOREAN} "바탕화면 바로가기 만들기"
LangString dontUninstall ${LANG_KOREAN} "제거하지 않기"
LangString dontUninstallDowngrade ${LANG_KOREAN} "제거하지 않기 (이 설치 프로그램에서는 제거하지 않고 다운그레이드할 수 없습니다.)"
LangString failedToKillApp ${LANG_KOREAN} "${PRODUCTNAME}을(를) 종료하지 못했습니다. 먼저 닫은 후 다시 시도하세요."
LangString failedToKillApp ${LANG_KOREAN} "{{product_name}}을(를) 종료하지 못했습니다. 먼저 닫은 후 다시 시도하세요."
LangString installingWebview2 ${LANG_KOREAN} "WebView2를 설치하는 중입니다..."
LangString newerVersionInstalled ${LANG_KOREAN} "${PRODUCTNAME}의 최신 버전이 이미 설치되어 있습니다! 이전 버전을 설치하지 않는 것이 좋습니다. 이 이전 버전을 꼭 설치하려면 먼저 현재 버전을 제거하는 것이 좋습니다. 수행하려는 작업을 선택하고 '다음'을 클릭하여 계속합니다."
LangString older ${LANG_KOREAN} ""

View File

@@ -0,0 +1,27 @@
LangString addOrReinstall ${LANG_NORWEGIAN} "Legg til/reinstaller komponenter"
LangString alreadyInstalled ${LANG_NORWEGIAN} "Allerede installert"
LangString alreadyInstalledLong ${LANG_NORWEGIAN} "${PRODUCTNAME} ${VERSION} er allerede installert. Velg operasjonen du vil utføre og klikk Neste for å fortsette."
LangString appRunning ${LANG_NORWEGIAN} "{{product_name}} kjører! Lukk den først og prøv igjen."
LangString appRunningOkKill ${LANG_NORWEGIAN} "{{product_name}} kjører!$\nKlikk OK for å avslutte den"
LangString chooseMaintenanceOption ${LANG_NORWEGIAN} "Velg vedlikeholdsoperasjonen som skal utføres."
LangString choowHowToInstall ${LANG_NORWEGIAN} "Velg hvordan du vil installere ${PRODUCTNAME}."
LangString createDesktop ${LANG_NORWEGIAN} "Opprett skrivebordssnarvei"
LangString dontUninstall ${LANG_NORWEGIAN} "Ikke avinstaller"
LangString dontUninstallDowngrade ${LANG_NORWEGIAN} "Ikke avinstaller (nedgradering uten avinstallasjon er deaktivert for denne installasjonen)"
LangString failedToKillApp ${LANG_NORWEGIAN} "Kunne ikke avslutte {{product_name}}. Lukk den først og prøv igjen"
LangString installingWebview2 ${LANG_NORWEGIAN} "Installerer WebView2..."
LangString newerVersionInstalled ${LANG_NORWEGIAN} "En nyere versjon av ${PRODUCTNAME} er allerede installert! Det anbefales ikke at du installerer en eldre versjon. Hvis du virkelig vil installere denne eldre versjonen, er det bedre å avinstallere den nåværende versjonen først. Velg operasjonen du vil utføre og klikk Neste for å fortsette."
LangString older ${LANG_NORWEGIAN} "eldre"
LangString olderOrUnknownVersionInstalled ${LANG_NORWEGIAN} "En $R4-versjon av ${PRODUCTNAME} er installert på systemet ditt. Det anbefales at du avinstallerer den nåværende versjonen før installasjon. Velg operasjonen du vil utføre og klikk Neste for å fortsette."
LangString silentDowngrades ${LANG_NORWEGIAN} "Nedgraderinger er deaktivert for denne installasjonen. Kan ikke fortsette med stille installasjon; bruk den grafiske installasjonen i stedet.$\n"
LangString unableToUninstall ${LANG_NORWEGIAN} "Kunne ikke avinstallere!"
LangString uninstallApp ${LANG_NORWEGIAN} "Avinstaller ${PRODUCTNAME}"
LangString uninstallBeforeInstalling ${LANG_NORWEGIAN} "Avinstaller før installasjon"
LangString unknown ${LANG_NORWEGIAN} "ukjent"
LangString webview2AbortError ${LANG_NORWEGIAN} "Kunne ikke installere WebView2! Appen kan ikke kjøre uten den. Prøv å starte installasjonen på nytt."
LangString webview2DownloadError ${LANG_NORWEGIAN} "Feil: Nedlasting av WebView2 mislyktes - $0"
LangString webview2DownloadSuccess ${LANG_NORWEGIAN} "WebView2-bootstrapper lastet ned"
LangString webview2Downloading ${LANG_NORWEGIAN} "Laster ned WebView2-bootstrapper..."
LangString webview2InstallError ${LANG_NORWEGIAN} "Feil: Installering av WebView2 mislyktes med avslutningskode $1"
LangString webview2InstallSuccess ${LANG_NORWEGIAN} "WebView2 ble installert"
LangString deleteAppData ${LANG_NORWEGIAN} "Slett programdata"

View File

@@ -1,14 +1,14 @@
LangString addOrReinstall ${LANG_PERSIAN} "اضافه کردن/نصب مجدد کامپونتت"
LangString alreadyInstalled ${LANG_PERSIAN} "قبلا نصب شده است"
LangString alreadyInstalledLong ${LANG_PERSIAN} "${PRODUCTNAME} ${VERSION} قبلا نصب شده است. عملیات مدنظر را انتخاب کنید و بروی بعدی کلیک کنید."
LangString appRunning ${LANG_PERSIAN} "${PRODUCTNAME} در حال اجر می باشد ! لطفا اول الان را ببندید و دوباره تلاش کنید"
LangString appRunningOkKill ${LANG_PERSIAN} "${PRODUCTNAME} در حال اجرا می باشد!$\nبرای از بین بردن اوکی را انتخاب کنید"
LangString appRunning ${LANG_PERSIAN} "{{product_name}} در حال اجر می باشد ! لطفا اول الان را ببندید و دوباره تلاش کنید"
LangString appRunningOkKill ${LANG_PERSIAN} "{{product_name}} در حال اجرا می باشد!$\nبرای از بین بردن اوکی را انتخاب کنید"
LangString chooseMaintenanceOption ${LANG_PERSIAN} "عملیات نگهداری مدنظر را برای اجرا انتخاب کنید"
LangString choowHowToInstall ${LANG_PERSIAN} "نحوه نصب ${PRODUCTNAME} را انتخاب کنید"
LangString createDesktop ${LANG_PERSIAN} "ایجاد میانبر دسکتاپ"
LangString dontUninstall ${LANG_PERSIAN} "حذف نکنید"
LangString dontUninstallDowngrade ${LANG_PERSIAN} "حذف نکنید (تنزل ورژن بدون حذف برای نصب کننده غیرفعال است)"
LangString failedToKillApp ${LANG_PERSIAN} "${PRODUCTNAME} قابل کشته شدن نیست. اول آن را ببندید و دوباره تلاش کنید"
LangString failedToKillApp ${LANG_PERSIAN} "{{product_name}} قابل کشته شدن نیست. اول آن را ببندید و دوباره تلاش کنید"
LangString installingWebview2 ${LANG_PERSIAN} "در حال نصب WebView2 ..."
LangString newerVersionInstalled ${LANG_PERSIAN} "ورژن جدید ${PRODUCTNAME} قبلا نصب شده است! نصب ورژن قدیمی تر به هیچ عنوان پیشنهاد نمی شود. اگر از این بابت اطمینان دارید , بهتر است ورژن فعلی را حذف کنید. عملیات مدنظر را انتخاب کنید و بروی بعدی کلیک کنید."
LangString older ${LANG_PERSIAN} "قدیمی تر"

View File

@@ -1,14 +1,14 @@
LangString addOrReinstall ${LANG_PORTUGUESE} "Adicionar/Reinstalar componentes"
LangString alreadyInstalled ${LANG_PORTUGUESE} "Já instalado"
LangString alreadyInstalledLong ${LANG_PORTUGUESE} "${PRODUCTNAME} ${VERSION} já está instalado. Selecione a operação que deseja realizar e clique em Seguinte para continuar."
LangString appRunning ${LANG_PORTUGUESE} "${PRODUCTNAME} está em execução! Por favor, feche-o primeiro e tente novamente."
LangString appRunningOkKill ${LANG_PORTUGUESE} "${PRODUCTNAME} está em execução!$\nClique em OK para encerrá-lo."
LangString appRunning ${LANG_PORTUGUESE} "{{product_name}} está em execução! Por favor, feche-o primeiro e tente novamente."
LangString appRunningOkKill ${LANG_PORTUGUESE} "{{product_name}} está em execução!$\nClique em OK para encerrá-lo."
LangString chooseMaintenanceOption ${LANG_PORTUGUESE} "Escolha a opção de manutenção a realizar."
LangString choowHowToInstall ${LANG_PORTUGUESE} "Escolha como deseja instalar o ${PRODUCTNAME}."
LangString createDesktop ${LANG_PORTUGUESE} "Criar atalho no ambiente de trabalho"
LangString dontUninstall ${LANG_PORTUGUESE} "Não desinstalar"
LangString dontUninstallDowngrade ${LANG_PORTUGUESE} "Não desinstalar (Instalar uma versão anterior sem desinstalar está desativado neste instalador)"
LangString failedToKillApp ${LANG_PORTUGUESE} "Falha ao encerrar ${PRODUCTNAME}. Por favor, feche-o primeiro e tente novamente."
LangString failedToKillApp ${LANG_PORTUGUESE} "Falha ao encerrar {{product_name}}. Por favor, feche-o primeiro e tente novamente."
LangString installingWebview2 ${LANG_PORTUGUESE} "A instalar WebView2..."
LangString newerVersionInstalled ${LANG_PORTUGUESE} "Uma versão mais recente do ${PRODUCTNAME} já está instalada! Não é recomendada a instalação de uma versão mais antiga. Se realmente deseja instalar esta versão mais antiga, é melhor desinstalar a versão atual primeiro. Selecione a operação que deseja realizar e clique em Seguinte para continuar."
LangString older ${LANG_PORTUGUESE} "mais antiga"

View File

@@ -1,14 +1,14 @@
LangString addOrReinstall ${LANG_PORTUGUESEBR} "Adicionar/Reinstalar componentes"
LangString alreadyInstalled ${LANG_PORTUGUESEBR} "Já instalado"
LangString alreadyInstalledLong ${LANG_PORTUGUESEBR} "${PRODUCTNAME} ${VERSION} já está instalado. Selecione a operação que deseja realizar e clique Próximo para continuar."
LangString appRunning ${LANG_PORTUGUESEBR} "${PRODUCTNAME} está aberto! Por favor feche a janela dele e tente novamente."
LangString appRunningOkKill ${LANG_PORTUGUESEBR} "${PRODUCTNAME} está aberto!$\nClique OK para fechar ele."
LangString appRunning ${LANG_PORTUGUESEBR} "{{product_name}} está aberto! Por favor feche a janela dele e tente novamente."
LangString appRunningOkKill ${LANG_PORTUGUESEBR} "{{product_name}} está aberto!$\nClique OK para fechar ele."
LangString chooseMaintenanceOption ${LANG_PORTUGUESEBR} "Escolha a opção de manutenção a realizar."
LangString choowHowToInstall ${LANG_PORTUGUESEBR} "Escolha como deseja instalar ${PRODUCTNAME}."
LangString createDesktop ${LANG_PORTUGUESEBR} "Criar atalho na área de trabalho"
LangString dontUninstall ${LANG_PORTUGUESEBR} "Não desinstalar"
LangString dontUninstallDowngrade ${LANG_PORTUGUESEBR} "Não desinstalar (Instalar versão anterior sem desinstalar está desabilitado nesse instalador)"
LangString failedToKillApp ${LANG_PORTUGUESEBR} "Falha ao fechar ${PRODUCTNAME}. Por favor feche a janela dele primeiro e tente novamente"
LangString failedToKillApp ${LANG_PORTUGUESEBR} "Falha ao fechar {{product_name}}. Por favor feche a janela dele primeiro e tente novamente"
LangString installingWebview2 ${LANG_PORTUGUESEBR} "Instalando WebView2..."
LangString newerVersionInstalled ${LANG_PORTUGUESEBR} "Uma nova versão do ${PRODUCTNAME} já está instalado! Não é recomendado instalar uma versão anterior. Se realmente deseja instalar essa versão antiga, é recomendado desinstalar a versão atual primeirl. Selecione a operação que deseja executare clique Próximo para continuar."
LangString older ${LANG_PORTUGUESEBR} "mais antiga"

View File

@@ -1,14 +1,14 @@
LangString addOrReinstall ${LANG_RUSSIAN} "Добавить/Переустановить компоненты"
LangString alreadyInstalled ${LANG_RUSSIAN} "Уже установлено"
LangString alreadyInstalledLong ${LANG_RUSSIAN} "${PRODUCTNAME} ${VERSION} уже установлен. Выберите действие, которое вы хотите выполнить и нажмите Далее для продолжения."
LangString appRunning ${LANG_RUSSIAN} "${PRODUCTNAME} запущен! Пожалуйста, закройте приложение и попробуйте еще раз."
LangString appRunningOkKill ${LANG_RUSSIAN} "${PRODUCTNAME} запущен!$\nНажмите OK чтобы закрыть приложение"
LangString appRunning ${LANG_RUSSIAN} "{{product_name}} запущен! Пожалуйста, закройте приложение и попробуйте еще раз."
LangString appRunningOkKill ${LANG_RUSSIAN} "{{product_name}} запущен!$\nНажмите OK чтобы закрыть приложение"
LangString chooseMaintenanceOption ${LANG_RUSSIAN} "Выберите действие, которое вы хотите выполнить."
LangString choowHowToInstall ${LANG_RUSSIAN} "Выберите, как вы хотите установить ${PRODUCTNAME}."
LangString createDesktop ${LANG_RUSSIAN} "Добавить ярлык на рабочий стол"
LangString dontUninstall ${LANG_RUSSIAN} "Не удалять"
LangString dontUninstallDowngrade ${LANG_RUSSIAN} "Не удалять (Установка более ранних версий без удаления невозможна)"
LangString failedToKillApp ${LANG_RUSSIAN} "Не удалось закрыть ${PRODUCTNAME}. Пожалуйста, закройте приложение и попробуйте еще раз"
LangString failedToKillApp ${LANG_RUSSIAN} "Не удалось закрыть {{product_name}}. Пожалуйста, закройте приложение и попробуйте еще раз"
LangString installingWebview2 ${LANG_RUSSIAN} "Установка WebView2..."
LangString newerVersionInstalled ${LANG_RUSSIAN} "Более новая версия ${PRODUCTNAME} уже установлена! Не рекомендуется устанавливать более раннюю версию. Если вы действительно хотите установить эту версию, рекомендуется сначала удалить текущую. Выберите действие, которое вы хотите выполнить и нажмите Далее для продолжения."
LangString older ${LANG_RUSSIAN} "Более ранняя"

View File

@@ -1,14 +1,14 @@
LangString addOrReinstall ${LANG_SIMPCHINESE} "添加/重新安装组件"
LangString alreadyInstalled ${LANG_SIMPCHINESE} "已安装"
LangString alreadyInstalledLong ${LANG_SIMPCHINESE} "${PRODUCTNAME} ${VERSION} 已经安装了。选择你想要执行的操作后点击下一步以继续。"
LangString appRunning ${LANG_SIMPCHINESE} "${PRODUCTNAME} 正在运行!请关闭后再试。"
LangString appRunningOkKill ${LANG_SIMPCHINESE} "${PRODUCTNAME} 正在运行!$\n点击确定以终止运行。"
LangString appRunning ${LANG_SIMPCHINESE} "{{product_name}} 正在运行!请关闭后再试。"
LangString appRunningOkKill ${LANG_SIMPCHINESE} "{{product_name}} 正在运行!$\n点击确定以终止运行。"
LangString chooseMaintenanceOption ${LANG_SIMPCHINESE} "选择要执行的维护操作。"
LangString choowHowToInstall ${LANG_SIMPCHINESE} "选择你想要安装 ${PRODUCTNAME} 的方式。"
LangString createDesktop ${LANG_SIMPCHINESE} "创建桌面快捷方式"
LangString dontUninstall ${LANG_SIMPCHINESE} "请勿卸载"
LangString dontUninstallDowngrade ${LANG_SIMPCHINESE} "请勿卸载(此安装程序禁止未卸载就进行版本降级的操作)"
LangString failedToKillApp ${LANG_SIMPCHINESE} "无法终止 ${PRODUCTNAME}。请关闭后再试。"
LangString failedToKillApp ${LANG_SIMPCHINESE} "无法终止 {{product_name}}。请关闭后再试。"
LangString installingWebview2 ${LANG_SIMPCHINESE} "正在安装 WebView2..."
LangString newerVersionInstalled ${LANG_SIMPCHINESE} "有一个更新版本的 ${PRODUCTNAME} 已经安装了!不推荐你安装旧的版本。如果你真的想要安装这个旧的版本,推荐先卸载当前版本。选择你想要执行的操作后点击下一步以继续。"
LangString older ${LANG_SIMPCHINESE} "旧的"

View File

@@ -1,14 +1,14 @@
LangString addOrReinstall ${LANG_SPANISH} "Añadir o reinstalar componentes"
LangString alreadyInstalled ${LANG_SPANISH} "Ya está instalado"
LangString alreadyInstalledLong ${LANG_SPANISH} "${PRODUCTNAME} ${VERSION} ya está instalado. Seleccione la operación que desee realizar y pulse Siguiente para continuar."
LangString appRunning ${LANG_SPANISH} "¡${PRODUCTNAME} está abierto! Por favor ciérrelo e intente de nuevo."
LangString appRunningOkKill ${LANG_SPANISH} "¡${PRODUCTNAME} está abierto!$\nPulse Aceptar para cerrarlo."
LangString appRunning ${LANG_SPANISH} "¡{{product_name}} está abierto! Por favor ciérrelo e intente de nuevo."
LangString appRunningOkKill ${LANG_SPANISH} "¡{{product_name}} está abierto!$\nPulse Aceptar para cerrarlo."
LangString chooseMaintenanceOption ${LANG_SPANISH} "Elija la operación de mantenimiento que desee realizar."
LangString choowHowToInstall ${LANG_SPANISH} "Elija cómo desea instalar ${PRODUCTNAME}."
LangString createDesktop ${LANG_SPANISH} "Crear acceso directo en el escritorio"
LangString dontUninstall ${LANG_SPANISH} "No desinstalar"
LangString dontUninstallDowngrade ${LANG_SPANISH} "No desinstalar (Disminuir la versión sin desinstalar está deshabilitado para este instalador)"
LangString failedToKillApp ${LANG_SPANISH} "No se ha podido cerrar ${PRODUCTNAME}. Por favor ciérrelo e intente de nuevo."
LangString failedToKillApp ${LANG_SPANISH} "No se ha podido cerrar {{product_name}}. Por favor ciérrelo e intente de nuevo."
LangString installingWebview2 ${LANG_SPANISH} "Instalando WebView2..."
LangString newerVersionInstalled ${LANG_SPANISH} "Ya está instalada una versión más reciente de ${PRODUCTNAME}. No se recomienda que instale una versión anterior. Si realmente desea instalar esta versión anterior, es recomendable desinstalar la versión actual antes de continuar. Seleccione la operación que desee realizar y pulse Siguiente para continuar."
LangString older ${LANG_SPANISH} "anterior"

View File

@@ -1,27 +1,27 @@
LangString addOrReinstall ${LANG_SPANISH} "Añadir o reinstalar componentes"
LangString alreadyInstalled ${LANG_SPANISH} "Ya está instalado"
LangString alreadyInstalledLong ${LANG_SPANISH} "${PRODUCTNAME} ${VERSION} ya está instalado. Seleccione la operación que desee realizar y pulse Siguiente para continuar."
LangString appRunning ${LANG_SPANISH} "¡${PRODUCTNAME} está abierto! Por favor ciérrelo e intente de nuevo."
LangString appRunningOkKill ${LANG_SPANISH} "¡${PRODUCTNAME} está abierto!$\nPulse Aceptar para cerrarlo."
LangString chooseMaintenanceOption ${LANG_SPANISH} "Elija la operación de mantenimiento que desee realizar."
LangString choowHowToInstall ${LANG_SPANISH} "Elija cómo desea instalar ${PRODUCTNAME}."
LangString createDesktop ${LANG_SPANISH} "Crear acceso directo en el escritorio"
LangString dontUninstall ${LANG_SPANISH} "No desinstalar"
LangString dontUninstallDowngrade ${LANG_SPANISH} "No desinstalar (Disminuir la versión sin desinstalar está deshabilitado para este instalador)"
LangString failedToKillApp ${LANG_SPANISH} "No se ha podido cerrar ${PRODUCTNAME}. Por favor ciérrelo e intente de nuevo."
LangString installingWebview2 ${LANG_SPANISH} "Instalando WebView2..."
LangString newerVersionInstalled ${LANG_SPANISH} "Ya está instalada una versión más reciente de ${PRODUCTNAME}. No se recomienda que instale una versión anterior. Si realmente desea instalar esta versión anterior, es recomendable desinstalar la versión actual antes de continuar. Seleccione la operación que desee realizar y pulse Siguiente para continuar."
LangString older ${LANG_SPANISH} "anterior"
LangString olderOrUnknownVersionInstalled ${LANG_SPANISH} "Una versión $R4 de ${PRODUCTNAME} está instalada en su sistema. Es recomendable desinstalar la versión actual antes de continuar. Seleccione la operación que desee realizar y pulse Siguiente para continuar."
LangString silentDowngrades ${LANG_SPANISH} "Disminuir la versión está deshabilitado para este instalador. No se puede continuar con el instalador silencioso, por favor use el instalador de interfaz gráfica.$\n"
LangString unableToUninstall ${LANG_SPANISH} "No se ha podido desinstalar."
LangString uninstallApp ${LANG_SPANISH} "Desinstalar ${PRODUCTNAME}"
LangString uninstallBeforeInstalling ${LANG_SPANISH} "Desinstalar antes de instalar"
LangString unknown ${LANG_SPANISH} "desconocida"
LangString webview2AbortError ${LANG_SPANISH} "No se ha podido instalar WebView2. Intente reiniciar el instalador."
LangString webview2DownloadError ${LANG_SPANISH} "Error: No se ha podido descargar WebView2 - $0"
LangString webview2DownloadSuccess ${LANG_SPANISH} "El bootstrapper de WebView2 fue descargado con éxito."
LangString webview2Downloading ${LANG_SPANISH} "Descargando el bootstrapper de WebView2..."
LangString webview2InstallError ${LANG_SPANISH} "Error: La instalación de WebView2 falló con el código $1."
LangString webview2InstallSuccess ${LANG_SPANISH} "WebView2 fue instalado con éxito."
LangString deleteAppData ${LANG_SPANISH} "Eliminar los datos de aplicación"
LangString addOrReinstall ${LANG_SPANISHINTERNATIONAL} "Añadir o reinstalar componentes"
LangString alreadyInstalled ${LANG_SPANISHINTERNATIONAL} "Ya está instalado"
LangString alreadyInstalledLong ${LANG_SPANISHINTERNATIONAL} "${PRODUCTNAME} ${VERSION} ya está instalado. Seleccione la operación que desee realizar y pulse Siguiente para continuar."
LangString appRunning ${LANG_SPANISHINTERNATIONAL} "¡{{product_name}} está abierto! Por favor ciérrelo e intente de nuevo."
LangString appRunningOkKill ${LANG_SPANISHINTERNATIONAL} "¡{{product_name}} está abierto!$\nPulse Aceptar para cerrarlo."
LangString chooseMaintenanceOption ${LANG_SPANISHINTERNATIONAL} "Elija la operación de mantenimiento que desee realizar."
LangString choowHowToInstall ${LANG_SPANISHINTERNATIONAL} "Elija cómo desea instalar ${PRODUCTNAME}."
LangString createDesktop ${LANG_SPANISHINTERNATIONAL} "Crear acceso directo en el escritorio"
LangString dontUninstall ${LANG_SPANISHINTERNATIONAL} "No desinstalar"
LangString dontUninstallDowngrade ${LANG_SPANISHINTERNATIONAL} "No desinstalar (Disminuir la versión sin desinstalar está deshabilitado para este instalador)"
LangString failedToKillApp ${LANG_SPANISHINTERNATIONAL} "No se ha podido cerrar {{product_name}}. Por favor ciérrelo e intente de nuevo."
LangString installingWebview2 ${LANG_SPANISHINTERNATIONAL} "Instalando WebView2..."
LangString newerVersionInstalled ${LANG_SPANISHINTERNATIONAL} "Ya está instalada una versión más reciente de ${PRODUCTNAME}. No se recomienda que instale una versión anterior. Si realmente desea instalar esta versión anterior, es recomendable desinstalar la versión actual antes de continuar. Seleccione la operación que desee realizar y pulse Siguiente para continuar."
LangString older ${LANG_SPANISHINTERNATIONAL} "anterior"
LangString olderOrUnknownVersionInstalled ${LANG_SPANISHINTERNATIONAL} "Una versión $R4 de ${PRODUCTNAME} está instalada en su sistema. Es recomendable desinstalar la versión actual antes de continuar. Seleccione la operación que desee realizar y pulse Siguiente para continuar."
LangString silentDowngrades ${LANG_SPANISHINTERNATIONAL} "Disminuir la versión está deshabilitado para este instalador. No se puede continuar con el instalador silencioso, por favor use el instalador de interfaz gráfica.$\n"
LangString unableToUninstall ${LANG_SPANISHINTERNATIONAL} "No se ha podido desinstalar."
LangString uninstallApp ${LANG_SPANISHINTERNATIONAL} "Desinstalar ${PRODUCTNAME}"
LangString uninstallBeforeInstalling ${LANG_SPANISHINTERNATIONAL} "Desinstalar antes de instalar"
LangString unknown ${LANG_SPANISHINTERNATIONAL} "desconocida"
LangString webview2AbortError ${LANG_SPANISHINTERNATIONAL} "No se ha podido instalar WebView2. Intente reiniciar el instalador."
LangString webview2DownloadError ${LANG_SPANISHINTERNATIONAL} "Error: No se ha podido descargar WebView2 - $0"
LangString webview2DownloadSuccess ${LANG_SPANISHINTERNATIONAL} "El bootstrapper de WebView2 fue descargado con éxito."
LangString webview2Downloading ${LANG_SPANISHINTERNATIONAL} "Descargando el bootstrapper de WebView2..."
LangString webview2InstallError ${LANG_SPANISHINTERNATIONAL} "Error: La instalación de WebView2 falló con el código $1."
LangString webview2InstallSuccess ${LANG_SPANISHINTERNATIONAL} "WebView2 fue instalado con éxito."
LangString deleteAppData ${LANG_SPANISHINTERNATIONAL} "Eliminar los datos de aplicación"

View File

@@ -1,14 +1,14 @@
LangString addOrReinstall ${LANG_SWEDISH} "Lägg till/Installera om komponenter"
LangString alreadyInstalled ${LANG_SWEDISH}} "Redan installerad"
LangString alreadyInstalledLong ${LANG_SWEDISH}} "${PRODUCTNAME} ${VERSION} är redan installerad. Välj åtgärd och klicka på Nästa för att fortsätta."
LangString appRunning ${LANG_SWEDISH} "${PRODUCTNAME} körs! Stäng det först och försök igen."
LangString appRunningOkKill ${LANG_SWEDISH} "${PRODUCTNAME} körs!$\nKlicka på OK för att avsluta det."
LangString appRunning ${LANG_SWEDISH} "{{product_name}} körs! Stäng det först och försök igen."
LangString appRunningOkKill ${LANG_SWEDISH} "{{product_name}} körs!$\nKlicka på OK för att avsluta det."
LangString chooseMaintenanceOption ${LANG_SWEDISH} "Välj underhållsåtgärd."
LangString choowHowToInstall ${LANG_SWEDISH} "Välj hur du vill installera ${PRODUCTNAME}."
LangString createDesktop ${LANG_SWEDISH} "Skapa genväg på skrivbordet"
LangString dontUninstall ${LANG_SWEDISH} "Avinstallera inte"
LangString dontUninstallDowngrade ${LANG_SWEDISH} "Avinstallera inte (nedgradering utan avinstallation är inaktiverad för den här installationsprogrammet)"
LangString failedToKillApp ${LANG_SWEDISH} "Kunde inte avsluta ${PRODUCTNAME}. Stäng det först och försök igen."
LangString failedToKillApp ${LANG_SWEDISH} "Kunde inte avsluta {{product_name}}. Stäng det först och försök igen."
LangString installingWebview2 ${LANG_SWEDISH} "Installerar WebView2..."
LangString newerVersionInstalled ${LANG_SWEDISH} "En nyare version av ${PRODUCTNAME} är redan installerad! Det rekommenderas inte att installera en äldre version. Om du verkligen vill installera denna äldre version är det bättre att avinstallera den nuvarande versionen först. Välj åtgärd och klicka på Nästa för att fortsätta."
LangString older ${LANG_SWEDISH} "äldre"

View File

@@ -1,14 +1,14 @@
LangString addOrReinstall ${LANG_TRADCHINESE} "增加或重新安裝元件"
LangString alreadyInstalled ${LANG_TRADCHINESE} "已安裝"
LangString alreadyInstalledLong ${LANG_TRADCHINESE} "${PRODUCTNAME} ${VERSION} 已經安裝了。選擇你想要進行的操作並且點選下一步。"
LangString appRunning ${LANG_TRADCHINESE} "${PRODUCTNAME} 正在執行中!請先關閉再進行嘗試。"
LangString appRunningOkKill ${LANG_TRADCHINESE} "${PRODUCTNAME} 正在執行中!點選確定後終止。"
LangString appRunning ${LANG_TRADCHINESE} "{{product_name}} 正在執行中!請先關閉再進行嘗試。"
LangString appRunningOkKill ${LANG_TRADCHINESE} "{{product_name}} 正在執行中!點選確定後終止。"
LangString chooseMaintenanceOption ${LANG_TRADCHINESE} "請選擇你要進行的維護選項。"
LangString choowHowToInstall ${LANG_TRADCHINESE} "選擇你要如何安裝 ${PRODUCTNAME}。"
LangString createDesktop ${LANG_TRADCHINESE} "建立桌面捷徑"
LangString dontUninstall ${LANG_TRADCHINESE} "請勿解除安裝"
LangString dontUninstallDowngrade ${LANG_TRADCHINESE} "請勿解除安裝(本安裝程式不允許未解除安裝就進行版本降低的操作)"
LangString failedToKillApp ${LANG_TRADCHINESE} "無法終止 ${PRODUCTNAME}。請先關閉再進行嘗試。"
LangString failedToKillApp ${LANG_TRADCHINESE} "無法終止 {{product_name}}。請先關閉再進行嘗試。"
LangString installingWebview2 ${LANG_TRADCHINESE} "WebView2 安裝中..."
LangString newerVersionInstalled ${LANG_TRADCHINESE} "已安裝更新版本的 ${PRODUCTNAME}!不建議安裝舊版。如果真的想要安裝舊版的話,最好先解除安裝現在的版本。選擇你想要進行的操作後再進行下一步。"
LangString older ${LANG_TRADCHINESE} "舊版"

View File

@@ -1,14 +1,14 @@
LangString addOrReinstall ${LANG_TURKISH} "Bileşen Ekle/Yeniden Yükle"
LangString alreadyInstalled ${LANG_TURKISH} "Daha Önceden Yüklenmiş"
LangString alreadyInstalledLong ${LANG_TURKISH} "${PRODUCTNAME} ${VERSION} daha önceden yüklenmiş. Gerçekleştirmek istediğiniz işlemi seçin ve devam etmek için İleri'ye tıklayın."
LangString appRunning ${LANG_TURKISH} "${PRODUCTNAME} çalışır durumda! Lütfen önce uygulamayı kapatın ve sonra tekrar deneyin."
LangString appRunningOkKill ${LANG_TURKISH} "${PRODUCTNAME} çalışır durumda!$\nUygulamayı sonlandırmak için Tamam'a tıklayın."
LangString appRunning ${LANG_TURKISH} "{{product_name}} çalışır durumda! Lütfen önce uygulamayı kapatın ve sonra tekrar deneyin."
LangString appRunningOkKill ${LANG_TURKISH} "{{product_name}} çalışır durumda!$\nUygulamayı sonlandırmak için Tamam'a tıklayın."
LangString chooseMaintenanceOption ${LANG_TURKISH} "Gerçekleştirmek istediğiniz bakım seçeneğini belirleyin."
LangString choowHowToInstall ${LANG_TURKISH} "${PRODUCTNAME} uygulamasını nasıl yüklemek istediğinizi seçin."
LangString createDesktop ${LANG_TURKISH} "Masaüstü kısayolu oluştur"
LangString dontUninstall ${LANG_TURKISH} "Kaldırma işlemini gerçekleştirme"
LangString dontUninstallDowngrade ${LANG_TURKISH} "Kaldırma işlemini gerçekleştirme (Kaldırma işlemi yapmadan sürüm düşürme bu yükleyici için devre dışı bırakılmıştır)"
LangString failedToKillApp ${LANG_TURKISH} "${PRODUCTNAME} sonlandırılamadı. Lütfen önce kapatın sonra tekrar deneyin."
LangString failedToKillApp ${LANG_TURKISH} "{{product_name}} sonlandırılamadı. Lütfen önce kapatın sonra tekrar deneyin."
LangString installingWebview2 ${LANG_TURKISH} "WebView2 yükleniyor..."
LangString newerVersionInstalled ${LANG_TURKISH} "${PRODUCTNAME} uygulamasının daha yeni bir sürümü zaten yüklü! Daha eski bir sürümü yüklemeniz önerilmez. Bu eski sürümü gerçekten yüklemek istiyorsanız, önce mevcut sürümü kaldırmanız daha uygundur. Gerçekleştirmek istediğiniz işlemi seçin ve devam etmek için İleri'ye tıklayın."
LangString older ${LANG_TURKISH} "daha eski"

View File

@@ -1,14 +1,14 @@
LangString addOrReinstall ${LANG_UKRAINIAN} "Додати/Перевстановити компоненти"
LangString alreadyInstalled ${LANG_UKRAINIAN} "Вже встановлено"
LangString alreadyInstalledLong ${LANG_UKRAINIAN} "${PRODUCTNAME} ${VERSION} вже встановлено. Виберіть дію, яку ви хочете виконати, і натисніть Далі, щоб продовжити."
LangString appRunning ${LANG_UKRAINIAN} "${PRODUCTNAME} запущено! Будь ласка, спочатку закрийте його, а потім спробуйте ще раз."
LangString appRunningOkKill ${LANG_UKRAINIAN} "${PRODUCTNAME} запущено!$\nНатисніть ОК, щоб примусово закрити його"
LangString appRunning ${LANG_UKRAINIAN} "{{product_name}} запущено! Будь ласка, спочатку закрийте його, а потім спробуйте ще раз."
LangString appRunningOkKill ${LANG_UKRAINIAN} "{{product_name}} запущено!$\nНатисніть ОК, щоб примусово закрити його"
LangString chooseMaintenanceOption ${LANG_UKRAINIAN} "Виберіть дію, яку треба виконати."
LangString choowHowToInstall ${LANG_UKRAINIAN} "Виберіть, як ви хочете встановити ${PRODUCTNAME}."
LangString createDesktop ${LANG_UKRAINIAN} "Створити ярлик на робочому столі"
LangString dontUninstall ${LANG_UKRAINIAN} "Не видаляти"
LangString dontUninstallDowngrade ${LANG_UKRAINIAN} "Не видаляти (для цього встановлювача вимкнено зниження версії без видалення)"
LangString failedToKillApp ${LANG_UKRAINIAN} "Не вдалося примусово закрити ${PRODUCTNAME}. Будь ласка, спочатку закрийте його, а потім спробуйте ще раз"
LangString failedToKillApp ${LANG_UKRAINIAN} "Не вдалося примусово закрити {{product_name}}. Будь ласка, спочатку закрийте його, а потім спробуйте ще раз"
LangString installingWebview2 ${LANG_UKRAINIAN} "Встановлення WebView2..."
LangString newerVersionInstalled ${LANG_UKRAINIAN} "Новіша версія ${PRODUCTNAME} вже встановлена! Встановлювати старішу версію не рекомендується. Якщо ви дійсно хочете встановити цю версію, краще спочатку видаліть поточну. Виберіть дію, яку ви хочете виконати, і натисніть Далі, щоб продовжити."
LangString older ${LANG_UKRAINIAN} "старішу"

View File

@@ -3,26 +3,27 @@
// SPDX-License-Identifier: MIT
use crate::{
Error, Settings,
bundle::{
settings::Arch,
windows::{
sign::{sign_command, try_sign},
sign::{should_sign, sign_command, try_sign},
util::{
download_webview2_bootstrapper, download_webview2_offline_installer,
NSIS_OUTPUT_FOLDER_NAME, NSIS_UPDATER_OUTPUT_FOLDER_NAME,
NSIS_OUTPUT_FOLDER_NAME, NSIS_UPDATER_OUTPUT_FOLDER_NAME, download_webview2_bootstrapper,
download_webview2_offline_installer,
},
},
},
error::ErrorExt,
utils::{
http_utils::{download_and_verify, verify_file_hash, HashAlgorithm},
CommandExt,
http_utils::{HashAlgorithm, download_and_verify, verify_file_hash},
},
Settings,
};
use tauri_utils::display_path;
use anyhow::Context;
use handlebars::{to_json, Handlebars};
use crate::error::Context;
use handlebars::{Handlebars, to_json};
use tauri_utils::config::{NSISInstallerMode, NsisCompression, WebviewInstallMode};
use std::{
@@ -35,12 +36,11 @@ use std::{
// URLS for the NSIS toolchain.
#[cfg(target_os = "windows")]
const NSIS_URL: &str =
"https://github.com/tauri-apps/binary-releases/releases/download/nsis-3/nsis-3.zip";
"https://github.com/tauri-apps/binary-releases/releases/download/nsis-3.11/nsis-3.11.zip";
#[cfg(target_os = "windows")]
const NSIS_SHA1: &str = "057e83c7d82462ec394af76c87d06733605543d4";
const NSIS_TAURI_UTILS_URL: &str =
"https://github.com/tauri-apps/nsis-tauri-utils/releases/download/nsis_tauri_utils-v0.4.2/nsis_tauri_utils.dll";
const NSIS_TAURI_UTILS_SHA1: &str = "6532DA4545864C6EC95F62F27F2199BFD668560B";
const NSIS_SHA1: &str = "EF7FF767E5CBD9EDD22ADD3A32C9B8F4500BB10D";
const NSIS_TAURI_UTILS_URL: &str = "https://github.com/tauri-apps/nsis-tauri-utils/releases/download/nsis_tauri_utils-v0.5.3/nsis_tauri_utils.dll";
const NSIS_TAURI_UTILS_SHA1: &str = "75197FEE3C6A814FE035788D1C34EAD39349B860";
#[cfg(target_os = "windows")]
const NSIS_REQUIRED_FILES: &[&str] = &[
@@ -48,18 +48,28 @@ const NSIS_REQUIRED_FILES: &[&str] = &[
"Bin/makensis.exe",
"Stubs/lzma-x86-unicode",
"Stubs/lzma_solid-x86-unicode",
"Plugins/x86-unicode/nsis_tauri_utils.dll",
"Plugins/x86-unicode/additional/nsis_tauri_utils.dll",
"Include/MUI2.nsh",
"Include/FileFunc.nsh",
"Include/x64.nsh",
"Include/nsDialogs.nsh",
"Include/WinMessages.nsh",
"Include/Win/COM.nsh",
"Include/Win/Propkey.nsh",
"Include/Win/RestartManager.nsh",
];
const NSIS_PLUGIN_FILES: &[&str] = &[
"NSISdl.dll",
"StartMenu.dll",
"System.dll",
"nsDialogs.dll",
"additional/nsis_tauri_utils.dll",
];
#[cfg(not(target_os = "windows"))]
const NSIS_REQUIRED_FILES: &[&str] = &["Plugins/x86-unicode/nsis_tauri_utils.dll"];
const NSIS_REQUIRED_FILES: &[&str] = &["Plugins/x86-unicode/additional/nsis_tauri_utils.dll"];
const NSIS_REQUIRED_FILES_HASH: &[(&str, &str, &str, HashAlgorithm)] = &[(
"Plugins/x86-unicode/nsis_tauri_utils.dll",
"Plugins/x86-unicode/additional/nsis_tauri_utils.dll",
NSIS_TAURI_UTILS_URL,
NSIS_TAURI_UTILS_SHA1,
HashAlgorithm::Sha1,
@@ -96,7 +106,11 @@ pub fn bundle_project(settings: &Settings, updater: bool) -> crate::Result<Vec<P
log::warn!("NSIS directory contains mis-hashed files. Redownloading them.");
for (path, url, hash, hash_algorithm) in mismatched {
let data = download_and_verify(url, hash, *hash_algorithm)?;
fs::write(nsis_toolset_path.join(path), data)?;
let out_path = nsis_toolset_path.join(path);
std::fs::create_dir_all(out_path.parent().context("output path has no parent")?)
.fs_context("failed to create file output directory", out_path.clone())?;
fs::write(&out_path, data)
.fs_context("failed to save NSIS downloaded file", out_path.clone())?;
}
}
}
@@ -113,9 +127,10 @@ fn get_and_extract_nsis(nsis_toolset_path: &Path, _tauri_tools_path: &Path) -> c
let data = download_and_verify(NSIS_URL, NSIS_SHA1, HashAlgorithm::Sha1)?;
log::info!("extracting NSIS");
crate::utils::http_utils::extract_zip(&data, _tauri_tools_path)?;
fs::rename(_tauri_tools_path.join("nsis-3.08"), nsis_toolset_path)?;
fs::rename(_tauri_tools_path.join("nsis-3.11"), nsis_toolset_path)?;
}
// download additional plugins
let nsis_plugins = nsis_toolset_path.join("Plugins");
let data = download_and_verify(
@@ -124,15 +139,16 @@ fn get_and_extract_nsis(nsis_toolset_path: &Path, _tauri_tools_path: &Path) -> c
HashAlgorithm::Sha1,
)?;
let target_folder = nsis_plugins.join("x86-unicode");
let target_folder = nsis_plugins.join("x86-unicode").join("additional");
fs::create_dir_all(&target_folder)?;
fs::write(target_folder.join("nsis_tauri_utils.dll"), data)?;
Ok(())
}
fn try_add_numeric_build_number(version_str: &str) -> anyhow::Result<String> {
let version = semver::Version::parse(version_str).context("invalid app version")?;
fn try_add_numeric_build_number(version_str: &str) -> crate::Result<String> {
let version = semver::Version::parse(version_str)
.map_err(|error| Error::GenericError(format!("invalid app version: {error}")))?;
if !version.build.is_empty() {
let build = version.build.parse::<u64>();
if build.is_ok() {
@@ -156,7 +172,7 @@ fn try_add_numeric_build_number(version_str: &str) -> anyhow::Result<String> {
fn build_nsis_app_installer(
settings: &Settings,
_nsis_toolset_path: &Path,
#[allow(unused_variables)] nsis_toolset_path: &Path,
tauri_tools_path: &Path,
updater: bool,
) -> crate::Result<Vec<PathBuf>> {
@@ -166,9 +182,8 @@ fn build_nsis_app_installer(
Arch::AArch64 => "arm64",
target => {
return Err(crate::Error::ArchError(format!(
"unsupported architecture: {:?}",
target
)))
"unsupported architecture: {target:?}"
)));
}
};
@@ -180,6 +195,73 @@ fn build_nsis_app_installer(
}
fs::create_dir_all(&output_path)?;
// we make a copy of the NSIS directory if we're going to sign its DLLs
// because we don't want to change the DLL hashes so the cache can reuse it
let maybe_plugin_copy_path = if settings.windows().can_sign() {
// find nsis path
#[cfg(target_os = "linux")]
let system_nsis_toolset_path = std::env::var_os("NSIS_PATH")
.map(PathBuf::from)
.unwrap_or_else(|| PathBuf::from("/usr/share/nsis"));
#[cfg(target_os = "macos")]
let system_nsis_toolset_path = std::env::var_os("NSIS_PATH")
.map(PathBuf::from)
.context("failed to resolve NSIS path")
.or_else(|_| {
let mut makensis_path = which::which("makensis").map_err(|error| Error::CommandFailed {
command: "makensis".to_string(),
error: std::io::Error::other(format!("failed to find makensis: {error}")),
})?;
// homebrew installs it as a symlink
if makensis_path.is_symlink() {
// read_link might return a path relative to makensis_path so we must use join() and canonicalize
makensis_path = makensis_path
.parent()
.context("missing makensis parent")?
.join(
std::fs::read_link(&makensis_path)
.fs_context("failed to resolve makensis symlink", makensis_path.clone())?,
)
.canonicalize()
.fs_context(
"failed to canonicalize makensis path",
makensis_path.clone(),
)?;
}
// file structure:
// ├── bin
// │ ├── makensis
// ├── share
// │ ├── nsis
let bin_folder = makensis_path.parent().context("missing makensis parent")?;
let root_folder = bin_folder.parent().context("missing makensis root")?;
crate::Result::Ok(root_folder.join("share").join("nsis"))
})?;
#[cfg(windows)]
let system_nsis_toolset_path = nsis_toolset_path.to_path_buf();
let plugins_path = output_path.join("Plugins");
// copy system plugins (we don't want to modify system installed DLLs, and on some systems there will even be permission errors if we try)
crate::utils::fs_utils::copy_dir(
&system_nsis_toolset_path.join("Plugins").join("x86-unicode"),
&plugins_path.join("x86-unicode"),
)
.context("failed to copy system NSIS Plugins folder to local copy")?;
// copy our downloaded DLLs
crate::utils::fs_utils::copy_dir(
&nsis_toolset_path
.join("Plugins")
.join("x86-unicode")
.join("additional"),
&plugins_path.join("x86-unicode").join("additional"),
)
.context("failed to copy additional NSIS Plugins folder to local copy")?;
Some(plugins_path)
} else {
// in this case plugin_copy_path can be None, we'll use the system default path
None
};
let mut data = BTreeMap::new();
let bundle_id = settings.bundle_identifier();
@@ -187,12 +269,17 @@ fn build_nsis_app_installer(
.publisher()
.unwrap_or_else(|| bundle_id.split('.').nth(1).unwrap_or(bundle_id));
#[cfg(not(target_os = "windows"))]
{
let mut dir = dirs::cache_dir().unwrap();
dir.extend(["tauri", "NSIS", "Plugins", "x86-unicode"]);
data.insert("additional_plugins_path", to_json(dir));
}
let additional_plugins_path = maybe_plugin_copy_path
.clone()
.unwrap_or_else(|| nsis_toolset_path.join("Plugins"))
.join("x86-unicode")
.join("additional");
data.insert(
"additional_plugins_path",
// either our Plugins copy (when signing) or the cache/Plugins/x86-unicode path
to_json(&additional_plugins_path),
);
data.insert("arch", to_json(arch));
data.insert("bundle_id", to_json(bundle_id));
@@ -209,9 +296,13 @@ fn build_nsis_app_installer(
);
data.insert("copyright", to_json(settings.copyright_string()));
if settings.can_sign() {
let sign_cmd = format!("{:?}", sign_command("%1", &settings.sign_params())?);
data.insert("uninstaller_sign_cmd", to_json(sign_cmd));
if settings.windows().can_sign() {
if settings.no_sign() {
log::warn!("Skipping signing for NSIS uninstaller due to --no-sign flag.");
} else {
let sign_cmd = format!("{:?}", sign_command("%1", &settings.sign_params())?);
data.insert("uninstaller_sign_cmd", to_json(sign_cmd));
}
}
let version = settings.version_string();
@@ -339,7 +430,9 @@ fn build_nsis_app_installer(
write_utf8_with_bom(&path, content)?;
language_files_paths.push(path);
} else {
log::warn!("Custom tauri messages for {lang} are not translated.\nIf it is a valid language listed on <https://github.com/kichik/nsis/tree/9465c08046f00ccb6eda985abbdbf52c275c6c4d/Contrib/Language%20files>, please open a Tauri feature request\n or you can provide a custom language file for it in `tauri.conf.json > bundle > windows > nsis > custom_language_files`");
log::warn!(
"Custom tauri messages for {lang} are not translated.\nIf it is a valid language listed on <https://github.com/kichik/nsis/tree/9465c08046f00ccb6eda985abbdbf52c275c6c4d/Contrib/Language%20files>, please open a Tauri feature request\n or you can provide a custom language file for it in `tauri.conf.json > bundle > windows > nsis > custom_language_files`"
);
}
}
}
@@ -410,7 +503,9 @@ fn build_nsis_app_installer(
.iter()
.flat_map(|p| &p.schemes)
.collect::<Vec<_>>();
data.insert("deep_link_protocols", to_json(schemes));
if !schemes.is_empty() {
data.insert("deep_link_protocols", to_json(schemes));
}
}
let silent_webview2_install = if let WebviewInstallMode::DownloadBootstrapper { silent }
@@ -467,6 +562,7 @@ fn build_nsis_app_installer(
let mut handlebars = Handlebars::new();
handlebars.register_helper("or", Box::new(handlebars_or));
handlebars.register_helper("association-description", Box::new(association_description));
handlebars.register_helper("no-escape", Box::new(handlebars_no_escape));
handlebars.register_escape_fn(|s| {
let mut output = String::new();
for c in s.chars() {
@@ -525,13 +621,32 @@ fn build_nsis_app_installer(
));
fs::create_dir_all(nsis_installer_path.parent().unwrap())?;
log::info!(action = "Running"; "makensis.exe to produce {}", display_path(&nsis_installer_path));
if settings.windows().can_sign()
&& let Some(plugin_copy_path) = &maybe_plugin_copy_path
{
let plugin_copy_path = plugin_copy_path.join("x86-unicode");
log::info!("Signing NSIS plugins");
for dll in NSIS_PLUGIN_FILES {
let path = plugin_copy_path.join(dll);
if path.exists() {
try_sign(&path, settings)?;
} else {
log::warn!("Could not find {}, skipping signing", path.display());
}
}
}
log::info!(action = "Running"; "makensis to produce {}", display_path(&nsis_installer_path));
#[cfg(target_os = "windows")]
let mut nsis_cmd = Command::new(_nsis_toolset_path.join("makensis.exe"));
let mut nsis_cmd = Command::new(nsis_toolset_path.join("makensis.exe"));
#[cfg(not(target_os = "windows"))]
let mut nsis_cmd = Command::new("makensis");
if let Some(plugins_path) = &maybe_plugin_copy_path {
nsis_cmd.env("NSISPLUGINS", plugins_path);
}
nsis_cmd
.args(["-INPUTCHARSET", "UTF8", "-OUTPUTCHARSET", "UTF8"])
.arg(match settings.log_level() {
@@ -545,15 +660,20 @@ fn build_nsis_app_installer(
.env_remove("NSISCONFDIR")
.current_dir(output_path)
.piped()
.context("error running makensis.exe")?;
.map_err(|error| Error::CommandFailed {
command: "makensis.exe".to_string(),
error,
})?;
fs::rename(nsis_output_path, &nsis_installer_path)?;
if settings.can_sign() {
if settings.windows().can_sign() {
try_sign(&nsis_installer_path, settings)?;
} else {
#[cfg(not(target_os = "windows"))]
log::warn!("Signing, by default, is only supported on Windows hosts, but you can specify a custom signing command in `bundler > windows > sign_command`, for now, skipping signing the installer...");
log::warn!(
"Signing, by default, is only supported on Windows hosts, but you can specify a custom signing command in `bundler > windows > sign_command`, for now, skipping signing the installer..."
);
}
Ok(vec![nsis_installer_path])
@@ -595,6 +715,24 @@ fn association_description(
Ok(())
}
fn handlebars_no_escape(
h: &handlebars::Helper<'_>,
_: &Handlebars<'_>,
_: &handlebars::Context,
_: &mut handlebars::RenderContext<'_, '_>,
out: &mut dyn handlebars::Output,
) -> handlebars::HelperResult {
// get parameter from helper or throw an error
let param = h
.param(0)
.ok_or(handlebars::RenderErrorReason::ParamNotFoundForIndex(
"no-escape",
0,
))?;
write!(out, "{}", param.render())?;
Ok(())
}
/// BTreeMap<OriginalPath, (ParentOfTargetPath, TargetPath)>
type ResourcesMap = BTreeMap<PathBuf, (PathBuf, PathBuf)>;
fn generate_resource_data(settings: &Settings) -> crate::Result<ResourcesMap> {
@@ -609,6 +747,9 @@ fn generate_resource_data(settings: &Settings) -> crate::Result<ResourcesMap> {
let loader_path =
dunce::simplified(&settings.project_out_directory().join("WebView2Loader.dll")).to_path_buf();
if loader_path.exists() {
if settings.windows().can_sign() {
try_sign(&loader_path, settings)?;
}
added_resources.push(loader_path.clone());
resources.insert(
loader_path,
@@ -617,6 +758,75 @@ fn generate_resource_data(settings: &Settings) -> crate::Result<ResourcesMap> {
}
}
// Handle CEF support if cef_path is set,
// using https://github.com/chromiumembedded/cef/blob/master/tools/distrib/win/README.redistrib.txt as a reference
if let Some(cef_path) = settings.bundle_settings().cef_path.as_ref() {
let project_out = settings.project_out_directory();
let cef_files = [
// required
"libcef.dll",
"chrome_elf.dll",
"icudtl.dat",
"v8_context_snapshot.bin",
// required end
// "optional" - but not really since we want support for all of this
"chrome_100_percent.pak",
"chrome_200_percent.pak",
"resources.pak",
// Direct3D support
"d3dcompiler_47.dll",
// DirectX compiler support
// TODO: check if x64 means no arm64
"dxil.dll",
"dxcompiler.dll",
// ANGEL support
"libEGL.dll",
"libGLESv2.dll",
// SwANGLE support
"vk_swiftshader.dll",
"vk_swiftshader_icd.json",
"vulkan-1.dll",
// sandbox - may need to be behind a setting?
"bootstrap.exe",
"bootstrapc.exe",
];
for f in &cef_files {
let from = cef_path.join(f);
let src_path = dunce::simplified(&project_out.join(f)).to_path_buf();
fs::copy(&from, &src_path).fs_context("failed to copy CEF file for NSIS bundle", from)?;
if settings.windows().can_sign() && should_sign(&src_path)? {
try_sign(&src_path, settings)?;
}
added_resources.push(src_path.clone());
resources.insert(src_path, (PathBuf::new(), PathBuf::from(f)));
}
// TODO: locales?
// crash without at least en
let locales = [
"en-US.pak",
"en-US_FEMININE.pak",
"en-US_MASCULINE.pak",
"en-US_NEUTER.pak",
];
let locales_out = dunce::simplified(&project_out.join("locales")).to_path_buf();
fs::create_dir_all(&locales_out).fs_context(
"failed to create locales directory for CEF",
locales_out.clone(),
)?;
for f in &locales {
let target_file = PathBuf::from("locales").join(f);
let from = cef_path.join("locales").join(f);
let src_path = dunce::simplified(&locales_out.join(f)).to_path_buf();
fs::copy(&from, &src_path).fs_context("failed to copy CEF locale for NSIS bundle", from)?;
added_resources.push(src_path.clone());
resources.insert(src_path, (PathBuf::from("locales"), target_file));
}
}
for resource in settings.resource_files().iter() {
let resource = resource?;
@@ -631,6 +841,10 @@ fn generate_resource_data(settings: &Settings) -> crate::Result<ResourcesMap> {
}
added_resources.push(resource_path.clone());
if settings.windows().can_sign() && should_sign(&resource_path)? {
try_sign(&resource_path, settings)?;
}
let target_path = resource.target();
resources.insert(
resource_path,
@@ -692,7 +906,11 @@ fn generate_estimated_size(
.chain(resources.keys())
{
size += std::fs::metadata(k)
.with_context(|| format!("when getting size of {}", k.display()))?
.map_err(|error| Error::Fs {
context: "when getting size of",
path: k.to_path_buf(),
error,
})?
.len();
}
Ok(size / 1024)
@@ -721,6 +939,7 @@ fn get_lang_data(lang: &str) -> Option<(String, &[u8])> {
"swedish" => include_bytes!("./languages/Swedish.nsh"),
"portuguese" => include_bytes!("./languages/Portuguese.nsh"),
"ukrainian" => include_bytes!("./languages/Ukrainian.nsh"),
"norwegian" => include_bytes!("./languages/Norwegian.nsh"),
_ => return None,
};
Some((path, content))

View File

@@ -19,43 +19,55 @@
!macroend
; Checks whether app is running or not and prompts to kill it.
!macro CheckIfAppIsRunning
!macro CheckIfAppIsRunning executableName productName
!define UniqueID ${__LINE__}
; Replace {{product_name}} placeholder in the messages with the passed product name
nsis_tauri_utils::StrReplace "$(appRunning)" "{{product_name}}" "${productName}"
Pop $R1
nsis_tauri_utils::StrReplace "$(appRunningOkKill)" "{{product_name}}" "${productName}"
Pop $R2
nsis_tauri_utils::StrReplace "$(failedToKillApp)" "{{product_name}}" "${productName}"
Pop $R3
!if "${INSTALLMODE}" == "currentUser"
nsis_tauri_utils::FindProcessCurrentUser "${MAINBINARYNAME}.exe"
nsis_tauri_utils::FindProcessCurrentUser "${executableName}"
!else
nsis_tauri_utils::FindProcess "${MAINBINARYNAME}.exe"
nsis_tauri_utils::FindProcess "${executableName}"
!endif
Pop $R0
${If} $R0 = 0
IfSilent kill 0
${IfThen} $PassiveMode != 1 ${|} MessageBox MB_OKCANCEL "$(appRunningOkKill)" IDOK kill IDCANCEL cancel ${|}
kill:
IfSilent kill_${UniqueID} 0
${IfThen} $PassiveMode != 1 ${|} MessageBox MB_OKCANCEL $R2 IDOK kill_${UniqueID} IDCANCEL cancel_${UniqueID} ${|}
kill_${UniqueID}:
!if "${INSTALLMODE}" == "currentUser"
nsis_tauri_utils::KillProcessCurrentUser "${MAINBINARYNAME}.exe"
nsis_tauri_utils::KillProcessCurrentUser "${executableName}"
!else
nsis_tauri_utils::KillProcess "${MAINBINARYNAME}.exe"
nsis_tauri_utils::KillProcess "${executableName}"
!endif
Pop $R0
Sleep 500
${If} $R0 = 0
Goto app_check_done
${OrIf} $R0 = 2
Goto app_check_done_${UniqueID}
${Else}
IfSilent silent ui
silent:
IfSilent silent_${UniqueID} ui_${UniqueID}
silent_${UniqueID}:
System::Call 'kernel32::AttachConsole(i -1)i.r0'
${If} $0 != 0
System::Call 'kernel32::GetStdHandle(i -11)i.r0'
System::call 'kernel32::SetConsoleTextAttribute(i r0, i 0x0004)' ; set red color
FileWrite $0 "$(appRunning)$\n"
FileWrite $0 "$R1$\n"
${EndIf}
Abort
ui:
Abort "$(failedToKillApp)"
ui_${UniqueID}:
Abort $R3
${EndIf}
cancel:
Abort "$(appRunning)"
cancel_${UniqueID}:
Abort $R1
${EndIf}
app_check_done:
app_check_done_${UniqueID}:
!undef UniqueID
!macroend
; Sets AppUserModelId on a shortcut

Some files were not shown because too many files have changed in this diff Show More