Compare commits

...

572 Commits

Author SHA1 Message Date
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
github-actions[bot]
be3a79c864 apply version updates (#12856)
Co-authored-by: lucasfernog <20051258+lucasfernog@users.noreply.github.com>
2025-03-20 15:34:59 -03:00
Lucas Nogueira
ba42a1f553 chore: pin tao and wry to latest patch versions
they include necessary bug fixes for the 2.4 release
2025-03-20 14:52:38 -03:00
Tony
1cd8f55eed fix: don't ship global api bundle if withGlobalTauri is false (#13033)
* fix: don't ship global api bundle if withGlobalTauri is false

* Comment and prettier
2025-03-20 12:37:31 -03:00
Tony
8603e42a6b fix: channel no longer being always allowed (#13032)
* fix: channel no longer being always allowed

* Prettier

* Don't change the plugin name just yet

* Handle TAURI_CHANNEL as a special case in macro

* remove commented out code

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-03-20 12:19:55 -03:00
Akshanabha Chakraborty
c32bd722d3 prettify: Remove beta tag and alert users that tauri for android currently doesn't work on android 7 (#12646) 2025-03-18 08:33:47 -03:00
Lucas Fernandes Nogueira
bcdd510254 feat(core): resolve file names from Android content URIs (#13012)
* feat(core): resolve file names from Android content URIs

This PR adds a new Android path plugin function to resolve file names from content URIs. `PathResolver::file_name` was added to expose this API on Rust, and the existing `@tauri-apps/api/path` basename and extname function now leverages it on Android.

Closes https://github.com/tauri-apps/plugins-workspace/issues/1775

Tauri core port from https://github.com/tauri-apps/plugins-workspace/pull/2421

Co-authored-by: VulnX

* update change file [skip ci]

Co-authored-by: VulnX <62636727+VulnX@users.noreply.github.com>

---------

Co-authored-by: VulnX <62636727+VulnX@users.noreply.github.com>
2025-03-18 08:29:07 -03:00
WofWca
71cb1e26d7 docs: update .disable_javascript() docs (#13013)
The initial version of the MR that introduced this to Wry
(https://github.com/tauri-apps/wry/pull/1496)
had no Android implementation, but it has been added
in a later version of the MR, so the comment is no longer valid.
2025-03-18 09:47:27 +02:00
WofWca
b459f1d405 docs: improve Capability docs: mention webviews (#13015) 2025-03-18 09:46:48 +02:00
dependabot[bot]
8cc0067165 chore(deps): bump zip from 2.2.2 to 2.3.0 (#13016)
Bumps [zip](https://github.com/zip-rs/zip2) from 2.2.2 to 2.3.0.
- [Release notes](https://github.com/zip-rs/zip2/releases)
- [Changelog](https://github.com/zip-rs/zip2/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zip-rs/zip2/compare/v2.2.2...v2.3.0)

---
updated-dependencies:
- dependency-name: zip
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-18 11:35:36 +08:00
Lucas Fernandes Nogueira
f2c94aaca0 feat(core): add startIntentSenderForResult Android API for plugins (#12682) 2025-03-17 11:52:11 -03:00
WofWca
cefefa930b docs: improve tauri_build::build & try_build (#13001)
* docs: remove outdated `tauri_build::build` docs

The docstring has been unchanged ever since
40ac52971e (2021).
The `build()` function has grown massivly since then,
now it's not only about Windows.

* docs: `tauri_build::build`: see `try_build` for more config

`try_build` is not only about not panicing, but it also takes the
`attributes: Attributes` argument,
which is very important for controlling command permissions.

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

Co-authored-by: Amr Bashir <github@amrbashir.me>

* update docs

---------

Co-authored-by: Amr Bashir <github@amrbashir.me>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-03-17 09:28:09 -03:00
renovate[bot]
4a01299e31 chore(deps): update dependency rollup to v4.36.0 (#13010)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-17 19:36:29 +08:00
WofWca
5a23146566 docs: clarify Capability::windows/webviews OR nature (#13000)
* docs: clarify Capability::windows/webviews OR nature

It is intuitive to expect that for the capability to be enabled,
_both_ the window label and the webview label have to match.
However, this is not the case: the capability is enabled
if _either_ the window label matches a pattern
in `Capability::windows` _or_ the webview label matches a pattern
in `Capability::webviews`.

This commit should somewhat clarify this oddity
and protect developers from adding excessive permissions.

For reference, `Capability::webviews` was added in
0cb0a15ce2
(https://github.com/tauri-apps/tauri/pull/8789).

* Apply suggestions from code review

Co-authored-by: Amr Bashir <github@amrbashir.me>

* update schemas

---------

Co-authored-by: Amr Bashir <github@amrbashir.me>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-03-17 08:29:58 -03:00
Tony
4062e49914 fix: always delete auto start registry entry (#13006) 2025-03-17 08:21:14 -03:00
Nano
a483ba7c27 enhance: align log like Cargo (#13002) 2025-03-17 02:39:36 +02:00
Levi Zim
f981a5ee8b feat: basic support for linux riscv64 (#12602) 2025-03-16 16:33:17 -03:00
animesh chaudhri
2b960dfd9f feat(uninstaller): remove autostart entry during uninstallation (#12643)
* feat(uninstaller): remove autostart entry during uninstallation

Signed-off-by: animeshchaudri <animeshchaudhri3@gmail.com>

* add change file

* check when not updating

* delete registry value only if install mode is "currentUser"

---------

Signed-off-by: animeshchaudri <animeshchaudhri3@gmail.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-03-16 16:28:10 -03:00
Xuan
eec08a18b6 fix: use bun.lock to identify bun's lockfile (fix #12914) (#12998)
* fix: use bun.lock to identify bun's lockfile

* fix: also check bun.lockb

* doc: add changes doc
2025-03-16 18:00:04 +01:00
Tony
35018eed02 chore: fix missing .md on request-restart.md (#12996) 2025-03-16 21:20:25 +08:00
Tony
de7f34bff4 feat: introduce request_restart (#12874)
* Introduce request_restart

* Migrate `restart`

* Add change file

* Save restart_on_exit and add docs

* Tweak docs to include `restart`

* clear restart flow

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-03-16 08:42:29 -03:00
Tony
72df2e4a04 refactor: remove permission description from runtime (#12994)
* Remove description from runtime

* Just use none instead

* global_scope_schema and add comments about it

* Tweak wording

* remove comments [skip ci]

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-03-16 07:33:41 -03:00
Fabian-Lars
0d1446857c fix: Don't minify api dist files (#12989) 2025-03-16 07:11:42 -03:00
Thomas Eizinger
658e5f5d1d feat: introduce App::run_return (#12668)
* Introduce `run_return`

* Fix compile error

* Clone web_context

* Refactor to Result API

* Fix clippy

* Impl mock runtime

* Make it desktop-only

* Add changelog entry

* Fix compile error

* Make it semver compatible

* Extend changelog entry

* Undo semver-hack

* Reduce diff

* Remove unnecessary mut

* Make it take `self` by value

* Reduce diff

* Undo diff hack

* Make everything cfg(desktop)

* Rename vars to reduce diff

* Fix clippy

* Extract make_event_handler

* Reduce diff

* Deprecate `App::run_return`

* Update changelog

* Fix compile errors

* Accept reference

* Create event handler first

* Update example

* Update manifest

* Fix example

* Fix example docs

* Call `setup` only upon Ready

* Update changelog entry

* Update docs

* Update changelog

* Add platform-specific note

* update docs

* run_return on mobile

* Apply suggestions from code review

* remove change file

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-03-16 07:04:22 -03:00
WofWca
7930dde85c chore: examples: fix & simplify helloworld (#12995)
Remove the cookies code from it.
Firtly, they are not necessary: "Hello, world!" should be simple.
Secondly, it's broken on Windows: `.cookies()` hangs.

The cookies stuff was introduced recently,
in cedb24d494
(https://github.com/tauri-apps/tauri/pull/12665).
This commit reverts the changes to the example.

This supersedes https://github.com/tauri-apps/tauri/pull/12992.
2025-03-16 11:50:06 +02:00
anatawa12
b05f82d35b fix: ensure RunEvent::Exit is triggered on restart (#12313)
* fix: AppHandle::restart() may not send RunEvent::Exit event

* docs: add changelog: `AppHandle::restart()` may not send `RunEvent::Exit` event before exiting the application.

* style: cargo fmt

* avoid deadlock on main thread

* do not let the restart be prevented

leads to a deadlock currently

* Apply suggestions from code review

* lint

* do not emit RunEvent on main thread

* re-export RESTART_EXIT_CODE

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-03-15 15:49:42 -03:00
Tony
51bcafe323 refactor: use a single closure for filtering in emit_to (#12907)
* Use a single closure for filtering

* clippy

* Update crates/tauri/src/manager/mod.rs

---------

Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
2025-03-15 13:46:51 -03:00
Tony
013f8f6523 feat: add a new option to remove unused commands (#12890)
* Add a new option to remove unused commands

* Fix compile

* Add markers to all core plugins

* Clippy

* Add allow unused when running with this

* Use build script to generate allowed-commands.json

* Clean up and add proper reruns

* Wrong path

* Revert to #[cfg_attr(not(debug_assertions), allow(unused))]

* Add change files

* Some more docs

* Add version requirement note

* Avoid rerun if no capabilities folder

* Remove unused box

* small cleanup

* fix channel

* implement for app handler too

* rely on core:default for channel perms

* Move this feature to config

* Docs change

* Forget one last remove_unused_commands

* Remove removeUnusedCommands from helloworld

* tell handler that the app ACL manifest exists

* update change file

* update doc

* update change file

* Use a struct to pass the data instead of env var

* Clippy

* Fix can't exclude inlined plugins on Windows
due to UNC paths...

* Apply suggestion from code review

* Remove remove on empty to tauri-build

* Revert "Remove remove on empty to tauri-build"

This reverts commit b727dd621e.

* Centralize remove_file(allowed_commands_file_path)

* Escape glob pattern

* update change file

* remove unused commands for dev too

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

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

* regen schema

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-03-15 13:46:08 -03:00
Tobias Assarsson
5591a4f0b4 feature(linux) add mousewheel bindings for zoom functions (#12912)
* add mousewheel bindings commonly used for zooming

* add change file

* update docs

* fmt

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-03-15 13:29:13 -03:00
Fabian-Lars
2fa33d5c44 chore: Fix example readme instructions. Add pnpm build:debug. (#12983)
* chore: Fix example readme instructions. Add `pnpm build:debug`.

* keep terser on bundle.global.js build to avoid file modifications

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-03-15 12:51:40 -03:00
Adam Charron
cedb24d494 feat: add Webview::cookies and Webview::cookies_for_url() (#12665)
* Add support for fetching cookies by url

* Add support for fetching all cookies

* add missing getters, update change file

* update docs for windows deadlock

* fix mobile build

* Update crates/tauri-runtime/Cargo.toml

* add docs for stability [skip ci]

---------

Co-authored-by: Adam Charron <acharron@higherlogic.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-03-15 12:34:41 -03:00
Fabian-Lars
30f5a1553d feat: traffic light position (#12366)
* moving to macbook

* that was so weird to implement

* rm patch

* Discard changes to Cargo.lock

* Create change-pr-12366.md

* add missing builder fn

* remove test

* split change files

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-03-15 12:18:11 -03:00
Lucas Fernandes Nogueira
08de8a172b chore: remove 2.0.0-rc references (#12987) 2025-03-15 12:03:09 -03:00
Sean Wang
c108024257 feat(tauri): derive Clone for tauri::ExitRequestApi (#12710) 2025-03-15 10:26:22 -03:00
Tobias Assarsson
dc90cd3919 fix(core): add ctrl '+' key as zoom in (#12911)
* add '+' key as zoom in

* add changefile

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-03-15 10:16:29 -03:00
renovate[bot]
0ec71a844c chore(deps): update dependency wrangler to v4 (#12967)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-15 08:23:47 -03:00
Fabian-Lars
0c4700e990 fix(cli): Remove mention of updater bundle arg in help output (#12985)
* fix(cli): Remove mention of `updater` bundle arg in help output

* allow --bundles updater but hide from help
2025-03-15 08:02:28 -03:00
Lucas Fernandes Nogueira
b83921226c fix(cli): ios command wrong cwd on bun 1.2, closes #12965 (#12977)
bun 1.2 changed the current working directory behavior to match NPM managers, so we must adapt our xcode-script logic to check the bun version

see https://bun.sh/blog/bun-v1.2#bun-run-uses-the-correct-directory
2025-03-14 16:20:39 -03:00
Oscar Beaumont
3cc4ad3c38 fix: allow double -- in permissions as command can have double __ (#12884)
* allow double `--` in permissions as command can have double `__`

* Create change-pr-12884.md

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

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

---------

Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-03-14 12:13:48 -03:00
Lucas Fernandes Nogueira
d91bfa5cb9 feat(cli): allow merging multiple configuration values (#12970)
* feat(cli): allow merging multiple configuration values

Currently the dev/build/bundle commands can only merge a single Tauri configuration value (file or raw JSON string), which imposes a limitation in scenarios where you need more flexibility (like multiple app flavors and environments). This changes the config CLI option to allow multiple values, letting you merge multiple Tauri config files with the main one.

* fix ios build
2025-03-14 12:04:58 -03:00
WofWca
f67a4a6bfe fix(core): AssetResolver.get(): don't skip first char (#12971)
That is, it would try to get `sers/john` if you called
`AssetResolver.get("users/john")`.
This commit fixes the bug by only skipping the first character
only if it _is_ a slash (/).

Why it is important:
`tauri::WebviewUrl::App()` docs state that it's OK to specify
the path as `users/john` to get `tauri://localhost/users/john`
in the end.
So if an application developer is using `AssetResolver.get()`
together with `WebviewUrl::App()`, they will would get
inconsistent behavior: for the same path, the latter would work,
while the former would fail.
In fact, we encountered this bug in our code,
[here](c860b0f4c6/packages/target-tauri/src-tauri/src/help_window.rs (L34-L43)).
2025-03-14 05:29:55 +02:00
Simon Laux
d8059bad3c add AppHandle.fetch_data_store_identifiers and AppHandle.remove_data_store (#12900)
* add `AppHandle::fetch_all_data_store_identifiers` and `AppHandle::remove_data_store`

* make it run on main thread, so you can call the function from any thread and it works.

* changes file

* update signature, move functions to RuntimeHandle

* add api

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-03-13 18:17:22 -03:00
Simon Laux
be2e6b85fe add Window.is_always_on_top() and WebviewWindow.is_always_on_top() (#12944)
* add `Window.is_always_on_top()` and `WebviewWindow.is_always_on_top()`

* add api

* fmt

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-03-13 18:02:01 -03:00
Chandrasekaran Akash
b9ee806724 feat(tauri-build): set CompanyName for Windows (#12958) 2025-03-13 09:35:56 +02:00
renovate[bot]
339a075e33 chore(deps): update rust crate cargo_toml to 0.22 (#12940)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-12 13:42:37 +01:00
Fabian-Lars
93124ad2eb fix(tauri-utils): Set minimum patch version for glob (#12950) 2025-03-10 21:38:22 +01:00
tk
3a74dc8f34 fix(api): webview.close wrong command error (#12935) 2025-03-10 06:48:02 +02:00
ninjadev64
3626b7a92b fix(bundler): bundle resources to correct path during RPM bundling when resources are specified as a map (#12759)
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-03-09 16:19:18 +01:00
renovate[bot]
eea12c196e chore(deps): update dependency rollup to v4.35.0 (#12932)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-09 10:12:56 +08:00
renovate[bot]
4ce5c74ab4 chore(deps): update dependency eslint-config-prettier to v10.1.1 (#12916)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-09 10:12:08 +08:00
Amr Bashir
2d029a9f53 fix(core): remove TSend: Clone for Channel in commands (#12878)
followup on #12876
2025-03-03 17:41:10 +02:00
Lucas Fernandes Nogueira
f268b3dbdf fix(cli): Tauri project path resolution, closes #3527 #12779 (#12871) 2025-03-03 08:18:00 -03:00
Amr Bashir
755533c518 fix(core): implement Clone manually on Channel. (#12876)
ref: https://github.com/tauri-apps/plugins-workspace/pull/2479#discussion_r1976864479
2025-03-03 08:32:17 +02:00
Tony
dc78dfecab chore: ignore vscode settings.json and tasks.json (#12875) 2025-03-03 05:38:47 +02:00
Lucas Fernandes Nogueira
f98598817c fix(core): compatibility check for Android SDK < 24 (#12870) 2025-03-02 17:56:25 -03:00
Niladri Adhikary
060de5bbdd feat(api): implement getIdentifier() to access tauri.conf.json identifier (#12837)
* feat(api): implement getIdentifier() to access tauri.conf.json identifier

* updated

* chore(api): update change file and rebuild bundle

* Update to @since 2.4.0

* added tag

* Update .changes/get-identifier.md

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

---------

Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-03-02 15:12:33 -03:00
Simon Laux
c698a6d6f3 feat: add Webview.reload and WebviewWindow.reload (#12818)
* feat: add `Webview.reload` and `WebviewWindow.reload`

* fix tests

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-03-02 15:11:25 -03:00
Simon Laux
20c1906912 feat: add WebviewBuilder.disable_javascript and WebviewWindowBuilder.disable_javascript (#12821)
* feat: add `WebviewBuilder.disable_javascript` and `WebviewWindowBuilder.disable_javascript`

* wry 0.50.3

* add missing config options and API types

* add change file for api

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-03-02 14:54:34 -03:00
renovate[bot]
3fb8d7ca6b chore(deps): update dependency rollup to v4.34.9 (#12862)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-01 11:16:25 +01:00
Lucas Fernandes Nogueira
55ffa23c9e fix(core): docs.rs mobile build (#12855) 2025-02-28 15:37:38 -03:00
github-actions[bot]
cab7f76d01 apply version updates (#12826)
Co-authored-by: amrbashir <48618675+amrbashir@users.noreply.github.com>
2025-02-28 14:14:08 +01:00
Amr Bashir
e103e87f15 fix(windows): ensure APIs exist before using it (#12848)
* fix(windows): ensure APIs exist before using it

* fix build on other platforms

* clippy

* use GetSystemMetricsForDpi
2025-02-28 14:46:16 +02:00
Fabian-Lars
bca02967a9 docs: Update wording from #12830 (#12839) 2025-02-28 00:12:19 +02:00
Tony
887db0813f chore(deps): update js dependencies (#12832)
* chore(deps): update js dependencies

* Update lock
2025-02-27 17:15:32 +08:00
Tony
4f26dcf309 fix(deps): os webview not gated in wry feature (#12833) 2025-02-27 16:38:20 +08:00
Simon Laux
4bffc326ea docs: update WebViewBuilder::with_asynchronous_custom_protocol with platform-specific notes (#12830) 2025-02-27 03:10:08 +02:00
renovate[bot]
b859dc43fc chore(deps): update rust crate resvg to 0.45.0 (#12825)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-26 22:00:52 +01:00
renovate[bot]
9332132239 chore(deps): update dependency eslint-config-prettier to v10.0.2 (#12822)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-26 20:46:52 +01:00
Timur Amirov
22e9bf74a4 fix(cli/ios): Configure initial view controller for the launch screen on iOS (#12538)
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-02-26 20:42:24 +01:00
Fabian-Lars
b495fe0fdc ci: install corepack in docker (#12824)
* ci: install corepack in docker

this should fix the build errors from https://github.com/tauri-apps/tauri/actions/runs/13548556704/job/37866236681
i only added it outside of docker in my last pr

* remove musl
2025-02-26 13:41:32 -03:00
github-actions[bot]
7d618f12d8 apply version updates (#12518)
Co-authored-by: amrbashir <48618675+amrbashir@users.noreply.github.com>
2025-02-26 12:45:31 -03:00
Amr Bashir
385a41dea2 enhance(windows): disable our in-client resizing for undecorated window with shadows (#12817)
* enhance(windows): disable our in-client resizing for undecorated window with shadows

ref: https://github.com/tauri-apps/tao/pull/1052

* skip hittesting for undeceorated windows
2025-02-26 17:21:46 +02:00
Fabian-Lars
955832e56b ci: Build win-arm64 cli with rustls (#12813) 2025-02-25 21:47:46 +01:00
Fabian-Lars
c116dfcdee fix(cli): Hide updater bundle target in help output (#12801)
ref https://github.com/tauri-apps/tauri/issues/3251#issuecomment-2677139820
2025-02-25 20:25:28 +02:00
Fabian-Lars
d6520a21ce chore(deps): wry@0.50 muda@0.16 tray-icon@0.20 windows@0.60 webview2-com@0.36 objc@0.6 window-vibrancy@0.6 tao@0.32 (#12541)
* chore(deps): Update windows to 0.59. Update webview2-com to 0.35

* wry and other crates and objc2

* window-vibrancy 0.6

* Update windows059-webview035.md

* win compile error

* tao

* tao 0.32.1

* updatus maximus

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-02-25 19:41:00 +02:00
Simon Laux
ab81adb71b docs: improve documentation around incognito and data store (#12806) 2025-02-25 06:17:20 +02:00
kandrelczyk
6e417c9435 fix(linux): Add missing RPM signature (#12786) 2025-02-24 14:52:06 +01:00
Kotkoroid
ddc469367a style: fix Vite and React branding (#12768) 2025-02-22 11:30:31 +01:00
Sean Wang
d7b998fe71 fix(tauri): deprecate Manager::unmanage to fix use-after-free (#12723)
close #12721
2025-02-21 02:38:31 +02:00
renovate[bot]
d9a07e66af chore(deps): update dependency globals to v16 (#12750)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-20 15:26:14 +01:00
renovate[bot]
0adeb4e7c5 chore(deps): update rust crate infer to 0.19 (dev) (#12599)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: FabianLars <github@fabianlars.de>
2025-02-20 14:36:44 +01:00
Jim
70d8557cc3 docs(testing): inform reader about 'tauri://localhost' (#12623) 2025-02-20 12:48:33 +01:00
Tony
95fc3cd424 chore: cleanup a few unneeded clones (#12733) 2025-02-18 18:35:40 +08:00
renovate[bot]
4633705da7 chore(deps): update dependency rollup to v4.34.8 (#12727)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-17 20:12:00 +08:00
Tony
3f680588cd chore: update prettier to 3.5.1 and enable experimentalOperatorPosition (#12715) 2025-02-16 20:34:19 +08:00
Sean Wang
7d8252679d feat(tauri): export struct tauri::ExitRequestApi (#12701) 2025-02-15 16:21:06 +01:00
renovate[bot]
ee95c1b1ed chore(deps): update dependency rollup to v4.34.7 (#12702)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-15 10:19:48 +08:00
Ege Güngördü
741e44b45c fix: fix incorrect example for WebviewBuilder::from_config (#12695) 2025-02-13 00:04:29 +02:00
renovate[bot]
8e9339e880 chore(deps): update rust crate jsonschema to 0.29 (dev) (#12660)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-09 14:19:32 +01:00
renovate[bot]
053b57c1df chore(deps): update dependency rollup to v4.34.6 (dev) (#12647)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-07 20:07:55 +01:00
renovate[bot]
b6a56f3616 chore(deps): update dependency rollup to v4.34.5 (#12641)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-07 10:18:38 +01:00
dependabot[bot]
11945e561c chore(deps-dev): bump vitest from 3.0.3 to 3.0.5 (#12637)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-06 18:48:57 +01:00
renovate[bot]
b6ad316460 chore(deps): update dependency rollup to v4.34.4 (dev) (#12604)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: FabianLars <github@fabianlars.de>
2025-02-06 18:32:56 +01:00
Nazar Antoniuk
5eba0785c4 feat: add Ukrainian translation for the custom tauri messages in the nsis bundle (#12605) 2025-02-06 17:44:48 +02:00
dependabot[bot]
6038f09d85 chore(deps): bump openssl from 0.10.68 to 0.10.70 (#12606)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-03 21:30:48 +01:00
renovate[bot]
e3b0260871 chore(deps): update dependency rollup to v4.34.0 (#12593)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-02 19:54:02 +08:00
Antony Kurniawan
a6ada76a9f docs: update devUrl on config schema (#12592) 2025-02-01 23:45:13 +02:00
renovate[bot]
bfc71e845b chore(deps): update rust crate ureq to v3 (dev) (#12524)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: FabianLars <github@fabianlars.de>
2025-01-29 23:23:38 +01:00
renovate[bot]
0a11b8741a chore(deps): update rust crate tauri-winres to 0.3 (dev) (#12559)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-29 21:51:24 +01:00
renovate[bot]
6b70fbcc84 chore(deps): update dependency rollup to v4.32.1 (dev) (#12548)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: FabianLars <github@fabianlars.de>
2025-01-28 14:46:04 +01:00
Amr Bashir
e9c9c4d6f6 feat: derive Clone for PathResolver (#12529)
closes #12528
2025-01-26 20:11:15 +02:00
Sean Wang
abdd558075 feat(tauri/Emitter): add emit_str* method to emit serialized data directly (#12460)
* feat(tauri/Emitter): add `emit_str*` method to emit serialized data

* style: rust fmt
2025-01-26 17:58:21 +02:00
Sean Wang
3dbcbe7685 fix(tauri): Webview::navigate unnecessarily borrows &mut self (#12461) 2025-01-25 22:21:04 +01:00
Bastian Kistner
a2d36b8c34 feat: disable background throttling (#12181)
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-01-25 22:20:31 +01:00
github-actions[bot]
5a3647bdfe Apply Version Updates From Current Changes (#12515)
Co-authored-by: FabianLars <30730186+FabianLars@users.noreply.github.com>
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-01-25 20:51:13 +01:00
Fabian-Lars
477e9c0496 fix(core): Use safe_block_on in mobile proxy (#12514)
fixes #12513
2025-01-25 20:18:46 +01:00
github-actions[bot]
82d634f4a9 Apply Version Updates From Current Changes (#12512)
Co-authored-by: FabianLars <30730186+FabianLars@users.noreply.github.com>
2025-01-25 18:23:32 +01:00
Fabian-Lars
8e9134c4a2 fix(cli): Apply --bins flag on build instead of dev (#12511) 2025-01-25 17:50:46 +01:00
github-actions[bot]
dc1997b77d apply version updates (#12439)
Co-authored-by: FabianLars <30730186+FabianLars@users.noreply.github.com>
2025-01-25 15:29:40 +01:00
bradleat
1a86974aa3 fix(cli): let xcode handle building for ios build --open (#12406)
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-01-25 13:42:20 +01:00
bicarlsen
fb294af8e3 fix(tauri-driver): Parse ms:edgeOptions separately (#12383)
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-01-25 13:13:13 +01:00
Fabian-Lars
46c7b16111 ci(renovate): Disable oxc_ PRs 2025-01-25 12:10:59 +01:00
Fabian-Lars
9dac2863af fix(bundler): Don't self-sign dmg (#12323) 2025-01-25 11:46:16 +01:00
renovate[bot]
9a9d1205b0 chore(deps): update dependency rollup to v4.32.0 (dev) (#12502)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-25 11:45:16 +01:00
Fabian-Lars
27096cdc05 fix(cli): don't force native-tls feature on desktop (#12445) 2025-01-25 11:27:29 +01:00
sftse
6cbfc4878d refactor: document Emitter/Listner traits panics, refactor check into internal struct (#12444) 2025-01-24 04:17:17 +02:00
Andzej Korovacki
f5a59b93bf fix(bundler): change build metadata verification into a warning (#12136)
Co-authored-by: akorovacki <andzej.korovacki@geniussports.com>
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-01-23 15:25:11 +01:00
renovate[bot]
5432752e51 chore(deps): update dependency vitest to v3 (dev) (#12421)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: FabianLars <fabianlars@fabianlars.de>
2025-01-23 14:03:40 +01:00
renovate[bot]
bf912b8e08 chore(deps): update rust crate dirs to v6 (dev) (#12372)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: FabianLars <fabianlars@fabianlars.de>
2025-01-23 13:58:00 +01:00
Trey Smith
9a30bed98c fix(macos): frameworks being signed with entitlements unnecessarily (#12423) 2025-01-23 12:14:33 +01:00
dependabot[bot]
9d02c18ac2 chore(deps-dev): bump vite from 6.0.7 to 6.0.9 (#12469)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 6.0.7 to 6.0.9.
- [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/v6.0.9/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  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-01-23 17:06:41 +08:00
anatawa12
de8600b4d9 fix(bundler): Bump nsis tauri utils to 0.4.2 (#12471)
* chore: bump nsis-tauri-utils

* docs(changelog)): Bump nsis-tauri-utils to 0.4.2
2025-01-22 03:01:04 +02:00
Mads Marquart
0ea8894579 chore(deps): prepare for objc2 frameworks v0.3 (#12468)
These will have a bunch of default features enabled, so let's
pre-emptively disable them.
2025-01-21 22:57:45 +02:00
Fabian-Lars
fbe7c9ead7 fix(bundler): fix injectedbundle search path (#12466) 2025-01-21 16:52:41 +02:00
Tony
b8eb28877f enhance(nsis): clean up reg keys in uninstaller (#12427) 2025-01-20 22:33:54 +02:00
Tomas Tamadamas
90c6546faf chore: Rewrite simply "Localhost free term" in README.md within #10510 (#12415) 2025-01-20 16:22:22 +02:00
renovate[bot]
4ed2ab76e2 chore(deps): update dependency rollup to v4.31.0 (dev) (#12446)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-19 17:59:01 +01:00
Fabian-Lars
bc43c738ba fix(cli): Add clipboard-manager to known plugins (#12442)
* fix(cli): Add `clipboard-manager` to known plugins

fixes #12440

* Update plugins.rs
2025-01-19 14:19:10 +02:00
Jim
0b79af7114 enhance(cli): log message to inform user of DevCommand being used (#12438) 2025-01-18 22:21:21 +02:00
github-actions[bot]
a70e690fe7 apply version updates (#12425)
Co-authored-by: FabianLars <30730186+FabianLars@users.noreply.github.com>
2025-01-18 10:07:28 +01:00
Felix Eckhardt
72748cc45c fix(windows): Resolve broken installation directory handling in MSI & NSIS, preventing duplicate installations during updates (#12365) 2025-01-17 21:25:15 +01:00
Fabian-Lars
cf771bf69a fix(bundler/wix): Prevent dlls from overwriting root resources (#12402) 2025-01-17 16:41:31 +01:00
Fabian-Lars
07ccdc499c fix(bundler/nsis): Include WebView2Loader.dll if found to match msi (#12324)
* fix(bundler/nsis): Include WebView2Loader.dll if found to match msi behavior

* Update fix-nsis-webviewloaderdll.md

* only include dll in gnu builds
2025-01-17 17:12:58 +02:00
mattyg
d2c8f0eb5c fix: run tauri's internal init scripts before user's scripts (#12424) 2025-01-17 03:37:41 +02:00
Fabian-Lars
b643dcc1c4 docs(utils): Fix typo in useLocalToolsDir (#12409) 2025-01-15 14:59:34 +02:00
renovate[bot]
cd7d08b63f chore(deps): update dependency eslint-config-prettier to v10 (#12386)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-15 10:54:33 +08:00
github-actions[bot]
4c3f047735 Apply Version Updates From Current Changes (#12377)
Co-authored-by: FabianLars <30730186+FabianLars@users.noreply.github.com>
2025-01-13 13:08:29 +01:00
Fabian-Lars
61e69db9e4 chore: Add changefile for #12371 (#12376) 2025-01-13 12:23:17 +01:00
Oscar Beaumont
75d56e8364 fix: fix Specta integration (#12371) 2025-01-13 04:03:36 +02:00
github-actions[bot]
a8aca70151 Apply Version Updates From Current Changes (#12355)
Co-authored-by: FabianLars <30730186+FabianLars@users.noreply.github.com>
2025-01-11 18:13:55 +01:00
Fabian-Lars
cad5504455 fix(cli): Fix npm package name in tauri add (#12354) 2025-01-11 17:28:54 +01:00
renovate[bot]
f8e50e8e5b chore(deps): update rust crate tauri-winres to 0.2 (dev) (#12341)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-10 20:19:48 +01:00
renovate[bot]
cfe1af2848 chore(deps): update rust crate notify to v8 (dev) (#12342)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: FabianLars <fabianlars@fabianlars.de>
2025-01-10 20:02:53 +01:00
github-actions[bot]
89c6f08e82 Apply Version Updates From Current Changes (#12218)
Co-authored-by: FabianLars <30730186+FabianLars@users.noreply.github.com>
2025-01-10 15:08:21 +01:00
Fabian-Lars
cde0ff7798 chore: Fix clippy 1.84 warnings (#12328) 2025-01-10 13:47:37 +01:00
renovate[bot]
b0d7527250 chore(deps): update rust crate windows-registry to 0.4 (dev) (#12301)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-07 23:04:03 +01:00
renovate[bot]
a28b5013c5 chore(deps): update rust crate ico to 0.4 (dev) (#12298)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-07 22:38:43 +01:00
Fabian-Lars
b9a99a5c69 fix(cli): Skip File Access events in dev server (#12297) 2025-01-07 21:11:24 +01:00
Marco Mengelkoch
98f62e65a2 fix(cli): tauri add NPM packages for community plugins (#12246)
It currently isn't possible to simply add a community plugin the same was as adding official plugins.
Trying to perform  `npm run tauri add tauri-plugin-python` is trying to install npm package `@tauri-apps/plugin-python`.
But the npm scope `@tauri-apps/` is reserved for official tauri plugins.

The official documentation recommends to name the npm package `tauri-plugin-{name}-api` and it should be possible to have a parameter that makes it possible to install that package.

- closes #12217

This changes the command to check if the plugin is an official tauri plugin or not, using the appropriate npm package name format

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-01-07 10:16:35 -03:00
renovate[bot]
c130af6b06 chore(deps): update dependency rollup to v4.30.1 (dev) (#12291)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-07 13:48:40 +01:00
Lucas Fernandes Nogueira
ef21ed9ac1 fix(cli): iOS build crashing when development team has spaces (#12290)
Even though I couldn't even get the build to succeed when using the team name as the "developmentTeam" configuration (instead of the team ID), I've received reports that our processing of that value is broken and only works when it is escaped using `\"`.
2025-01-07 09:41:56 -03:00
Tony
cd1d026f97 fix: fails to build if the project path contains glob characters (#11961)
* Escape glob patterns

* Add change file

* Reword the change
2025-01-07 09:22:43 -03:00
Aurélien Jacobs
848d0e060e chore(deps): update cargo_toml for edition 2024 [fix #10412] (#12270)
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-01-06 20:34:49 +01:00
Max Katz
ae75a353d0 chore: update copyright year (#12170)
Co-authored-by: Max Katz <zrxmax@icloud.com>
2025-01-06 13:46:06 +01:00
gerald
70f96e3222 chore(deps/driver): update hyper to version 1 (#12240)
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-01-06 11:12:08 +01:00
renovate[bot]
3acf679c87 chore(deps): update dependency rollup to v4.30.0 (dev) (#12263)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-06 10:47:03 +01:00
renovate[bot]
22d5852208 chore(deps): update dependency rollup to v4.29.2 (dev) (#12238)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-05 14:58:18 +01:00
renovate[bot]
701778a195 chore(deps): update dependency fast-glob to v3.3.3 (dev) (#12233)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-05 12:46:30 +01:00
Patrick F.
a0f2c84d51 feat(cli): Add 64x64 png to default tauri icon command (#12204) 2025-01-04 23:26:18 +01:00
github-actions[bot]
f86e2387c9 apply version updates (#12183)
Co-authored-by: FabianLars <30730186+FabianLars@users.noreply.github.com>
2025-01-04 01:17:49 +01:00
Fabian-Lars
26fc9558fe fix(cli): Re-add TriggeredKill in dev watcher logic (#12178) 2025-01-04 00:39:07 +01:00
renovate[bot]
90dc7b19fc chore(deps): update rust crate which to v7 (dev) (#12144)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-03 23:28:10 +01:00
renovate[bot]
c681d835d5 chore(deps): update dependency vite to v6 (dev) (#12133)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: FabianLars <fabianlars@fabianlars.de>
2025-01-03 23:05:29 +01:00
Fabian-Lars
208d8968ce ci(deps): Update repository-dispatch to v3 (#12169) 2025-01-03 22:34:55 +01:00
Fabian-Lars
aaa7d9bb13 ci: Switch to upstream create-pull-request (#12123)
* ci: Switch to upstream create-pull-request

* what the actual f

* fix version comment

---------

Co-authored-by: Tillmann <28728469+tweidinger@users.noreply.github.com>
2025-01-03 22:48:50 +02:00
github-actions[bot]
d150a40b09 Apply Version Updates From Current Changes (#12165)
Co-authored-by: FabianLars <FabianLars@users.noreply.github.com>
2025-01-03 15:34:54 +01:00
Fabian-Lars
881729448c fix(cli): Ignore file access events (#12164) 2025-01-03 15:00:31 +01:00
github-actions[bot]
cd841d8e33 Apply Version Updates From Current Changes (#11659)
Co-authored-by: FabianLars <FabianLars@users.noreply.github.com>
2025-01-02 19:29:17 +01:00
renovate[bot]
3d8a39aa4a chore(deps): update rust crate resvg to 0.44.0 (dev) (#12126)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-02 16:55:09 +01:00
renovate[bot]
50e92d097b chore(deps): update rust crate worker to 0.5 (dev) (#12127)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: FabianLars <fabianlars@fabianlars.de>
2025-01-02 16:44:07 +01:00
renovate[bot]
bc4dfcd798 chore(deps): update rust crate pico-args to 0.5 (dev) (#12125)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-02 16:12:18 +01:00
renovate[bot]
832ad10e3a chore(deps): update rust crate cargo_metadata to 0.19 (dev) (#12113)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: FabianLars <fabianlars@fabianlars.de>
2025-01-02 15:54:39 +01:00
renovate[bot]
0198354961 chore(deps): update rust crate oxc crates to 0.38 (dev) (#12122)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: FabianLars <fabianlars@fabianlars.de>
2025-01-02 14:56:23 +01:00
renovate[bot]
c0a5a10cff chore(deps): update rust crate notify-debouncer-mini to 0.5 (dev) (#12118)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: FabianLars <fabianlars@fabianlars.de>
2025-01-02 14:08:50 +01:00
Dmitry Dygalo
d7f48cb324 chore(deps): Update jsonschema to 0.28 (#12089) 2025-01-02 13:22:08 +01:00
Tony
a16796a555 fix(api): use array for channel queueing (#12069) 2025-01-02 12:19:50 +01:00
renovate[bot]
231e9a5ee1 chore(deps): update rust crate image to 0.25.5 (dev) (#12105)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-01-02 01:11:42 +01:00
renovate[bot]
b0ddee8992 chore(deps): update rust crate wry to 0.48 (dev) (#12101)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: FabianLars <fabianlars@fabianlars.de>
2025-01-02 01:01:31 +01:00
renovate[bot]
5319325886 chore(deps): update dependency @napi-rs/cli to v2.18.4 (dev) (#12097)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-01 23:41:07 +01:00
renovate[bot]
ccce63f8c8 chore(config): migrate renovate config (#12099)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-01-01 23:35:57 +01:00
renovate[bot]
da958395ff chore(config): migrate renovate config (#12096)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-01-01 23:28:38 +01:00
renovate[bot]
1737df3e33 chore(deps) Update Tauri Bundler (dev) (#11669)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: FabianLars <fabianlars@fabianlars.de>
2025-01-01 23:12:29 +01:00
renovate[bot]
2df426ed1d chore(deps) Update Rust crate syn to v2.0.94 (dev) (#12094)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-01 22:27:28 +01:00
renovate[bot]
361fdb3585 chore(deps) Update Rust crate syn to v2.0.94 (dev) (#12088)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-01 22:16:42 +01:00
renovate[bot]
838b2b8b3b chore(deps) Update Tauri Build (#12087)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-01 22:24:34 +08:00
renovate[bot]
f87e0485ca chore(deps) Update Tauri API Definitions (#12084)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-01 22:21:46 +08:00
renovate[bot]
b794ca4a27 chore(deps) Update Rust crate syn to v2.0.93 (#12083)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-01 22:21:08 +08:00
Dimitris Apostolou
8f282c6305 deps: fix crate vulnerabilities (#12080) 2025-01-01 00:20:15 +02:00
Lieke
ed118da266 fix: fix typo in AndroidConfig docstring (#12003) 2024-12-30 01:25:29 +02:00
Shaun Hamilton
c8700656be fix(tauri-cli): prevent accidental object permission rm (#11985) 2024-12-30 01:18:50 +02:00
renovate[bot]
cdd1ebf81f chore(deps) Update Tauri Codegen (#12049)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-27 11:55:57 +08:00
renovate[bot]
253b1872f1 chore(deps) Update Tauri API Definitions (#12050)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-27 11:40:36 +08:00
renovate[bot]
3ac76bec77 chore(deps) Update Tauri Build to v1.0.95 (#12047)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-27 11:37:27 +08:00
renovate[bot]
faeec8e965 chore(deps) Update Rust crate syn to v2.0.91 (#12046)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-27 11:36:28 +08:00
stringhandler
e349dfe572 fix: fix panic caused by removed_resource.is_none (fix #11955) (#12000) 2024-12-23 16:11:31 +02:00
Andrew Ferreira
fdaf48fc4a chore: fix crates.io link (#12018)
* chore: fix crates.io link

* chore: format file
2024-12-21 02:46:37 +02:00
renovate[bot]
7d38ee987e chore(deps) Update Tauri Codegen (dev) (#11999)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-19 16:22:59 +01:00
renovate[bot]
f1167143cd chore(deps) Update dependency @types/node to v22.10.2 (dev) (#11943)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-19 13:28:50 +01:00
renovate[bot]
2601811cef chore(deps) Update Tauri Build to v1.0.24 (dev) (#11998)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-19 13:22:40 +01:00
Amr Bashir
ca7f025fd8 fix(core): return an error when accessing unmanaged state in command (#11958)
closes #11949
2024-12-12 23:05:32 +02:00
Tony
17bcec8abe chore(deps): update all js dev dependencies (#11941)
- Update vite to v6
- Update svelte to v5
- Bump nanoid to fix audit
- Align api and cli to both use the same node types version
2024-12-11 12:55:38 +02:00
renovate[bot]
f5eacf3283 chore(deps) Update Tauri API Definitions (#11936)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-11 13:45:49 +08:00
renovate[bot]
6bbf3649f9 chore(deps) Update Tauri Codegen (#11939)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-11 13:45:08 +08:00
renovate[bot]
22b26a2e36 chore(deps) Update Tauri Build to v1.0.94 (#11938)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-11 13:43:10 +08:00
renovate[bot]
2a120bdcc0 chore(deps) Update Rust crate syn to v2.0.90 (#11935)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-11 12:58:54 +08:00
简静凡
0ae06c5ca8 fix: the exclude path in file Cargo.toml of plugin template generated by cli (#11914) 2024-12-09 15:36:27 +01:00
Amr Bashir
afad8067d1 chore(deps): update tao to 0.31 (#11906) 2024-12-09 12:16:33 +02:00
John Carmack
b37741da6a fix(feature/specta): Resolve error when using latest version of specta with tauri specta feature (#11871)
* Update specta feature to use latest specta version; add specta-util dependency (required in specta v2 rc.20)

* Add .changes file

* Update crates/tauri/Cargo.toml

---------

Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
2024-12-05 08:56:16 -03:00
Fabian-Lars
2b8a981050 refactor(cli): use cargo run for tauri dev (#11694)
* x

* todo

* lint

* lint

* rename fn

* lint

* lint

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2024-12-05 07:38:06 -03:00
Fabian-Lars
1f65fd2bb7 fix(cli): Statically compile msvc runtime (#11769)
* fix(cli): Statically compile msvc runtime

fixes https://github.com/tauri-apps/tauri/issues/11642
ref https://github.com/swc-project/swc/pull/7965

i only added it for x64 for now but we should monitor x32 (swc removed it for this one again) and aarch64 (swc never added it).
x32 is fairly rare as a dev system and aarch64 didn't seem much testing in general (as a dev system) so i'd prefer to wait and see if it's needed.

note that i don't know if any other tooling (rust etc) need the dyn runtime so that's also something to monitor

* 32bit and arm64
2024-12-04 15:32:09 -03:00
renovate[bot]
9f51bbf1de chore(deps) Update Tauri Codegen (#11866)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-04 14:51:30 +08:00
renovate[bot]
475597f97c chore(deps) Update Rust crate syn to v2.0.90 (#11865)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-04 14:49:44 +08:00
renovate[bot]
e61225bcc4 chore(deps) Update Rust crate anyhow to v1.0.94 (#11864)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-04 14:49:21 +08:00
renovate[bot]
01c74f4424 chore(deps) Update Tauri API Definitions (#11867)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-04 14:48:45 +08:00
Fabian-Lars
882b0aded1 chore: apply clippy suggestions. (#11849)
* chore: apply clippy suggestions.

* .

* .
2024-12-02 20:36:06 -03:00
Fabian-Lars
89e30ef20d fix(core): Remove os check on data_store_identifier (#11817)
* fix(core): Remove os check on `data_store_identifier`

* typo
2024-12-02 20:32:02 -03:00
Fabian-Lars
a692c8937f fix(bundler): create tauri tools dir first. make tools executable. (#11852)
* not sure what's going on yet

* .

* fix(bundler): try to create tauri tools dir

* Discard changes to .github/workflows/test-cli-js.yml

* fix
2024-12-02 20:29:42 -03:00
Fabian-Lars
8ba5e16384 ci: msrv compliant lockfile. test cli with 1.77.2 instead of stable. (#11851) 2024-12-02 20:28:45 -03:00
Fabian-Lars
b50a1ac0ef fix(core): Add background color permissions (#11850)
fixes #11848
2024-12-02 20:27:25 -03:00
Shi Yan
0e2f0b29cd docs: Add missing info regarding the drop position offset. (#11406)
* Add missing document regarding the drop position offset.

* Update webview.ts

---------

Co-authored-by: Fabian-Lars <github@fabianlars.de>
2024-12-02 20:40:56 +01:00
renovate[bot]
983634a41f chore(deps) Update dependency @types/node to v22.9.1 (#11750)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-02 19:48:33 +01:00
renovate[bot]
2c3e000f73 chore(deps) Update Rust crate url to v2.5.4 (#11745)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-02 15:38:10 +01:00
Elias Sjödin
a6e84f7d2c fix(api.js): wrong command for isAbsolute (#11835) 2024-11-30 22:04:48 +01:00
Fabian-Lars
d6bed20a0e refactor(bundler): Move appimage bundler script logic into rust (#11758) 2024-11-28 04:52:24 +02:00
lars-berger
18bd639f6e feat(macos): Add with_data_store_identifier to WebviewBuilder (#11798) 2024-11-28 04:43:34 +02:00
Fabian-Lars
53f808674b feat(bundler): add option to disable CI for just the dmg bundler (#11799) 2024-11-28 04:41:19 +02:00
renovate[bot]
9f0d902f6b chore(deps) Update Tauri Build to v1.0.215 (#11744)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-27 13:18:33 +08:00
renovate[bot]
df27b4d94c chore(deps) Update Tauri Macros (#11803)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-27 13:10:41 +08:00
Fabian-Lars
5188c0fae2 feat(core): Add Scope::is_forbidden (#11767) 2024-11-26 14:31:48 +02:00
lars-berger
ba6f370147 fix(core): Initialize command cache when a capability is added (#11785) 2024-11-26 14:18:55 +02:00
Amr Bashir
f884bae75b feat: add tauri::Builder::on_tray_icon_event (#11742) 2024-11-21 15:06:57 +02:00
Amr Bashir
fc30b20bea feat(api/tray): add TrayIcon.setShowMenuOnLeftClick method (#11726) 2024-11-21 14:50:41 +02:00
Liigo Zhuang
7a9b920c3e docs: Remove header images from inline docs (#11749) 2024-11-21 14:48:49 +02:00
Amr Bashir
12a48d1e26 fix(api): transform icon when creating icon menu item and predefined about menu item with icon (#11741) 2024-11-21 14:22:51 +02:00
AHQ
020ea05561 feat: Implement Badging API (#11661) 2024-11-20 02:59:28 +02:00
Amr Bashir
a09e48e396 fix(core): manually simplify patterns for fs scope (#11730)
closes #11614

Remove UNC manually, instead of `dunce::simplified` because `path` could have `*` in it and that's not allowed on Windows and `dunce::simplified` will check that and return `path` as is without simplification resulting in a missing pattern in scope

for the scope pattern `\\?\C:\path\to\dir\**`, we expect the scope to have:
- `\\?\C:\path\to\dir\**`
- `C:\path\to\dir\**`

but if we use `dunce::simplified`, it will see `**` as invalid path component on Windows and will not simplify the path resulting in a scope that only has `\\?\C:\path\to\dir\**`
2024-11-20 00:50:10 +02:00
renovate[bot]
b37c208d61 chore(deps) Update Tauri API Definitions (#11668)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-19 13:13:44 +08:00
Fabian-Lars
72feaf99fc refactor(bundler): remove unused fs utils, add http utils (#11716) 2024-11-19 01:23:20 +02:00
Sander Cox
d86aaccb0b enhance: allow show_menu_on_left_click on Windows (#11729) 2024-11-19 00:25:20 +02:00
Kévin TURMEL
93a3a043d3 fix(windows): add Portuguese language in nsis bundle (fix #11725) (#11727) 2024-11-19 00:11:16 +02:00
Fabian-Lars
2bc46b061c docs(examples): fix file-assoc readme cargo build command (#11711)
closes #11703
2024-11-18 19:50:41 +02:00
Fabian-Lars
b63262cd4d fix(api.js): Change cb type in mockIPC to return unknown (#11724) 2024-11-18 17:50:39 +02:00
Amr Bashir
f2814ed538 fix(cli/info): use XDG_SESSION_DESKTOP instead of DESKTOP_SESSION (#11663) 2024-11-14 18:02:22 +02:00
renovate[bot]
ff39ad93b7 chore(deps) Update Tauri Codegen (#11667)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-13 13:36:14 +08:00
renovate[bot]
9cb6cad284 chore(deps) Update Rust crate serde to v1.0.215 (#11666)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-13 13:21:07 +08:00
jLynx
cccb308c7b feat(bundler): create signature for .deb bundle (#11562) 2024-11-13 03:12:06 +02:00
SpikeHD
dc4d794776 feat(windows, linux): add WebviewWindowBuilder/WebviewBuilder::extensions_path (#11628) 2024-11-13 01:20:06 +02:00
Tony
46935212b6 fix: parse json5 capability files when config-json5 is enabled (#11658) 2024-11-12 16:44:37 +02:00
Amr Bashir
74212d40d8 feat(cli): include linux DE and session type in tauri info (#11653) 2024-11-12 15:59:47 +02:00
Del
c3b1fced38 docs: correct payload property for DragDropEvent.over example (#11648) 2024-11-11 17:14:36 +01:00
github-actions[bot]
ef2592b5a8 Apply Version Updates From Current Changes (#11646)
Co-authored-by: amrbashir <amrbashir@users.noreply.github.com>
2024-11-11 16:25:14 +02:00
amrbashir
7f81f05236 chore: rename change file 2024-11-11 15:45:22 +02:00
Amr Bashir
e8a50f6d76 fix(core): hard code BaseDirectory integer values to avoid regressions when reordering the variants (#11645)
closes #11633
2024-11-11 14:58:16 +02:00
Daniel Gerhardt
5e94354875 fix(api/dpi): fix toLogical and toPhysical for positions (#11639) 2024-11-11 14:21:25 +02:00
Kornel
0fcef3f941 docs: document vanilla JS import alternative (#11632) 2024-11-11 14:21:08 +02:00
github-actions[bot]
86f22f0ec9 apply version updates (#11440)
Co-authored-by: amrbashir <amrbashir@users.noreply.github.com>
2024-11-09 15:47:39 +02:00
Amr Bashir
3f6f07a1b8 chore(deps): update wry to 0.47 and tao to 0.30.6 (#11627) 2024-11-09 04:14:22 +02:00
Lucas Fernandes Nogueira
60e86d5f6e fix(cli): android dev not working on Windows without --host (#11624)
ref https://discord.com/channels/616186924390023171/1291159454397628477
2024-11-09 02:57:36 +02:00
renovate[bot]
b28435860c chore(deps) Update Rust crate thiserror to v2 (dev) (#11604)
* chore(deps) Update Rust crate thiserror to v2

* thiserror v2 on all crates

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2024-11-08 08:21:38 -03:00
Amr Bashir
229d7f8e22 fix(core): fix child webviews on macOS and Windows treated as full webview window (#11616)
* fix(core): fix child webviews on macOS and Windows treated as full webview window

closes #11452

* Update .changes/child-windows-macos.md
2024-11-08 08:04:14 -03:00
Ville Säävuori
c561786844 docs: fix typos in drag&drop event.payload (#11620)
* fix: typo in drag&drop event.payload

'hover' -> 'over'

* fix: another typo

'hover' -> 'over'
2024-11-08 09:50:10 +08:00
Shaun Hamilton
6bf917941f feat(cli): add tauri remove command (#11322) 2024-11-07 19:58:25 +02:00
Tony
8e8312bb82 ci: unpin ravif (#11608) 2024-11-07 09:09:05 +01:00
renovate[bot]
f550a3f471 chore(deps) Update Tauri Bundler (dev) (#11601)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-06 13:25:49 -03:00
Amr Bashir
4d545ab3ca feat: background color APIs (#11486)
* feat: background color APIs

closes #10519
closes #1564

* clippy

* git branch

* bundle

* fix hex color schema pattern

* add missing `^`

* fix iOS

* revert test

* revert apple-codesign bump

* fmt

* add change files

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2024-11-06 13:21:47 -03:00
39zde
fabc2f283e feat: add HeaderConfig to SecurityConfig (#11485) 2024-11-06 16:16:46 +02:00
renovate[bot]
6b3c82aa90 chore(deps) Update Tauri macOSSign (dev) (#11541)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-06 10:41:34 -03:00
griffi-gh
3781429147 enhance: always check parent directory (fix #8679) (#11429)
* enhance: always check parent directory (fix #8679)

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

* add change file

* fix crate

---------

Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
2024-11-06 10:41:13 -03:00
renovate[bot]
15d6515eb1 chore(deps) Update dependency @types/node to v22 (dev) (#11545)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-06 09:54:52 -03:00
renovate[bot]
b63353bd61 chore(deps) Update Tauri API Definitions (dev) (#11597)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-06 07:49:59 -03:00
renovate[bot]
e8c0c57909 chore(deps) Update Tauri Codegen (dev) (#11596)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-06 07:49:38 -03:00
renovate[bot]
58392a5221 chore(deps) Update Rust crate handlebars to v6.2.0 (dev) (#11544)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-06 07:49:18 -03:00
renovate[bot]
8061fb2da8 chore(deps) Update Rust crate anyhow to v1.0.93 (#11598)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-06 16:04:51 +08:00
renovate[bot]
e835751d4f chore(deps) Update Rust crate syn to v2.0.87 (#11595)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-06 11:40:30 +08:00
renovate[bot]
0a170d0716 chore(deps) Update Rust crate anyhow to v1.0.92 (#11594)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-06 11:39:56 +08:00
renovate[bot]
03828587b5 chore(deps) Update Tauri API Definitions (#11543)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-06 11:31:40 +08:00
Amr Bashir
5c4b830843 feat(api): add SERIALIZE_TO_IPC_FN const and implement it for dpi types, add more constructors (#11191) 2024-11-05 23:30:17 +02:00
Amr Bashir
cbc095ec5f feat: add WebviewWindow/Webview::devtools (#11451)
* feat: add `WebviewWindow/Webview::devtools`

closes #10849

* clippy

* fix ToTokens

* document default behavior

* move builder usage

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2024-11-05 16:00:48 -03:00
Amr Bashir
2a75c64b54 feat(core): add window_class name API on Windows (#11469)
* On Windows, set name of Window Class, closes #7498
allow to customize it instead of current value hard coded "Window Class"

* feat(windows): add window_classname, closes #7498
allow to customize the window class name instead of current value hard coded "Window Class"

    * feat: add window_classname, closes #7498

    * add changes file

    * Update core/tauri-config-schema/schema.json

    * Update tooling/cli/schema.json

* missing pieces after merge

* clippy

---------

Co-authored-by: Géraud-Loup <47665233+geraudloup@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2024-11-05 15:18:47 -03:00
Amr Bashir
1b6b2cfaa1 feat(cli): process bundle > windows > wix > fragmentPaths with Handlebars (#11521)
* feat(cli): process `bundle > windows > wix > fragmentPaths` with Handlebars

closes #11520

* remove unneeded register_template_string

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

---------

Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
2024-11-05 14:46:54 -03:00
Amr Bashir
17c6952aec enhance(core): use diagnostic::on_unimplemented on rustc 1.78 and newer for async commands with references (#11522)
* enhance(core): use `diagnostic::on_unimplemented` on rustc 1.78 and newer for async commands with references

* change file

* clippy

* clippy

* add TODO
2024-11-05 14:20:30 -03:00
Amr Bashir
7af01ff2ce fix(cli): fix tauri migrate failing to install NPM deps when running from Deno (#11523)
* fix(cli): fix `tauri migrate` failing to install NPM deps when running from Deno

* clippy
2024-11-05 14:16:32 -03:00
Amr Bashir
100a4455aa fix(cli): fix yarn berry detection (#11529)
closes #11495
2024-11-05 14:15:48 -03:00
Amr Bashir
4191a7a53d fix(tray): build tray on main thread (#11583) 2024-11-05 17:42:08 +02:00
Amr Bashir
f37e97d410 feat: add use_https_scheme for Windows and Android (#11477)
* feat: add `use_https_scheme` for Windows and Android

closes #11252

* fix compilation

* Apply suggestions from code review

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

* change wording

* add migrations

* migrate `dangerousUseHttpScheme`

* fmt

* infer AssetResolver::get https scheme config

* fix tests

---------

Co-authored-by: Fabian-Lars <github@fabianlars.de>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2024-11-05 09:48:59 -03:00
Amr Bashir
058c0db72f feat(bundler): add option to configure RPM compression (#11584) 2024-11-05 14:08:08 +02:00
Mikkel Tønder
f8994b214e fix(event): handle AnyLabel listeners in emit_to (#11581)
closes #11561
2024-11-04 14:31:18 +02:00
Kornel
c33bbf4574 enhance: include the path in ACL I/O errors (#11575) 2024-11-04 14:30:43 +02:00
Amr Bashir
129414faa4 fix: fix webview not focused by default (#11569)
* fix: fix webview not focused by default

closes #10746

* fix compile

* typo

* fix compile again

* clippy
2024-11-04 13:58:47 +02:00
renovate[bot]
12ffc19ce0 chore(deps) Update Rust crate regex to v1.11.1 (#11542)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-30 12:19:31 +08:00
renovate[bot]
9f472591cc chore(deps) Update Rust crate serde to v1.0.214 (#11540)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-30 12:00:51 +08:00
Andrii Bodnar
d25dd9e31d docs: fix capability configuration examples (#11537) 2024-10-30 00:33:42 +03:00
Lucas Fernandes Nogueira
c43d5df158 feat(cli): associate newly created capability with the main window (#11512)
without this change the capability is not applied to any context and it might be hard for users to figure out why
2024-10-28 14:05:24 +03:00
Alex Adewole
1065f632f2 feat(cli): remove UNC path prefix in TAURI_APP_PATH and TAURI_FRONTEND_PATH (#11514) 2024-10-28 12:21:42 +03:00
Vincent Esche
ac22950f39 fix(cli): Fix mixup of TAURI_APP_PATH and TAURI_FRONTEND_PATH (#11492)
* Fix mixup of `env_tauri_app_path()` and `env_tauri_frontend_path()` in tauri's path resolutions

* Rename functions in `app_paths` to match their corresponding, publicly exposed env var keys

* Rename `app_dir`/`app_path` variables that deal with the frontend app's directory to `frontend_dir

* Rename `APP_DIR` to `FRONTEND_DIR`

* Improve comment on meaning of tauri path env vars
2024-10-27 17:55:23 -03:00
阿良仔
a8105eccb2 docs: fix wrongly rendered links on docs.rs (#11483) 2024-10-24 16:02:49 +03:00
renovate[bot]
888277ec40 chore(deps) Update Rust crate syn to v2.0.85 (#11472)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-24 13:23:24 +08:00
renovate[bot]
0014f9ae69 chore(deps) Update dependency @types/node to v20.17.0 (#11470)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-24 13:15:04 +08:00
Amr Bashir
8036c78e08 feat(core/path): add PathResolver::home_dir on Android (#11455)
ref: https://github.com/tauri-apps/tauri/issues/10478#issuecomment-2383754176
2024-10-24 06:43:02 +03:00
renovate[bot]
516c7d9f63 chore(deps) Update Rust crate syn to v2.0.83 (#11473)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-24 10:39:59 +08:00
Amr Bashir
54cbf59b5a fix(api/menu): fix submenus when created using an object in items field in the object passed to Menu/Submenu.new (#11441)
* fix(api/menu): fix submenus when created using an object in `items` field in the object passed to `Menu/Submenu.new`

closes #11435

also closes #11422 as I included the docs in this PR

* Update .changes/js-submenu-in-options.md

* Update packages/api/src/menu/base.ts

---------

Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
2024-10-23 10:47:32 -03:00
renovate[bot]
ce864cebfd chore(deps) Update Rust crate image to v0.25.4 (dev) (#11457)
* chore(deps) Update Rust crate image to v0.25.4

* Also bump json-patch and resvg

* Just json-patch for now

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tony <legendmastertony@gmail.com>
2024-10-23 17:46:59 +08:00
renovate[bot]
ed78f52cd1 chore(deps) Update Rust crate json-patch to v3 (#11466)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-23 17:25:16 +08:00
renovate[bot]
ccf20eb3ff chore(deps) Update Rust crate json-patch to v3 (#11467)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-23 17:25:08 +08:00
renovate[bot]
d0c1189b91 chore(deps) Update Tauri API Definitions (#11464)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-23 17:04:56 +08:00
renovate[bot]
0d31fe99c7 chore(deps) Update Rust crate thiserror to v1.0.65 (#11463)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-23 16:57:41 +08:00
renovate[bot]
d4b3659523 chore(deps) Update Rust crate proc-macro2 to v1.0.89 (#11459)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-23 16:25:22 +08:00
renovate[bot]
8e083c99c8 chore(deps) Update Tauri Build to v1.0.91 (#11456)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-23 12:25:08 +08:00
Amr Bashir
8c6d1e8e6c fix(runtime-wry): run cursor_position getter on main thread (#11401)
* fix(runtime-wry): run `cursor_position` getter on main thread

closes #10340

* clippy

* clippy

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2024-10-22 09:59:21 -03:00
Amr Bashir
6dea12a067 feat(bundler): add recommends for deb and rpm (#11402)
closes #10351
2024-10-21 15:38:14 -03:00
Amr Bashir
1f311832ab enhance(cli): add context to public/secret key decoding errors (#11405)
* enhance(cli): add context to public/secret key decoding errors

closes #10488

* Update .changes/cli-updater-errorr.md

---------

Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
2024-10-21 15:37:28 -03:00
Czxck001
e0d1307d3f feat(cli) Make tauri migrate update $schema in tauri.conf.json (#11414)
* Make `tauri migrate` update $schema in tauri.conf.json

* add change file

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2024-10-21 15:24:59 -03:00
Lucas Fernandes Nogueira
f0da0bde87 feat(core): add WebviewWindow::resolve_command_scope (#11439)
* feat(core): add WebviewWindow::resolve_command_scope

This new functionality exposes the `CommandScope` resolution as a function (currently only commands can resolve them as a dependency injection via CommandItem)

This function is useful to validate the configuration at runtime (do some asserts at setup phase to ensure capabilities are properly configured) and to resolve scopes in a separate thread or context

* adjust return type
2024-10-21 15:16:08 -03:00
Lucas Nogueira
a5bf48eab0 fix: CLI version on metadata file 2024-10-21 09:24:34 -03:00
Lucas Nogueira
7a1a3276c4 chore: bump tauri-utils dependency versions 2024-10-21 07:30:06 -03:00
Lucas Nogueira
8ca0e4dd2c chore(ci): bump tauri-utils with WiX version change 2024-10-20 11:13:40 -03:00
github-actions[bot]
1367ff5ec6 apply version updates (#11373)
Co-authored-by: lucasfernog <lucasfernog@users.noreply.github.com>
2024-10-20 10:29:13 -03:00
Lucas Fernandes Nogueira
fbb45c674c fix(api): broken addPluginListener implementation, closes #8068 (#11423) 2024-10-20 09:07:51 -03:00
Lucas Fernandes Nogueira
eb61d44f9f feat(core): fallback to Window and AppHandle resource table on close (#11398)
this changes the resource plugin close() API to fallback to the parent window and AppHandle resource tables, letting the JS to delete global resources.
The need for this was brought up on https://github.com/tauri-apps/plugins-workspace/pull/1860#issuecomment-2419175001
the store plugin stores the resources in the AppHandle, and we want the existing close() API to work on global resources otherwise every consumer needs their own resource close commands
2024-10-17 12:37:35 -03:00
Amr Bashir
c8f55b615d feat(bundler): add wix > version option (#11388)
* feat(bundler): add `wix > version` option

closes #11253

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

---------

Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
2024-10-17 12:37:15 -03:00
renovate[bot]
bd1b2a1e85 chore(deps) Update Tauri API Definitions (#10807)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-17 11:04:06 -03:00
renovate[bot]
37557ffa35 chore(deps) Update Tauri CLI (dev) (#10808)
* chore(deps) Update Tauri CLI

* html5ever 0.26

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2024-10-17 11:03:46 -03:00
Amr Bashir
6cd917c227 feat(core): add methods for predefined items with specific text on Menu/SubmenuBuilder (#11390)
closes #11326
2024-10-17 11:03:20 -03:00
renovate[bot]
8278a36318 chore(deps) Update Rust crate uuid to v1.11.0 (#11049)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2024-10-17 10:24:00 -03:00
renovate[bot]
f8b559dacd chore(deps) Update Rust crate windows-registry to 0.3.0 (#11193)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-17 10:23:30 -03:00
renovate[bot]
add09c8034 chore(deps) Update Rust crate brotli to v7 (#11195)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-17 10:21:30 -03:00
renovate[bot]
ea50f65f89 chore(deps) Update Rust crate brotli to v7 (#11197)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2024-10-17 10:07:20 -03:00
Huang Xin
e1bf6ef8cb fix(core): expose content-range header in asset protocol (#11374) 2024-10-17 08:41:27 -03:00
renovate[bot]
20c142f749 chore(deps) Update Rust crate json-patch to v3 (#11377)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-17 08:38:19 -03:00
Vincent Esche
e4c9268b19 feat(cli): make tauri/cli fully support projects with non-standard structure (#11258)
* feat(cli): add support for providing custom app/src paths to tauri's CLI via optional env vars

* fix tests

* rename env vars (app vs src is confusing)

* add change file

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2024-10-17 08:24:20 -03:00
Lucas Fernandes Nogueira
2e88633ba4 chore: remove references to unused __TAURI_INTERNALS__.metadata (#11369) 2024-10-15 13:26:43 -03:00
Lucas Nogueira
25cc5655c0 chore(ci): delete processed change file 2024-10-14 23:20:41 -03:00
github-actions[bot]
df83e5c7fc apply version updates (#11361)
Co-authored-by: lucasfernog <lucasfernog@users.noreply.github.com>
2024-10-14 22:46:51 -03:00
Lucas Fernandes Nogueira
3cb73d08c6 fix(core): mark event commands as async (#11355)
* fix(core): mark event commands as async

this fixes a deadlock on certain situations

* add tag
2024-10-14 22:44:22 -03:00
Lucas Fernandes Nogueira
ef2482ddec fix(core): crash on macOS older than Sequoia (#11366)
ref https://github.com/tauri-apps/wry/pull/1389
2024-10-14 21:55:42 -03:00
Lucas Fernandes Nogueira
e3b09be7f0 feat(core): add channel interceptor API (#11362) 2024-10-14 19:48:22 -03:00
Amr Bashir
bcf279278d feat(core): add ContextMenu::hpopupmenu on Windows (#11354)
* feat(core): add `ContextMenu::hpopupmenu` on Windows

closes #11339

* Update crates/tauri/src/menu/mod.rs

---------

Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
2024-10-14 13:46:21 -03:00
Kartonrad
68d4460361 docs(android): warn users that passing raw bytes over ipc is not possible on android (#11333)
* Warn that android is not supported

* Warn that Android is not supported.

* Update crates/tauri/src/ipc/mod.rs

---------

Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
2024-10-14 13:19:46 -03:00
Amr Bashir
f3f521f038 fix(core): fallback to WRY_ANDROID_PACKAGE with backticks replaced (#11348)
ref: https://github.com/tauri-apps/tauri/issues/11332
2024-10-14 13:15:15 -03:00
renovate[bot]
e75f0d27ef chore(deps) Update Rust crate proc-macro2 to v1.0.87 (#11192)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-13 22:44:29 +08:00
Paul
e63432fbfc docs: fix "Capability" documentation example (#11337) 2024-10-13 13:23:58 +02:00
Lucas Fernandes Nogueira
627e90c304 fix(ci): install librsvg2-dev on the publish cli workflow (#11331) 2024-10-12 17:57:18 -03:00
github-actions[bot]
1bfe2485bb Apply Version Updates From Current Changes (#11255)
* apply version updates

* tauri 2.0.3 (patch bump)

---------

Co-authored-by: lucasfernog <lucasfernog@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2024-10-12 12:28:16 -03:00
Lucas Fernandes Nogueira
4a2d51a73a fix(ci): add missing librsvg2-dev dependency for e2e tests (#11329) 2024-10-12 11:27:33 -03:00
Lucas Fernandes Nogueira
6a768cb679 fix(cli): verbose output on tests (#11328) 2024-10-12 10:58:42 -03:00
Lucas Fernandes Nogueira
e55bd4ba7a fix(api): docs for core module __TAURI__ usage (#11324) 2024-10-12 16:32:54 +03:00
Amr Bashir
61bffa4feb fix(bundler): match on Path::extension instead of using Path::ends_with (#11327) 2024-10-12 10:31:11 -03:00
Amr Bashir
2d087ee4b7 fix: fix incorrect label passed to ipc protocol (#11268)
* fix: fix incorrect label passed to `ipc` protocol

closes #11171

* update lock file

* Update .changes/incorrect-label-linux-command.md

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

* Update .changes/incorrect-label-linux-protocol.md

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

* clippy

* try wry from dev

* fix macos build

* fix ios build

* update wry

* Update .changes/incorrect-label-linux-command.md

* wry 0.46

---------

Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
2024-10-12 07:46:51 -03:00
Amr Bashir
069c05e44f fix(cli): resolve bundle > icon glob when searching for .ico for MSI installer (#11315)
* fix(cli): resolve `bundle > icon` glob when searching for `.ico` for MSI installer

closes #11220

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

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

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

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

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

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

---------

Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
2024-10-11 23:23:55 -03:00
Amr Bashir
b3563e3d6a feat(cli): add deno support (#11304)
* feat(cli): add deno support

ref: https://github.com/denoland/deno/issues/20738

* Update packages_nodejs.rs

* typo

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2024-10-11 16:48:22 -03:00
Amr Bashir
d609bef9fd fix(cli & core): use unescaped package id in proguard file (#11314)
* fix(cli & core): use unescaped package id in proguard file

closes #11310

* add monkey patch for wry proguard

* fix tests

* typo

* remove wry fix

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2024-10-11 16:17:29 -03:00
Lucas Fernandes Nogueira
4731f0cf31 fix(core): expose ipc::Invoke (#11290) 2024-10-11 08:52:50 -03:00
Lucas Fernandes Nogueira
504bb8ec8c fix(bundler): enhance DMG creation script (#11287) 2024-10-11 08:52:19 -03:00
Amr Bashir
1d3f51e100 feat: add back tauri::Builder::on_menu_event (#11228)
* feat: add back `tauri::Builder::on_menu_event`

* fix build

* fix build and fmt

* fix mobile
2024-10-09 11:09:42 -03:00
Huang Xin
04fd3a7db5 fix(core): return empty body for HEAD requests to asset protocol, closes #11263 (#11264) 2024-10-08 04:07:42 +03:00
Alex Sandri
eda5713eab feat(bundler/nsis): add Italian language (#11242) 2024-10-07 19:56:14 +03:00
Lucas Fernandes Nogueira
3e9fd0665c fix: npm audit (#11243)
the audit failed, so the 2.0.2 release is failing. I'm also adding the latest merged change to the 2.0.2 release in this change so we're in sync in the changelog.
2024-10-07 19:23:28 +03:00
Amr Bashir
a49a19ffa3 fix(bundler): wrap Exec in desktop with quotes, rename appimage main binary if has spaces (#11218)
* fix(bundler): wrap `Exec` in desktop with quotes, rename appimage main binary if has spaces

* Update .changes/main-binary-name-spaces-linux.md [skip ci[

---------

Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
2024-10-06 14:08:38 -03:00
github-actions[bot]
9102faa4b3 apply version updates (#11209)
Co-authored-by: lucasfernog <lucasfernog@users.noreply.github.com>
2024-10-06 08:41:18 -03:00
Lucas Fernandes Nogueira
03e7590429 feat(core): expose invoke key for custom IPC implementations (#11235)
custom IPC systems that manually call Webview::on_message must know the invoke key checked by Tauri. This exposes that key in the App/AppHandle instances.

This is safe because the key is never leaked to remote denied webview URLs
2024-10-06 07:36:00 -03:00
Hamir Mahal
e2a4da027c fix: usage of node12 which is deprecated (#11224) 2024-10-05 13:22:18 -03:00
Lucas Fernandes Nogueira
e968b3d252 fix(api): actually publish with the latest tag (#11219)
we missed one `--tag next` usage in #11199
2024-10-04 10:13:57 -03:00
Krishna Chaitanya
858b3516a0 fix(windows): fix command bug in update elevated task (fix #11216) (#11217) 2024-10-04 10:01:48 +03:00
Lucas Fernandes Nogueira
4475fbb502 chore(cli): update cargo-mobile2 to adjust lib name validation (#11208) 2024-10-03 13:46:49 -03:00
github-actions[bot]
6d98f2462b apply version updates (#11207)
Co-authored-by: tweidinger <tweidinger@users.noreply.github.com>
2024-10-03 09:01:02 -03:00
429 changed files with 28682 additions and 12554 deletions

View File

@@ -4,7 +4,7 @@
"feat": "New Features",
"enhance": "Enhancements",
"bug": "Bug Fixes",
"pref": "Performance Improvements",
"perf": "Performance Improvements",
"changes": "What's Changed",
"sec": "Security fixes",
"deps": "Dependencies",

View File

@@ -1,16 +0,0 @@
---
"tauri": patch:changes
"tauri-utils": patch:changes
"tauri-runtime": patch:changes
"tauri-runtime-wry": patch:changes
"tauri-codegen": patch:changes
"tauri-macros": patch:changes
"tauri-plugin": patch:changes
"tauri-build": patch:changes
"tauri-cli": patch:changes
"tauri-macos-sign": patch:changes
"tauri-bundler": patch:changes
"tauri-driver": patch:changes
---
Downgrade MSRV to 1.77.2 to support Windows.

View File

@@ -51,25 +51,47 @@ 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
@@ -81,7 +103,8 @@ $ RUSTDOCFLAGS="--cfg docsrs" 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.
## 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

@@ -34,7 +34,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: 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,7 +46,7 @@ jobs:
if: needs.changes.outputs.api == 'true'
steps:
- uses: actions/checkout@v4
- run: corepack enable
- run: npm i -g --force corepack
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'

View File

@@ -23,7 +23,7 @@ jobs:
with:
fetch-depth: 0
- run: corepack enable
- run: npm i -g --force corepack
- uses: actions/setup-node@v4
with:
node-version: 20
@@ -36,7 +36,7 @@ jobs:
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y webkit2gtk-4.1 libayatana-appindicator3-dev libfuse2
sudo apt-get install -y webkit2gtk-4.1 libayatana-appindicator3-dev libfuse2 librsvg2-dev
- uses: Swatinem/rust-cache@v2
@@ -73,7 +73,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: corepack enable
- run: npm i -g --force corepack
- uses: actions/setup-node@v4
with:
node-version: 20
@@ -90,7 +90,7 @@ jobs:
- name: install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y webkit2gtk-4.1 libayatana-appindicator3-dev
sudo apt-get install -y webkit2gtk-4.1 libayatana-appindicator3-dev librsvg2-dev
- name: covector version or publish (publish when no change files present)
uses: jbolda/covector/packages/action@covector-v0
@@ -111,7 +111,7 @@ jobs:
- name: Create Pull Request With Versions Bumped
if: steps.covector.outputs.commandRan == 'version'
uses: tauri-apps/create-pull-request@v3
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # 7.0.6
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: release/version-updates
@@ -119,12 +119,13 @@ jobs:
commit-message: 'apply version updates'
labels: 'version updates'
body: ${{ steps.covector.outputs.change }}
sign-commits: true
- name: Trigger doc update
if: |
steps.covector.outputs.successfulPublish == 'true' &&
steps.covector.outputs.packagesPublished != ''
uses: peter-evans/repository-dispatch@v1
uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # 3.0.0
with:
token: ${{ secrets.ORG_TAURI_BOT_PAT }}
repository: tauri-apps/tauri-docs

View File

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

View File

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

View File

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

@@ -43,15 +43,16 @@ jobs:
- host: windows-latest
architecture: x64
target: aarch64-pc-windows-msvc
build: pnpm build --target aarch64-pc-windows-msvc --features native-tls-vendored --cargo-flags="--no-default-features"
- host: ubuntu-20.04
build: pnpm build --target aarch64-pc-windows-msvc
- 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
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: |
@@ -63,14 +64,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
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: |
@@ -79,7 +81,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
@@ -88,11 +90,20 @@ jobs:
rustup target add aarch64-unknown-linux-musl
pnpm build --target aarch64-unknown-linux-musl
/aarch64-linux-musl-cross/bin/aarch64-linux-musl-strip *.node
- host: ubuntu-22.04
architecture: x64
target: riscv64gc-unknown-linux-gnu
setup: |
sudo apt-get update
sudo apt-get install gcc-riscv64-linux-gnu g++-riscv64-linux-gnu -y
build: |
pnpm build --target=riscv64gc-unknown-linux-gnu
riscv64-linux-gnu-strip *.node
name: stable - ${{ matrix.settings.target }} - node@20
runs-on: ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@v4
- run: corepack enable
- run: npm i -g --force corepack
- name: Setup node
uses: actions/setup-node@v4
if: ${{ !matrix.settings.docker }}
@@ -108,7 +119,6 @@ jobs:
- uses: Swatinem/rust-cache@v1
with:
key: ${{ matrix.settings.target }}
working-directory: 'crates/tauri-cli/'
if: ${{ matrix.settings.docker }}
- name: Setup toolchain
run: ${{ matrix.settings.setup }}
@@ -203,7 +213,7 @@ jobs:
runs-on: ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@v4
- run: corepack enable
- run: npm i -g --force corepack
- name: Setup node
uses: actions/setup-node@v4
with:
@@ -234,7 +244,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: corepack enable
- run: npm i -g --force corepack
- name: Setup node
uses: actions/setup-node@v4
with:
@@ -253,7 +263,7 @@ jobs:
- name: install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y webkit2gtk-4.1 libayatana-appindicator3-dev
sudo apt-get install -y webkit2gtk-4.1 libayatana-appindicator3-dev librsvg2-dev
- name: Test bindings
run: pnpm test
test-linux-x64-musl-binding:
@@ -271,7 +281,7 @@ jobs:
image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
steps:
- uses: actions/checkout@v4
- run: corepack enable
- run: npm i -g --force corepack
- name: Setup node
uses: actions/setup-node@v4
with:
@@ -309,7 +319,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
@@ -362,7 +371,7 @@ jobs:
id-token: write # npm provenance
steps:
- uses: actions/checkout@v4
- run: corepack enable
- run: npm i -g --force corepack
- name: Setup node
uses: actions/setup-node@v4
with:

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: ''
@@ -37,7 +37,7 @@ jobs:
- os: windows-latest
rust_target: aarch64-pc-windows-msvc
ext: '.exe'
args: '--no-default-features --features native-tls-vendored'
args: ''
steps:
- uses: actions/checkout@v4

View File

@@ -25,7 +25,7 @@ jobs:
- name: Install Rust
run: rustup update stable && rustup default stable
- uses: actions/cache@v2
- uses: actions/cache@v4
with:
path: ${{ runner.tool_cache }}/cargo-vet
key: cargo-vet-bin-${{ env.CARGO_VET_VERSION }}

View File

@@ -33,8 +33,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: install Rust 1.77.2
uses: dtolnay/rust-toolchain@1.77.2
- name: install Linux dependencies
if: matrix.platform == 'ubuntu-latest'
@@ -42,7 +42,7 @@ jobs:
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.1
- run: corepack enable
- run: npm i -g --force corepack
- name: setup node
uses: actions/setup-node@v4
with:

View File

@@ -11,6 +11,7 @@ on:
pull_request:
paths:
- '.github/workflows/test-cli-js.yml'
- 'packages/cli/**'
# currently` @tauri-apps/cli` only tests the template
- 'crates/tauri-cli/templates/app/**'
@@ -37,7 +38,7 @@ jobs:
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
- run: corepack enable
- run: npm i -g --force corepack
- name: setup node
uses: actions/setup-node@v4
with:
@@ -48,7 +49,7 @@ jobs:
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y webkit2gtk-4.1 libayatana-appindicator3-dev
sudo apt-get install -y webkit2gtk-4.1 libayatana-appindicator3-dev librsvg2-dev
- uses: Swatinem/rust-cache@v2

View File

@@ -44,7 +44,7 @@ jobs:
- uses: actions/checkout@v4
- name: 'Setup Rust'
uses: dtolnay/rust-toolchain@stable
uses: dtolnay/rust-toolchain@1.77.2
with:
targets: ${{ matrix.platform.target }}
@@ -52,7 +52,7 @@ jobs:
if: matrix.platform.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.1 libayatana-appindicator3-dev
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.1 libayatana-appindicator3-dev librsvg2-dev
- uses: Swatinem/rust-cache@v2

View File

@@ -88,19 +88,9 @@ jobs:
sudo apt-get update
sudo apt-get install -y webkit2gtk-4.1 libxdo-dev libayatana-appindicator3-dev
- name: downgrade crates with MSRV conflict
run: |
cargo update -p ravif --precise 0.11.5
cargo update -p aws-config --precise 1.5.5
cargo update -p aws-sdk-ssooidc --precise 1.40.0
cargo update -p aws-sdk-s3 --precise 1.46.0
cargo update -p aws-sdk-sts --precise 1.39.0
cargo update -p aws-sdk-sso --precise 1.39.0
cargo update -p bitstream-io --precise 2.3.0
- uses: Swatinem/rust-cache@v2
with:
prefix-key: v2
prefix-key: v3
save-if: ${{ matrix.features.key == 'all' }}
- name: test
@@ -110,5 +100,5 @@ jobs:
- name: test (using cross)
if: ${{ matrix.platform.cross }}
run: |
cargo install cross --git https://github.com/cross-rs/cross --rev ac4c11cedc97cd7c27faed36e55377a90e6ed618 --locked
cargo install cross --git https://github.com/cross-rs/cross --rev 51f46f296253d8122c927c5bb933e3c4f27cc317 --locked
cross ${{ matrix.platform.command }} --target ${{ matrix.platform.target }} ${{ matrix.features.args }} --manifest-path crates/tauri/Cargo.toml

107
.gitignore vendored
View File

@@ -1,52 +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
# 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

@@ -1,5 +1,6 @@
{
"singleQuote": true,
"semi": false,
"trailingComma": "none"
"trailingComma": "none",
"experimentalOperatorPosition": "start"
}

View File

@@ -28,8 +28,8 @@ const ignore = [
async function checkFile(file) {
if (
extensions.some((e) => file.endsWith(e)) &&
!ignore.some((i) => file.includes(`/${i}/`) || path.basename(file) == i)
extensions.some((e) => file.endsWith(e))
&& !ignore.some((i) => file.includes(`/${i}/`) || path.basename(file) == i)
) {
const fileStream = fs.createReadStream(file)
const rl = readline.createInterface({
@@ -42,11 +42,11 @@ async function checkFile(file) {
for await (let line of rl) {
// ignore empty lines, allow shebang and bundler license
if (
line.length === 0 ||
line.startsWith('#!') ||
line.startsWith('// swift-tools-version:') ||
line === bundlerLicense ||
line === denoLicense
line.length === 0
|| line.startsWith('#!')
|| line.startsWith('// swift-tools-version:')
|| line === bundlerLicense
|| line === denoLicense
) {
continue
}

4377
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -70,3 +70,4 @@ opt-level = "s"
[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" }

View File

@@ -6,7 +6,7 @@ PackageSupplier: Organization: The Tauri Programme in the Commons Conservancy
PackageHomePage: https://tauri.app
PackageLicenseDeclared: Apache-2.0
PackageLicenseDeclared: MIT
PackageCopyrightText: 2019-2024, The Tauri Programme in the Commons Conservancy
PackageCopyrightText: 2019-2025, The Tauri Programme in the Commons Conservancy
PackageSummary: <text>Tauri is a rust project that enables developers to make secure
and small desktop applications using a web frontend.
</text>

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)
@@ -35,7 +35,7 @@ The list of Tauri's features includes, but is not limited to:
- Built-in self updater (desktop only)
- System tray icons
- Native notifications
- [Localhost free (🔥)](https://github.com/tauri-apps/tauri/issues/10510)
- Native WebView Protocol (tauri doesn't create a localhost http(s) server to serve the WebView contents)
- GitHub action for streamlined CI
- VS Code extension
@@ -43,13 +43,13 @@ The list of Tauri's features includes, but is not limited to:
Tauri currently supports development and distribution on the following platforms:
| Platform | Versions |
| :---------------- | :-------------------------------------------------------------------------------------------------------------- |
| Windows | 7 and above |
| macOS | 10.15 and above |
| Linux | webkit2gtk 4.0 for Tauri v1 (for example Ubuntu 18.04). webkit2gtk 4.1 for Tauri v2 (for example Ubuntu 22.04). |
| iOS/iPadOS (beta) | 9 and above |
| Android (beta) | 7 and above |
| Platform | Versions |
| :--------- | :-------------------------------------------------------------------------------------------------------------- |
| Windows | 7 and above |
| macOS | 10.15 and above |
| Linux | webkit2gtk 4.0 for Tauri v1 (for example Ubuntu 18.04). webkit2gtk 4.1 for Tauri v2 (for example Ubuntu 22.04). |
| iOS/iPadOS | 9 and above |
| Android | 7 and above (currently 8 and above) |
## Contributing

View File

@@ -9,11 +9,11 @@ description = "Cross-platform WebView rendering library"
repository = "https://github.com/tauri-apps/wry"
[dependencies]
anyhow = "1.0.40"
anyhow = "1"
time = { version = "0.3", features = ["formatting"] }
tempfile = "3.2.0"
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tempfile = "3"
serde_json = "1"
serde = { version = "1", features = ["derive"] }
[[bin]]
name = "run_benchmark"

View File

@@ -2,8 +2,6 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
//! [![](https://github.com/tauri-apps/tauri/raw/dev/.github/splash.png)](https://tauri.app)
//!
//! 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_**
@@ -54,7 +52,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
@@ -62,5 +60,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,8 +2,6 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
//! [![](https://github.com/tauri-apps/tauri/raw/dev/.github/splash.png)](https://tauri.app)
//!
//! 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_**
@@ -91,7 +89,7 @@ fn run_max_mem_benchmark() -> 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 = utils::target_dir().join(format!("mprof{name}_.dat"));
let benchmark_file = benchmark_file.to_str().unwrap();
let proc = Command::new("mprof")
@@ -107,7 +105,7 @@ fn run_max_mem_benchmark() -> Result<HashMap<String, u64>> {
.spawn()?;
let proc_result = proc.wait_with_output()?;
println!("{:?}", proc_result);
println!("{proc_result:?}");
results.insert(
name.to_string(),
utils::parse_max_mem(benchmark_file).unwrap(),
@@ -128,11 +126,11 @@ fn rlib_size(target_dir: &std::path::Path, prefix: &str) -> u64 {
if name.starts_with(prefix) && name.ends_with(".rlib") {
let start = name.split('-').next().unwrap().to_string();
if seen.contains(&start) {
println!("skip {}", name);
println!("skip {name}");
} else {
seen.insert(start);
size += entry.metadata().unwrap().len();
println!("check size {} {}", name, size);
println!("check size {name} {size}");
}
}
}
@@ -144,7 +142,7 @@ fn get_binary_sizes(target_dir: &Path) -> Result<HashMap<String, u64>> {
let mut sizes = HashMap::<String, u64>::new();
let wry_size = rlib_size(target_dir, "libwry");
println!("wry {} bytes", wry_size);
println!("wry {wry_size} bytes");
sizes.insert("wry_rlib".to_string(), wry_size);
// add size for all EXEC_TIME_BENCHMARKS

View File

@@ -96,8 +96,8 @@ pub fn run_collect(cmd: &[&str]) -> (String, String) {
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);
eprintln!("stdout: <<<{stdout}>>>");
eprintln!("stderr: <<<{stderr}>>>");
panic!("Unexpected exit code: {:?}", status.code());
}
(stdout, stderr)
@@ -230,7 +230,7 @@ pub fn download_file(url: &str, filename: PathBuf) {
// 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")

View File

@@ -1,6 +1,7 @@
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica,
Arial, sans-serif;
font-family:
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial,
sans-serif;
margin: auto;
max-width: 38rem;
padding: 2rem;

View File

@@ -11,6 +11,6 @@ tauri-build = { path = "../../../../crates/tauri-build", features = [
] }
[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1"
serde = { version = "1", features = ["derive"] }
tauri = { path = "../../../../crates/tauri", features = [] }

View File

@@ -11,6 +11,6 @@ tauri-build = { path = "../../../../crates/tauri-build", features = [
] }
[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1"
serde = { version = "1", features = ["derive"] }
tauri = { path = "../../../../crates/tauri", features = [] }

View File

@@ -18,7 +18,7 @@ async fn read_file<R: Runtime>(app: AppHandle<R>) -> Result<Response, String> {
.path()
.resolve(".tauri_3mb.json", BaseDirectory::Home)
.map_err(|e| e.to_string())?;
let contents = read(&path).map_err(|e| e.to_string())?;
let contents = read(path).map_err(|e| e.to_string())?;
Ok(Response::new(contents))
}

View File

@@ -11,6 +11,6 @@ tauri-build = { path = "../../../../crates/tauri-build", features = [
] }
[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1"
serde = { version = "1", features = ["derive"] }
tauri = { path = "../../../../crates/tauri", features = [] }

View File

@@ -1,5 +1,94 @@
# Changelog
## \[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
- [`013f8f652`](https://www.github.com/tauri-apps/tauri/commit/013f8f652302f2d49c5ec0a075582033d8b074fb) ([#12890](https://www.github.com/tauri-apps/tauri/pull/12890) by [@Legend-Master](https://www.github.com/tauri-apps/tauri/../../Legend-Master)) Added `build > removeUnusedCommands` to trigger the build scripts and macros to remove unused commands based on the capabilities you defined. Note this won't be accounting for dynamically added ACLs so make sure to check it when using this.
### Performance Improvements
- [`1cd8f55ee`](https://www.github.com/tauri-apps/tauri/commit/1cd8f55eed326d61860fee62ba2d2f4464bdcfcc) ([#13033](https://www.github.com/tauri-apps/tauri/pull/13033) by [@Legend-Master](https://www.github.com/tauri-apps/tauri/../../Legend-Master)) Don't ship global `bundle.global.js` if `app > withGlobalTauri` is set to false
### Dependencies
- Upgraded to `tauri-utils@2.3.0`
- Upgraded to `tauri-codegen@2.1.0`
## \[2.0.6]
### Dependencies
- Upgraded to `tauri-utils@2.2.0`
- Upgraded to `tauri-codegen@2.0.5`
## \[2.0.5]
### Bug Fixes
- [`848d0e060`](https://www.github.com/tauri-apps/tauri/commit/848d0e060e6eb3c8e9e8175adc7896587b5a947d) ([#12270](https://www.github.com/tauri-apps/tauri/pull/12270) by [@aurelj](https://www.github.com/tauri-apps/tauri/../../aurelj)) Update `cargo_toml` to `0.21.0`. This adds compatibility with Rust's 2024 Edition.
- [`cd1d026f9`](https://www.github.com/tauri-apps/tauri/commit/cd1d026f9799c26b04acb64f49e7ee0a8b193049) ([#11961](https://www.github.com/tauri-apps/tauri/pull/11961) by [@Legend-Master](https://www.github.com/tauri-apps/tauri/../../Legend-Master)) Fix tauri fails to build if the project path contains glob characters
## \[2.0.4]
### Dependencies
- Upgraded to `tauri-utils@2.1.1`
- Upgraded to `tauri-codegen@2.0.4`
## \[2.0.3]
### Dependencies
- Upgraded to `tauri-utils@2.1.0`
- Upgraded to `tauri-codegen@2.0.3`
## \[2.0.2]
### Dependencies
- Upgraded to `tauri-utils@2.0.2`
## \[2.0.1]
### What's Changed
- [`0ab2b3306`](https://www.github.com/tauri-apps/tauri/commit/0ab2b330644b6419f6cee1d5377bfb5cdda2ccf9) ([#11205](https://www.github.com/tauri-apps/tauri/pull/11205) by [@lucasfernog](https://www.github.com/tauri-apps/tauri/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
### Dependencies
- Upgraded to `tauri-utils@2.0.1`
- Upgraded to `tauri-codegen@2.0.1`
## \[2.0.0]
### What's Changed

View File

@@ -1,6 +1,6 @@
[package]
name = "tauri-build"
version = "2.0.0"
version = "2.3.1"
description = "build time code to pair with https://crates.io/crates/tauri"
exclude = ["CHANGELOG.md", "/target"]
readme = "README.md"
@@ -28,23 +28,24 @@ rustdoc-args = ["--cfg", "docsrs"]
[dependencies]
anyhow = "1"
quote = { version = "1", optional = true }
tauri-codegen = { version = "2.0.0", path = "../tauri-codegen", optional = true }
tauri-utils = { version = "2.0.0", path = "../tauri-utils", features = [
tauri-codegen = { version = "2.3.1", path = "../tauri-codegen", optional = true }
tauri-utils = { version = "2.6.0", path = "../tauri-utils", features = [
"build",
"resources",
] }
cargo_toml = "0.17"
cargo_toml = "0.22"
serde = "1"
serde_json = "1"
heck = "0.5"
json-patch = "2.0"
json-patch = "3"
walkdir = "2"
tauri-winres = "0.1"
tauri-winres = "0.3"
semver = "1"
dirs = "5"
dirs = "6"
glob = "0.3"
toml = "0.8"
schemars = { version = "0.8.18", features = ["preserve_order"] }
# Our code requires at least 0.8.21 so don't simplify this to 0.8
schemars = { version = "0.8.21", features = ["preserve_order"] }
[features]
default = ["config-json"]

View File

@@ -11,7 +11,9 @@ use std::{
use anyhow::{Context, Result};
use tauri_utils::{
acl::{
capability::Capability, manifest::Manifest, schema::CAPABILITIES_SCHEMA_FOLDER_PATH,
capability::Capability,
manifest::{Manifest, PermissionFile},
schema::CAPABILITIES_SCHEMA_FOLDER_PATH,
ACL_MANIFESTS_FILE_NAME, APP_ACL_KEY, CAPABILITIES_FILE_NAME,
},
platform::Target,
@@ -155,11 +157,17 @@ fn read_plugins_manifests() -> Result<BTreeMap<String, Manifest>> {
Ok(manifests)
}
struct InlinedPuginsAcl {
manifests: BTreeMap<String, Manifest>,
permission_files: BTreeMap<String, Vec<PermissionFile>>,
}
fn inline_plugins(
out_dir: &Path,
inlined_plugins: HashMap<&'static str, InlinedPlugin>,
) -> Result<BTreeMap<String, Manifest>> {
) -> Result<InlinedPuginsAcl> {
let mut acl_manifests = BTreeMap::new();
let mut permission_files_map = BTreeMap::new();
for (name, plugin) in inlined_plugins {
let plugin_out_dir = out_dir.join("plugins").join(name);
@@ -199,7 +207,9 @@ permissions = [{default_permissions}]
}
tauri_utils::acl::build::define_permissions(
&plugin_out_dir.join("*").to_string_lossy(),
&PathBuf::from(glob::Pattern::escape(&plugin_out_dir.to_string_lossy()))
.join("*")
.to_string_lossy(),
name,
&plugin_out_dir,
|_| true,
@@ -222,28 +232,41 @@ permissions = [{default_permissions}]
);
}
permission_files.extend(tauri_utils::acl::build::define_permissions(
&default_permissions_path
.join("**")
.join("*")
.to_string_lossy(),
&PathBuf::from(glob::Pattern::escape(
&default_permissions_path.to_string_lossy(),
))
.join("**")
.join("*")
.to_string_lossy(),
name,
&plugin_out_dir,
|_| true,
)?);
}
permission_files_map.insert(name.into(), permission_files.clone());
let manifest = tauri_utils::acl::manifest::Manifest::new(permission_files, None);
acl_manifests.insert(name.into(), manifest);
}
Ok(acl_manifests)
Ok(InlinedPuginsAcl {
manifests: acl_manifests,
permission_files: permission_files_map,
})
}
#[derive(Debug)]
struct AppManifestAcl {
manifest: Manifest,
permission_files: Vec<PermissionFile>,
}
fn app_manifest_permissions(
out_dir: &Path,
manifest: AppManifest,
inlined_plugins: &HashMap<&'static str, InlinedPlugin>,
) -> Result<Manifest> {
) -> Result<AppManifestAcl> {
let app_out_dir = out_dir.join("app-manifest");
fs::create_dir_all(&app_out_dir)?;
let pkg_name = "__app__";
@@ -286,6 +309,7 @@ fn app_manifest_permissions(
let inlined_plugins_permissions: Vec<_> = inlined_plugins
.keys()
.map(|name| permissions_root.join(name))
.flat_map(|p| p.canonicalize())
.collect();
permission_files.extend(tauri_utils::acl::build::define_permissions(
@@ -304,10 +328,10 @@ fn app_manifest_permissions(
)?);
}
Ok(tauri_utils::acl::manifest::Manifest::new(
permission_files,
None,
))
Ok(AppManifestAcl {
permission_files: permission_files.clone(),
manifest: tauri_utils::acl::manifest::Manifest::new(permission_files, None),
})
}
fn validate_capabilities(
@@ -376,19 +400,21 @@ fn validate_capabilities(
pub fn build(out_dir: &Path, target: Target, attributes: &Attributes) -> super::Result<()> {
let mut acl_manifests = read_plugins_manifests()?;
let app_manifest = app_manifest_permissions(
let app_acl = app_manifest_permissions(
out_dir,
attributes.app_manifest,
&attributes.inlined_plugins,
)?;
if app_manifest.default_permission.is_some()
|| !app_manifest.permission_sets.is_empty()
|| !app_manifest.permissions.is_empty()
{
acl_manifests.insert(APP_ACL_KEY.into(), app_manifest);
let has_app_manifest = app_acl.manifest.default_permission.is_some()
|| !app_acl.manifest.permission_sets.is_empty()
|| !app_acl.manifest.permissions.is_empty();
if has_app_manifest {
acl_manifests.insert(APP_ACL_KEY.into(), app_acl.manifest);
}
acl_manifests.extend(inline_plugins(out_dir, attributes.inlined_plugins.clone())?);
let inline_plugins_acl = inline_plugins(out_dir, attributes.inlined_plugins.clone())?;
acl_manifests.extend(inline_plugins_acl.manifests);
let acl_manifests_path = save_acl_manifests(&acl_manifests)?;
fs::copy(acl_manifests_path, out_dir.join(ACL_MANIFESTS_FILE_NAME))?;
@@ -406,7 +432,12 @@ pub fn build(out_dir: &Path, target: Target, attributes: &Attributes) -> super::
let capabilities_path = save_capabilities(&capabilities)?;
fs::copy(capabilities_path, out_dir.join(CAPABILITIES_FILE_NAME))?;
tauri_utils::plugin::save_global_api_scripts_paths(out_dir);
let mut permissions_map = inline_plugins_acl.permission_files;
if has_app_manifest {
permissions_map.insert(APP_ACL_KEY.to_string(), app_acl.permission_files);
}
tauri_utils::acl::build::generate_allowed_commands(out_dir, Some(capabilities), permissions_map)?;
Ok(())
}

View File

@@ -2,8 +2,6 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
//! [![](https://github.com/tauri-apps/tauri/raw/dev/.github/splash.png)](https://tauri.app)
//!
//! This applies the macros at build-time in order to rig some special features needed by `cargo`.
#![doc(
@@ -70,7 +68,7 @@ fn copy_binaries(
.to_string_lossy()
.replace(&format!("-{target_triple}"), "");
if package_name.map_or(false, |n| n == &file_name) {
if package_name == Some(&file_name) {
return Err(anyhow::anyhow!(
"Cannot define a sidecar with the same name as the Cargo package name `{}`. Please change the sidecar name in the filesystem and the Tauri configuration.",
file_name
@@ -369,6 +367,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
@@ -421,23 +421,26 @@ pub fn is_dev() -> bool {
/// Run all build time helpers for your Tauri Application.
///
/// The current helpers include the following:
/// * Generates a Windows Resource file when targeting Windows.
/// To provide extra configuration, such as [`AppManifest::commands`]
/// for fine-grained control over command permissions, see [`try_build`].
/// See [`Attributes`] for the complete list of configuration options.
///
/// # Platforms
///
/// [`build()`] should be called inside of `build.rs` regardless of the platform:
/// * New helpers may target more platforms in the future.
/// * Platform specific code is handled by the helpers automatically.
/// * A build script is required in order to activate some cargo environmental variables that are
/// used when generating code and embedding assets - so [`build()`] may as well be called.
/// [`build()`] should be called inside of `build.rs` regardless of the platform, so **DO NOT** use a [conditional compilation]
/// check that prevents it from running on any of your targets.
///
/// In short, this is saying don't put the call to [`build()`] behind a `#[cfg(windows)]`.
/// Platform specific code is handled by the helpers automatically.
///
/// A build script is required in order to activate some cargo environmental variables that are
/// used when generating code and embedding assets.
///
/// # Panics
///
/// If any of the build time helpers fail, they will [`std::panic!`] with the related error message.
/// This is typically desirable when running inside a build script; see [`try_build`] for no panics.
///
/// [conditional compilation]: https://web.mit.edu/rust-lang_v1.25/arch/amd64_ubuntu1404/share/doc/rust/html/book/first-edition/conditional-compilation.html
pub fn build() {
if let Err(error) = try_build(Attributes::default()) {
let error = format!("{error:#}");
@@ -452,18 +455,12 @@ pub fn build() {
}
}
/// Non-panicking [`build()`].
/// Same as [`build()`], but takes an extra configuration argument, and does not panic.
#[allow(unused_variables)]
pub fn try_build(attributes: Attributes) -> Result<()> {
use anyhow::anyhow;
println!("cargo:rerun-if-env-changed=TAURI_CONFIG");
#[cfg(feature = "config-json")]
println!("cargo:rerun-if-changed=tauri.conf.json");
#[cfg(feature = "config-json5")]
println!("cargo:rerun-if-changed=tauri.conf.json5");
#[cfg(feature = "config-toml")]
println!("cargo:rerun-if-changed=Tauri.toml");
let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap();
let mobile = target_os == "ios" || target_os == "android";
@@ -473,12 +470,11 @@ pub fn try_build(attributes: Attributes) -> Result<()> {
let target_triple = env::var("TARGET").unwrap();
let target = tauri_utils::platform::Target::from_triple(&target_triple);
let (config, merged_config_path) =
tauri_utils::config::parse::read_from(target, env::current_dir().unwrap())?;
if let Some(merged_config_path) = merged_config_path {
println!("cargo:rerun-if-changed={}", merged_config_path.display());
let (mut config, config_paths) =
tauri_utils::config::parse::read_from(target, &env::current_dir().unwrap())?;
for config_file_path in config_paths {
println!("cargo:rerun-if-changed={}", config_file_path.display());
}
let mut config = serde_json::from_value(config)?;
if let Ok(env) = env::var("TAURI_CONFIG") {
let merge_config: serde_json::Value = serde_json::from_str(&env)?;
json_patch::merge(&mut config, &merge_config);
@@ -508,19 +504,8 @@ pub fn try_build(attributes: Attributes) -> Result<()> {
cfg_alias("dev", is_dev());
let ws_path = get_workspace_dir()?;
let mut manifest =
Manifest::<cargo_toml::Value>::from_slice_with_metadata(&fs::read("Cargo.toml")?)?;
if let Ok(ws_manifest) = Manifest::from_path(ws_path.join("Cargo.toml")) {
Manifest::complete_from_path_and_workspace(
&mut manifest,
Path::new("Cargo.toml"),
Some((&ws_manifest, ws_path.as_path())),
)?;
} else {
Manifest::complete_from_path(&mut manifest, Path::new("Cargo.toml"))?;
}
let cargo_toml_path = Path::new("Cargo.toml").canonicalize()?;
let mut manifest = Manifest::<cargo_toml::Value>::from_path_with_metadata(cargo_toml_path)?;
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
@@ -528,6 +513,8 @@ pub fn try_build(attributes: Attributes) -> Result<()> {
acl::build(&out_dir, target, &attributes)?;
tauri_utils::plugin::save_global_api_scripts_paths(&out_dir, None);
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);
@@ -543,7 +530,7 @@ 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),
@@ -626,7 +613,7 @@ pub fn try_build(attributes: Attributes) -> Result<()> {
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;
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);
}
@@ -636,6 +623,17 @@ pub fn try_build(attributes: Attributes) -> Result<()> {
res.set("ProductName", product_name);
}
let company_name = config.bundle.publisher.unwrap_or_else(|| {
config
.identifier
.split('.')
.nth(1)
.unwrap_or(&config.identifier)
.to_string()
});
res.set("CompanyName", &company_name);
let file_description = config
.product_name
.or_else(|| manifest.package.as_ref().map(|p| p.name.clone()))
@@ -688,7 +686,7 @@ pub fn try_build(attributes: Attributes) -> Result<()> {
}
}
"msvc" => {
if env::var("STATIC_VCRUNTIME").map_or(false, |v| v == "true") {
if env::var("STATIC_VCRUNTIME").is_ok_and(|v| v == "true") {
static_vcruntime::build();
}
}
@@ -703,23 +701,3 @@ pub fn try_build(attributes: Attributes) -> Result<()> {
Ok(())
}
#[derive(serde::Deserialize)]
struct CargoMetadata {
workspace_root: PathBuf,
}
fn get_workspace_dir() -> Result<PathBuf> {
let output = std::process::Command::new("cargo")
.args(["metadata", "--no-deps", "--format-version", "1"])
.output()?;
if !output.status.success() {
return Err(anyhow::anyhow!(
"cargo metadata command exited with a non zero exit code: {}",
String::from_utf8(output.stderr)?
));
}
Ok(serde_json::from_slice::<CargoMetadata>(&output.stdout)?.workspace_root)
}

View File

@@ -1,5 +1,184 @@
# Changelog
## \[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
- [`f981a5ee8`](https://www.github.com/tauri-apps/tauri/commit/f981a5ee8b292b9ea09329f60cecc7f688dda734) ([#12602](https://www.github.com/tauri-apps/tauri/pull/12602) by [@kxxt](https://www.github.com/tauri-apps/tauri/../../kxxt)) Add basic support for linux riscv64 platform.
### Bug Fixes
- [`3626b7a92`](https://www.github.com/tauri-apps/tauri/commit/3626b7a92be2890a82e8d5bd00d13887e199ea4a) ([#12759](https://www.github.com/tauri-apps/tauri/pull/12759) by [@ninjadev64](https://www.github.com/tauri-apps/tauri/../../ninjadev64)) Fix resources being bundled to the wrong path during RPM bundling when resources are specified as a map.
- [`2b960dfd9`](https://www.github.com/tauri-apps/tauri/commit/2b960dfd9fdc995bd6474958c05783ff53b64b7e) ([#12643](https://www.github.com/tauri-apps/tauri/pull/12643) by [@animeshchaudhri](https://www.github.com/tauri-apps/tauri/../../animeshchaudhri)) Remove the autostart plugin registry entry when the app is uninstalled (NSIS only).
### Dependencies
- Upgraded to `tauri-utils@2.3.0`
## \[2.2.4]
### Enhancements
- [`5eba0785c`](https://www.github.com/tauri-apps/tauri/commit/5eba0785c461a0d0bec47653eaf6ccdf5f05d347) ([#12605](https://www.github.com/tauri-apps/tauri/pull/12605) by [@niusia-ua](https://www.github.com/tauri-apps/tauri/../../niusia-ua)) Added Ukrainian translation for the custom tauri messages in the nsis bundle
### Dependencies
- Upgraded to `tauri-utils@2.2.0`
- Upgraded to `tauri-macos-sign@2.1.0`
## \[2.2.3]
### Bug Fixes
- [`de8600b4d`](https://www.github.com/tauri-apps/tauri/commit/de8600b4d9a04e809e078c8aea61825d1328201f) ([#12471](https://www.github.com/tauri-apps/tauri/pull/12471) by [@anatawa12](https://www.github.com/tauri-apps/tauri/../../anatawa12)) Bumped `nsis-tauri-utils` to `0.4.2` which fixes the following bugs:
- Fixed launch on start checkbox in nsis installer does not work well with applications that require elevated permissions
- Fixed nsis installer may fail to install if launched by updater plugin
- [`fbe7c9ead`](https://www.github.com/tauri-apps/tauri/commit/fbe7c9ead76e71ca258c6f48bbb62185fcc37b1c) ([#12466](https://www.github.com/tauri-apps/tauri/pull/12466) by [@FabianLars](https://www.github.com/tauri-apps/tauri/../../FabianLars)) Fixed an issue that caused the compiled AppImage to miss webkitgtk's internal `libwebkit2gtkinjectedbundle.so` file.
- [`f5a59b93b`](https://www.github.com/tauri-apps/tauri/commit/f5a59b93bfefb43ff131a7870b3c5d5e48c1ca1e) ([#12136](https://www.github.com/tauri-apps/tauri/pull/12136) by [@unknovvn](https://www.github.com/tauri-apps/tauri/../../unknovvn)) The NSIS bundler will now replace non-numeric build metadata with `0` instead of returning an error.
- [`9dac2863a`](https://www.github.com/tauri-apps/tauri/commit/9dac2863afa70fb0bcddf859b284afba917f28ae) ([#12323](https://www.github.com/tauri-apps/tauri/pull/12323) by [@FabianLars](https://www.github.com/tauri-apps/tauri/../../FabianLars)) Skip signing the .dmg if self signing via `"signingIdentity": "-"` is used.
- [`b8eb28877`](https://www.github.com/tauri-apps/tauri/commit/b8eb28877fe822dbe17999fc8af98ed7d0983679) ([#12427](https://www.github.com/tauri-apps/tauri/pull/12427) by [@Legend-Master](https://www.github.com/tauri-apps/tauri/../../Legend-Master)) Clean up `Software\${MANUFACTURER}\${PRODUCTNAME}` registry key in the NSIS uninstaller if "Delete application data" option is checked when uninstalling.
## \[2.2.2]
### Bug Fixes
- [`72748cc45`](https://www.github.com/tauri-apps/tauri/commit/72748cc45cf670dd03c86c8deceb5942598f5ad9) ([#12365](https://www.github.com/tauri-apps/tauri/pull/12365) by [@don41382](https://www.github.com/tauri-apps/tauri/../../don41382)) Fixed an issue that caused the `.msi` installer not to lookup the `INSTALLDIR` set in the `nsis` installer.
- [`cf771bf69`](https://www.github.com/tauri-apps/tauri/commit/cf771bf69aa26b62d11a54a69131c631505d8c55) ([#12402](https://www.github.com/tauri-apps/tauri/pull/12402) by [@FabianLars](https://www.github.com/tauri-apps/tauri/../../FabianLars)) Fixed an issue that caused the .msi installer to not contain root resources when there were .dll files present in the target directory.
- [`07ccdc499`](https://www.github.com/tauri-apps/tauri/commit/07ccdc499c3240e7240be3abf95ef2d7d00b2dc7) ([#12324](https://www.github.com/tauri-apps/tauri/pull/12324) by [@FabianLars](https://www.github.com/tauri-apps/tauri/../../FabianLars)) Fixed an issue leading to NSIS based installers to not contain the `WebView2Loader.dll` file when targetting `windows-gnu`.
## \[2.2.1]
### Bug Fixes
- [`cd1d026f9`](https://www.github.com/tauri-apps/tauri/commit/cd1d026f9799c26b04acb64f49e7ee0a8b193049) ([#11961](https://www.github.com/tauri-apps/tauri/pull/11961) by [@Legend-Master](https://www.github.com/tauri-apps/tauri/../../Legend-Master)) Fix tauri fails to build if the project path contains glob characters
## \[2.2.0]
### New Features
- [`cccb308c7`](https://www.github.com/tauri-apps/tauri/commit/cccb308c7b559b0838138d6cea280665f060c925) ([#11562](https://www.github.com/tauri-apps/tauri/pull/11562) by [@jLynx](https://www.github.com/tauri-apps/tauri/../../jLynx)) Generate signature for `.deb` packages when `createUpdaterArtifacts` option is enabled.
### Enhancements
- [`93a3a043d`](https://www.github.com/tauri-apps/tauri/commit/93a3a043d39cc96515d51d98beeb14261d3a246b) ([#11727](https://www.github.com/tauri-apps/tauri/pull/11727) by [@Kiyozz](https://www.github.com/tauri-apps/tauri/../../Kiyozz)) Add support for `Portuguese` language for NSIS windows installer.
- [`53f808674`](https://www.github.com/tauri-apps/tauri/commit/53f808674b2c0012bc44a41ced90e742afbb41e8) ([#11799](https://www.github.com/tauri-apps/tauri/pull/11799) by [@FabianLars](https://www.github.com/tauri-apps/tauri/../../FabianLars)) The bundler now reads the `TAURI_BUNDLER_DMG_IGNORE_CI` env var to decide whether to check for `CI: true` when building DMG files.
### Dependencies
- Upgraded to `tauri-utils@2.1.1`
## \[2.1.0]
### New Features
- [`1b6b2cfaa`](https://www.github.com/tauri-apps/tauri/commit/1b6b2cfaa14ab1d418c676cedbf942a812377a30) ([#11521](https://www.github.com/tauri-apps/tauri/pull/11521) by [@amrbashir](https://www.github.com/tauri-apps/tauri/../../amrbashir)) Process `bundle > windows > wix > fragmentPaths` with Handlebars to interpolate expressions within it.
- [`6dea12a06`](https://www.github.com/tauri-apps/tauri/commit/6dea12a0677a905cb1f14969fe05c53e7cd717c6) ([#11402](https://www.github.com/tauri-apps/tauri/pull/11402) by [@amrbashir](https://www.github.com/tauri-apps/tauri/../../amrbashir)) Add `bundle > linux > deb > recommends` and `bundle > linux > rpm > recommends` fields to declare a strong, but not absolute, dependency for your `.deb` and `.rpm` packages.
- [`058c0db72`](https://www.github.com/tauri-apps/tauri/commit/058c0db72f43fbe1574d0db654560e693755cd7e) ([#11584](https://www.github.com/tauri-apps/tauri/pull/11584) by [@amrbashir](https://www.github.com/tauri-apps/tauri/../../amrbashir)) Add `bundle > linux > rpm > compression` config option to control RPM bundle compression type and level.
### Dependencies
- Upgraded to `tauri-utils@2.1.0`
## \[2.0.4]
### New Features
- [`c8f55b615`](https://www.github.com/tauri-apps/tauri/commit/c8f55b615d2d98ade5c0f1896139dc283382a176) ([#11388](https://www.github.com/tauri-apps/tauri/pull/11388) by [@amrbashir](https://www.github.com/tauri-apps/tauri/../../amrbashir)) Add `bundler > windows > wix > version` to manually specify a wix-compatible version.
## \[2.0.3]
### New Features
- [`eda5713ea`](https://www.github.com/tauri-apps/tauri/commit/eda5713eab78d28182071ea25ceca5f1994f37ea) ([#11242](https://www.github.com/tauri-apps/tauri/pull/11242) by [@alex-sandri](https://www.github.com/tauri-apps/tauri/../../alex-sandri)) Add `Italian` to supported NSIS installer languages
### Enhancements
- [`504bb8ec8`](https://www.github.com/tauri-apps/tauri/commit/504bb8ec8cb294c5067357e18328580dd2b950c9) ([#11287](https://www.github.com/tauri-apps/tauri/pull/11287) by [@lucasfernog](https://www.github.com/tauri-apps/tauri/../../lucasfernog)) Pull upstream changes for the DMG creation script.
### Bug Fixes
- [`069c05e44`](https://www.github.com/tauri-apps/tauri/commit/069c05e44fd6f30083fdc00dd6c0001278898592) ([#11315](https://www.github.com/tauri-apps/tauri/pull/11315) by [@amrbashir](https://www.github.com/tauri-apps/tauri/../../amrbashir)) Fix CLI crashing and failing to find a `.ico` file when `bundle > icon` option is using globs and doesn't have a string that ends with `.ico`.
## \[2.0.2]
### Bug Fixes
- [`858b3516a`](https://www.github.com/tauri-apps/tauri/commit/858b3516a008ae5e6f2af489805896e2c142be10) ([#11217](https://www.github.com/tauri-apps/tauri/pull/11217) by [@kittuov](https://www.github.com/tauri-apps/tauri/../../kittuov)) On Windows, fixed command arguments for `bundle -> windows -> msi -> elevatedUpdateTask`. to work with spaces in `productName`
- [`a49a19ffa`](https://www.github.com/tauri-apps/tauri/commit/a49a19ffa304f031fb1a04d31a567cc7f42a380a) ([#11218](https://www.github.com/tauri-apps/tauri/pull/11218)) Fix bundling `appimage`, `deb` and `rpm` bundles failing to open when using `mainBinaryName` with spaces.
## \[2.0.1]
### What's Changed
- [`0ab2b3306`](https://www.github.com/tauri-apps/tauri/commit/0ab2b330644b6419f6cee1d5377bfb5cdda2ccf9) ([#11205](https://www.github.com/tauri-apps/tauri/pull/11205) by [@lucasfernog](https://www.github.com/tauri-apps/tauri/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
### Dependencies
- Upgraded to `tauri-utils@2.0.1`
- Upgraded to `tauri-macos-sign@2.0.1`
## \[2.0.0]
### What's Changed

View File

@@ -1,6 +1,6 @@
[package]
name = "tauri-bundler"
version = "2.0.0"
version = "2.5.1"
authors = [
"George Burton <burtonageo@gmail.com>",
"Tauri Programme within The Commons Conservancy",
@@ -15,57 +15,59 @@ rust-version = "1.77.2"
exclude = ["CHANGELOG.md", "/target", "rustfmt.toml"]
[dependencies]
tauri-utils = { version = "2.0.0", path = "../tauri-utils", features = [
tauri-utils = { version = "2.6.0", path = "../tauri-utils", features = [
"resources",
] }
image = "0.25.0"
flate2 = "1.0"
anyhow = "1.0"
thiserror = "1.0"
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
strsim = "0.11.0"
tar = "0.4.40"
image = "0.25"
flate2 = "1"
anyhow = "1"
thiserror = "2"
serde_json = "1"
serde = { version = "1", features = ["derive"] }
strsim = "0.11"
tar = "0.4"
walkdir = "2"
handlebars = "6"
tempfile = "3.10.1"
tempfile = "3"
log = { version = "0.4.21", features = ["kv"] }
dirs = "5"
dirs = "6"
os_pipe = "1"
ureq = { version = "2.9.6", default-features = false, features = [
"socks-proxy",
] }
ureq = { version = "3", default-features = false, features = ["socks-proxy"] }
native-tls = { version = "0.2", optional = true }
hex = "0.4"
semver = "1"
sha1 = "0.10"
sha2 = "0.10"
zip = { version = "2.0", 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"
[target."cfg(target_os = \"windows\")".dependencies]
bitness = "0.4"
windows-registry = "0.2.0"
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.0.0", path = "../tauri-macos-sign" }
tauri-macos-sign = { version = "2.1.0", path = "../tauri-macos-sign" }
[target."cfg(target_os = \"linux\")".dependencies]
heck = "0.5"
ar = "0.9.0"
md5 = "0.7.0"
rpm = "0.15.0"
ar = "0.9"
md5 = "0.8"
rpm = { version = "0.16", features = ["bzip2-compression"] }
[target."cfg(unix)".dependencies]
which = "7"
[lib]
name = "tauri_bundler"
@@ -75,4 +77,4 @@ path = "src/lib.rs"
default = ["rustls"]
native-tls = ["ureq/native-tls"]
native-tls-vendored = ["native-tls", "native-tls/vendored"]
rustls = ["ureq/tls"]
rustls = ["ureq/rustls"]

View File

@@ -4,25 +4,49 @@
// SPDX-License-Identifier: MIT
mod category;
mod common;
#[cfg(target_os = "linux")]
mod linux;
#[cfg(target_os = "macos")]
mod macos;
mod path_utils;
mod platform;
mod settings;
mod updater_bundle;
mod windows;
use tauri_utils::display_path;
use tauri_utils::{display_path, platform::Target as TargetPlatform};
/// Patch a binary with bundle type information
fn patch_binary(binary: &PathBuf, package_type: &PackageType) -> crate::Result<()> {
match package_type {
#[cfg(target_os = "linux")]
PackageType::AppImage | PackageType::Deb | PackageType::Rpm => {
log::info!(
"Patching binary {:?} for type {}",
binary,
package_type.short_name()
);
linux::patch_binary(binary, package_type)?;
}
PackageType::Nsis | PackageType::WindowsMsi => {
log::info!(
"Patching binary {:?} for type {}",
binary,
package_type.short_name()
);
windows::patch_binary(binary, package_type)?;
}
_ => (),
}
Ok(())
}
pub use self::{
category::AppCategory,
settings::{
AppImageSettings, BundleBinary, BundleSettings, CustomSignCommandSettings, DebianSettings,
DmgSettings, MacOsSettings, PackageSettings, PackageType, Position, RpmSettings, Settings,
SettingsBuilder, Size, UpdaterSettings,
DmgSettings, IosSettings, MacOsSettings, PackageSettings, PackageType, Position, RpmSettings,
Settings, SettingsBuilder, Size, UpdaterSettings,
},
};
#[cfg(target_os = "macos")]
@@ -50,19 +74,14 @@ 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 {
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 matches!(target_os, TargetPlatform::Windows) {
if settings.can_sign() {
for bin in settings.binaries() {
let bin_path = settings.binary_path(bin);
@@ -72,8 +91,7 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<Bundle>> {
// Sign the sidecar binaries
for bin in settings.external_binaries() {
let path = bin?;
let skip =
std::env::var("TAURI_SKIP_SIDECAR_SIGNATURE_CHECK").map_or(false, |v| v == "true");
let skip = std::env::var("TAURI_SKIP_SIDECAR_SIGNATURE_CHECK").is_ok_and(|v| v == "true");
if skip {
continue;
}
@@ -95,6 +113,12 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<Bundle>> {
}
}
let main_binary = settings
.binaries()
.iter()
.find(|b| b.main())
.expect("Main binary missing in settings");
let mut bundles = Vec::<Bundle>::new();
for package_type in &package_types {
// bundle was already built! e.g. DMG already built .app
@@ -102,6 +126,10 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<Bundle>> {
continue;
}
if let Err(e) = patch_binary(&settings.binary_path(main_binary), 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");
}
let bundle_paths = match package_type {
#[cfg(target_os = "macos")]
PackageType::MacOsBundle => macos::app::bundle_project(settings)?,
@@ -151,6 +179,7 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<Bundle>> {
| PackageType::MacOsBundle
| PackageType::Nsis
| PackageType::WindowsMsi
| PackageType::Deb
)
} else {
matches!(package_type, PackageType::MacOsBundle)
@@ -166,7 +195,7 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<Bundle>> {
// Self contained updater, no need to zip
matches!(
package_type,
PackageType::AppImage | PackageType::Nsis | PackageType::WindowsMsi
PackageType::AppImage | PackageType::Nsis | PackageType::WindowsMsi | PackageType::Deb
)
})
{

View File

@@ -249,7 +249,7 @@ struct AppCategoryVisitor {
did_you_mean: Option<&'static str>,
}
impl<'d> serde::de::Visitor<'d> for AppCategoryVisitor {
impl serde::de::Visitor<'_> for AppCategoryVisitor {
type Value = AppCategory;
fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {

View File

@@ -0,0 +1,270 @@
// 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
use super::debian;
use crate::{
bundle::settings::Arch,
utils::{fs_utils, http_utils::download, CommandExt},
Settings,
};
use anyhow::Context;
use std::{
fs,
path::{Path, PathBuf},
process::Command,
};
/// Bundles the project.
/// Returns a vector of PathBuf that shows where the AppImage was created.
pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
// generate the deb binary name
let appimage_arch: &str = 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 = 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)?;
}
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)?;
let linuxdeploy_path = prepare_tools(&tools_path, tools_arch)?;
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_directory = settings.project_out_directory();
let main_binary_name_kebab = heck::AsKebabCase(main_binary.name()).to_string();
let new_path = project_out_directory.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(&output_path)?;
let app_dir_path = output_path.join(format!("{}.AppDir", settings.product_name()));
let appimage_filename = format!(
"{}_{}_{}.AppImage",
settings.product_name(),
settings.version_string(),
appimage_arch
);
let appimage_path = output_path.join(&appimage_filename);
fs_utils::create_dir(&app_dir_path, true)?;
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");
let larger_icon_path = larger_icon
.path
.strip_prefix(package_dir.join("data"))
.unwrap()
.to_string_lossy()
.to_string();
log::info!(action = "Bundling"; "{} ({})", appimage_filename, appimage_path.display());
let app_dir_usr = app_dir_path.join("usr/");
let app_dir_usr_bin = app_dir_usr.join("bin/");
let app_dir_usr_lib = app_dir_usr.join("lib/");
fs_utils::copy_dir(&data_dir.join("usr/"), &app_dir_usr)?;
// Using create_dir_all for a single dir so we don't get errors if the path already exists
fs::create_dir_all(&app_dir_usr_bin)?;
fs::create_dir_all(app_dir_usr_lib)?;
// Copy bins and libs that linuxdeploy doesn't know about
// we also check if the user may have provided their own copy already
// 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")?;
}
// 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")?;
}
let search_dirs = [
match settings.binary_arch() {
Arch::X86_64 => "/usr/lib/x86_64-linux-gnu/",
Arch::X86 => "/usr/lib/i386-linux-gnu/",
Arch::AArch64 => "/usr/lib/aarch64-linux-gnu/",
Arch::Armhf => "/usr/lib/arm-linux-gnueabihf/",
_ => unreachable!(),
},
"/usr/lib64",
"/usr/lib",
"/usr/libexec",
];
for file in [
"WebKitNetworkProcess",
"WebKitWebProcess",
"injected-bundle/libwebkit2gtkinjectedbundle.so",
] {
for source in search_dirs.map(PathBuf::from) {
// TODO: Check if it's the same dir name on all systems
let source = source.join("webkit2gtk-4.1").join(file);
if source.exists() {
fs_utils::copy_file(
&source,
&app_dir_path.join(source.strip_prefix("/").unwrap()),
)?;
}
}
}
fs::copy(
tools_path.join(format!("AppRun-{tools_arch}")),
app_dir_path.join("AppRun"),
)?;
fs::copy(
app_dir_path.join(larger_icon_path),
app_dir_path.join(format!("{product_name}.png")),
)?;
std::os::unix::fs::symlink(
app_dir_path.join(format!("{product_name}.png")),
app_dir_path.join(".DirIcon"),
)?;
std::os::unix::fs::symlink(
app_dir_path.join(format!("usr/share/applications/{product_name}.desktop")),
app_dir_path.join(format!("{product_name}.desktop")),
)?;
let log_level = match settings.log_level() {
log::Level::Error => "3",
log::Level::Warn => "2",
log::Level::Info => "1",
_ => "0",
};
let mut cmd = Command::new(linuxdeploy_path);
cmd.env("OUTPUT", &appimage_path);
cmd.env("ARCH", tools_arch);
cmd.args([
"--appimage-extract-and-run",
"--verbosity",
log_level,
"--appdir",
&app_dir_path.display().to_string(),
"--plugin",
"gtk",
]);
if settings.appimage().bundle_media_framework {
cmd.args(["--plugin", "gstreamer"]);
}
cmd.args(["--output", "appimage"]);
// Linuxdeploy logs everything into stderr so we have to ignore the output ourselves here
if settings.log_level() == log::Level::Error {
log::debug!(action = "Running"; "Command `linuxdeploy {}`", cmd.get_args().map(|arg| arg.to_string_lossy()).fold(String::new(), |acc, arg| format!("{acc} {arg}")));
if !cmd.output()?.status.success() {
return Err(crate::Error::GenericError(
"failed to run linuxdeploy".to_string(),
));
}
} else {
cmd.output_ok()?;
}
fs::remove_dir_all(&package_dir)?;
Ok(vec![appimage_path])
}
// returns the linuxdeploy path to keep linuxdeploy_arch contained
fn prepare_tools(tools_path: &Path, arch: &str) -> crate::Result<PathBuf> {
let apprun = tools_path.join(format!("AppRun-{arch}"));
if !apprun.exists() {
let data = download(&format!(
"https://github.com/tauri-apps/binary-releases/releases/download/apprun-old/AppRun-{arch}"
))?;
write_and_make_executable(&apprun, data)?;
}
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"))?;
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")?;
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")?;
write_and_make_executable(&gstreamer, data)?;
}
// This should prevent linuxdeploy to be detected by appimage integration tools
let _ = Command::new("dd")
.args([
"if=/dev/zero",
"bs=1",
"count=3",
"seek=8",
"conv=notrunc",
&format!("of={}", linuxdeploy.display()),
])
.output();
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

@@ -1,86 +0,0 @@
#!/usr/bin/env bash
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
set -euxo pipefail
export ARCH={{arch}}
APPIMAGE_BUNDLE_XDG_OPEN=${APPIMAGE_BUNDLE_XDG_OPEN-0}
APPIMAGE_BUNDLE_XDG_MIME=${APPIMAGE_BUNDLE_XDG_MIME-0}
APPIMAGE_BUNDLE_GSTREAMER=${APPIMAGE_BUNDLE_GSTREAMER-0}
TAURI_TRAY_LIBRARY_PATH=${TAURI_TRAY_LIBRARY_PATH-0}
if [ "$ARCH" == "i686" ]; then
linuxdeploy_arch="i386"
else
linuxdeploy_arch="$ARCH"
fi
mkdir -p "{{product_name}}.AppDir"
cp -r ../appimage_deb/data/usr "{{product_name}}.AppDir"
cd "{{product_name}}.AppDir"
mkdir -p "usr/bin"
mkdir -p "usr/lib"
if [[ "$APPIMAGE_BUNDLE_XDG_OPEN" != "0" ]] && [[ -f "/usr/bin/xdg-open" ]]; then
echo "Copying /usr/bin/xdg-open"
cp /usr/bin/xdg-open usr/bin
fi
if [[ "$APPIMAGE_BUNDLE_XDG_MIME" != "0" ]] && [[ -f "/usr/bin/xdg-mime" ]]; then
echo "Copying /usr/bin/xdg-mime"
cp /usr/bin/xdg-mime usr/bin
fi
if [[ "$TAURI_TRAY_LIBRARY_PATH" != "0" ]]; then
echo "Copying appindicator library ${TAURI_TRAY_LIBRARY_PATH}"
cp ${TAURI_TRAY_LIBRARY_PATH} usr/lib
# It looks like we're practicing good hygiene by adding the ABI version.
# But for compatibility we'll symlink this file to what we did before.
# Specifically this prevents breaking libappindicator-sys v0.7.1 and v0.7.2.
if [[ "$TAURI_TRAY_LIBRARY_PATH" == *.so.1 ]]; then
readonly soname=$(basename "$TAURI_TRAY_LIBRARY_PATH")
readonly old_name=$(basename "$TAURI_TRAY_LIBRARY_PATH" .1)
echo "Adding compatibility symlink ${old_name} -> ${soname}"
ln -s ${soname} usr/lib/${old_name}
fi
fi
# Copy WebKit files. Follow symlinks in case `/usr/lib64` is a symlink to `/usr/lib`
find -L /usr/lib* -name WebKitNetworkProcess -exec mkdir -p "$(dirname '{}')" \; -exec cp --parents '{}' "." \; || true
find -L /usr/lib* -name WebKitWebProcess -exec mkdir -p "$(dirname '{}')" \; -exec cp --parents '{}' "." \; || true
find -L /usr/lib* -name libwebkit2gtkinjectedbundle.so -exec mkdir -p "$(dirname '{}')" \; -exec cp --parents '{}' "." \; || true
( cd "{{tauri_tools_path}}" && ( wget -q -4 -N https://github.com/AppImage/AppImageKit/releases/download/continuous/AppRun-${ARCH} || wget -q -4 -N https://github.com/AppImage/AppImageKit/releases/download/12/AppRun-${ARCH} ) )
chmod +x "{{tauri_tools_path}}/AppRun-${ARCH}"
# We need AppRun to be installed as {{product_name}}.AppDir/AppRun.
# Otherwise the linuxdeploy scripts will default to symlinking our main bin instead and will crash on trying to launch.
cp "{{tauri_tools_path}}/AppRun-${ARCH}" AppRun
cp "{{icon_path}}" .DirIcon
ln -sf "{{icon_path}}" "{{product_name}}.png"
ln -sf "usr/share/applications/{{product_name}}.desktop" "{{product_name}}.desktop"
cd ..
if [[ "$APPIMAGE_BUNDLE_GSTREAMER" != "0" ]]; then
gst_plugin="--plugin gstreamer"
wget -q -4 -N "https://raw.githubusercontent.com/tauri-apps/linuxdeploy-plugin-gstreamer/master/linuxdeploy-plugin-gstreamer.sh"
chmod +x linuxdeploy-plugin-gstreamer.sh
else
gst_plugin=""
fi
( cd "{{tauri_tools_path}}" && wget -q -4 -N https://raw.githubusercontent.com/tauri-apps/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh )
( cd "{{tauri_tools_path}}" && wget -q -4 -N https://github.com/tauri-apps/binary-releases/releases/download/linuxdeploy/linuxdeploy-${linuxdeploy_arch}.AppImage )
chmod +x "{{tauri_tools_path}}/linuxdeploy-plugin-gtk.sh"
chmod +x "{{tauri_tools_path}}/linuxdeploy-${linuxdeploy_arch}.AppImage"
dd if=/dev/zero bs=1 count=3 seek=8 conv=notrunc of="{{tauri_tools_path}}/linuxdeploy-${linuxdeploy_arch}.AppImage"
OUTPUT="{{appimage_filename}}" "{{tauri_tools_path}}/linuxdeploy-${linuxdeploy_arch}.AppImage" --appimage-extract-and-run --appdir "{{product_name}}.AppDir" --plugin gtk ${gst_plugin} --output appimage

View File

@@ -1,124 +0,0 @@
// 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
use super::{
super::{
common::{self, CommandExt},
path_utils,
},
debian,
};
use crate::{bundle::settings::Arch, Settings};
use anyhow::Context;
use handlebars::Handlebars;
use std::{
collections::BTreeMap,
fs::{remove_dir_all, write},
path::PathBuf,
process::{Command, Stdio},
};
/// Bundles the project.
/// Returns a vector of PathBuf that shows where the AppImage was created.
pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
// generate the deb binary name
let arch: &str = 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 package_dir = settings.project_out_directory().join("bundle/appimage_deb");
// generate deb_folder structure
let (data_dir, icons) = debian::generate_data(settings, &package_dir)
.with_context(|| "Failed to build data folders and files")?;
common::copy_custom_files(&settings.appimage().files, &data_dir)
.with_context(|| "Failed to copy custom files")?;
let output_path = settings.project_out_directory().join("bundle/appimage");
if output_path.exists() {
remove_dir_all(&output_path)?;
}
std::fs::create_dir_all(output_path.clone())?;
let app_dir_path = output_path.join(format!("{}.AppDir", settings.product_name()));
let appimage_filename = format!(
"{}_{}_{}.AppImage",
settings.product_name(),
settings.version_string(),
arch
);
let appimage_path = output_path.join(&appimage_filename);
path_utils::create(app_dir_path, true)?;
// setup data to insert into shell script
let mut sh_map = BTreeMap::new();
sh_map.insert("arch", settings.target().split('-').next().unwrap());
sh_map.insert("product_name", settings.product_name());
sh_map.insert("appimage_filename", &appimage_filename);
let tauri_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"))
});
std::fs::create_dir_all(&tauri_tools_path)?;
let tauri_tools_path_str = tauri_tools_path.to_string_lossy();
sh_map.insert("tauri_tools_path", &tauri_tools_path_str);
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");
let larger_icon_path = larger_icon
.path
.strip_prefix(package_dir.join("data"))
.unwrap()
.to_string_lossy()
.to_string();
sh_map.insert("icon_path", &larger_icon_path);
// initialize shell script template.
let mut handlebars = Handlebars::new();
handlebars.register_escape_fn(handlebars::no_escape);
handlebars
.register_template_string("appimage", include_str!("./appimage"))
.expect("Failed to register template for handlebars");
let temp = handlebars.render("appimage", &sh_map)?;
// create the shell script file in the target/ folder.
let sh_file = output_path.join("build_appimage.sh");
log::info!(action = "Bundling"; "{} ({})", appimage_filename, appimage_path.display());
write(&sh_file, temp)?;
// chmod script for execution
Command::new("chmod")
.arg("777")
.arg(&sh_file)
.current_dir(output_path.clone())
.stdout(Stdio::piped())
.stderr(Stdio::piped())
.output()
.expect("Failed to chmod script");
// execute the shell script to build the appimage.
Command::new(&sh_file)
.current_dir(output_path)
.output_ok()
.context("error running build_appimage.sh")?;
remove_dir_all(&package_dir)?;
Ok(vec![appimage_path])
}

View File

@@ -23,8 +23,8 @@
// metadata, as well as generating the md5sums file. Currently we do not
// generate postinst or prerm files.
use super::{super::common, freedesktop};
use crate::{bundle::settings::Arch, Settings};
use super::freedesktop;
use crate::{bundle::settings::Arch, utils::fs_utils, Settings};
use anyhow::Context;
use flate2::{write::GzEncoder, Compression};
use tar::HeaderMode;
@@ -46,10 +46,10 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
Arch::AArch64 => "arm64",
Arch::Armhf => "armhf",
Arch::Armel => "armel",
Arch::Riscv64 => "riscv64",
target => {
return Err(crate::Error::ArchError(format!(
"Unsupported architecture: {:?}",
target
"Unsupported architecture: {target:?}"
)));
}
};
@@ -73,7 +73,7 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
let (data_dir, _) = generate_data(settings, &package_dir)
.with_context(|| "Failed to build data folders and files")?;
common::copy_custom_files(&settings.deb().files, &data_dir)
fs_utils::copy_custom_files(&settings.deb().files, &data_dir)
.with_context(|| "Failed to copy custom files")?;
// Generate control files.
@@ -113,7 +113,7 @@ pub fn generate_data(
for bin in settings.binaries() {
let bin_path = settings.binary_path(bin);
common::copy_file(&bin_path, bin_dir.join(bin.name()))
fs_utils::copy_file(&bin_path, &bin_dir.join(bin.name()))
.with_context(|| format!("Failed to copy binary from {bin_path:?}"))?;
}
@@ -141,7 +141,7 @@ fn generate_changelog_file(settings: &Settings, data_dir: &Path) -> crate::Resul
let product_name = settings.product_name();
let dest_path = data_dir.join(format!("usr/share/doc/{product_name}/changelog.gz"));
let changelog_file = common::create_file(&dest_path)?;
let changelog_file = fs_utils::create_file(&dest_path)?;
let mut gzip_encoder = GzEncoder::new(changelog_file, Compression::new(9));
io::copy(&mut src_file, &mut gzip_encoder)?;
@@ -161,9 +161,9 @@ fn generate_control_file(
// For more information about the format of this file, see
// https://www.debian.org/doc/debian-policy/ch-controlfields.html
let dest_path = control_dir.join("control");
let mut file = common::create_file(&dest_path)?;
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
@@ -182,22 +182,31 @@ 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();
if !dependencies.is_empty() {
writeln!(file, "Depends: {}", dependencies.join(", "))?;
}
let dependencies = settings
.deb()
.recommends
.as_ref()
.cloned()
.unwrap_or_default();
if !dependencies.is_empty() {
writeln!(file, "Recommends: {}", dependencies.join(", "))?;
}
let provides = settings
.deb()
.provides
@@ -285,7 +294,7 @@ fn create_script_file_from_path(from: &PathBuf, to: &PathBuf) -> crate::Result<(
/// for each file within the `data_dir`.
fn generate_md5sums(control_dir: &Path, data_dir: &Path) -> crate::Result<()> {
let md5sums_path = control_dir.join("md5sums");
let mut md5sums_file = common::create_file(&md5sums_path)?;
let mut md5sums_file = fs_utils::create_file(&md5sums_path)?;
for entry in WalkDir::new(data_dir) {
let entry = entry?;
let path = entry.path();
@@ -295,7 +304,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)?;
@@ -318,7 +327,7 @@ fn copy_resource_files(settings: &Settings, data_dir: &Path) -> crate::Result<()
/// Create an empty file at the given path, creating any parent directories as
/// needed, then write `data` into the file.
fn create_file_with_data<P: AsRef<Path>>(path: P, data: &str) -> crate::Result<()> {
let mut file = common::create_file(path.as_ref())?;
let mut file = fs_utils::create_file(path.as_ref())?;
file.write_all(data.as_bytes())?;
file.flush()?;
Ok(())
@@ -367,7 +376,7 @@ fn create_tar_from_dir<P: AsRef<Path>, W: Write>(src_dir: P, dest_file: W) -> cr
fn tar_and_gzip_dir<P: AsRef<Path>>(src_dir: P) -> crate::Result<PathBuf> {
let src_dir = src_dir.as_ref();
let dest_path = src_dir.with_extension("tar.gz");
let dest_file = common::create_file(&dest_path)?;
let dest_file = fs_utils::create_file(&dest_path)?;
let gzip_encoder = GzEncoder::new(dest_file, Compression::default());
let gzip_encoder = create_tar_from_dir(src_dir, gzip_encoder)?;
let mut dest_file = gzip_encoder.finish()?;
@@ -378,7 +387,7 @@ fn tar_and_gzip_dir<P: AsRef<Path>>(src_dir: P) -> crate::Result<PathBuf> {
/// Creates an `ar` archive from the given source files and writes it to the
/// given destination path.
fn create_archive(srcs: Vec<PathBuf>, dest: &Path) -> crate::Result<()> {
let mut builder = ar::Builder::new(common::create_file(dest)?);
let mut builder = ar::Builder::new(fs_utils::create_file(dest)?);
for path in &srcs {
builder.append_path(path)?;
}

View File

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

View File

@@ -26,8 +26,10 @@ use handlebars::Handlebars;
use image::{self, codecs::png::PngDecoder, ImageDecoder};
use serde::Serialize;
use crate::bundle::common;
use crate::Settings;
use crate::{
utils::{self, fs_utils},
Settings,
};
#[derive(PartialEq, Eq, PartialOrd, Ord)]
pub struct Icon {
@@ -65,7 +67,7 @@ pub fn list_icon_files(
let decoder = PngDecoder::new(BufReader::new(File::open(&icon_path)?))?;
let width = decoder.dimensions().0;
let height = decoder.dimensions().1;
let is_high_density = common::is_retina(&icon_path);
let is_high_density = utils::is_retina(&icon_path);
let dest_path = get_dest_path(width, height, is_high_density);
Icon {
width,
@@ -84,7 +86,7 @@ pub fn list_icon_files(
pub fn copy_icon_files(settings: &Settings, data_dir: &Path) -> crate::Result<Vec<Icon>> {
let icons = list_icon_files(settings, data_dir)?;
for (icon, src) in &icons {
common::copy_file(src, &icon.path)?;
fs_utils::copy_file(src, &icon.path)?;
}
Ok(icons.into_keys().collect())
@@ -99,12 +101,13 @@ pub fn generate_desktop_file(
data_dir: &Path,
) -> crate::Result<(PathBuf, PathBuf)> {
let bin_name = settings.main_binary_name()?;
let product_name = settings.product_name();
let desktop_file_name = format!("{product_name}.desktop");
let path = PathBuf::from("usr/share/applications").join(desktop_file_name);
let dest_path = PathBuf::from("/").join(&path);
let file_path = data_dir.join(&path);
let file = &mut common::create_file(&file_path)?;
let file = &mut fs_utils::create_file(&file_path)?;
let mut handlebars = Handlebars::new();
handlebars.register_escape_fn(handlebars::no_escape);
@@ -150,6 +153,12 @@ pub fn generate_desktop_file(
let mime_type = (!mime_type.is_empty()).then_some(mime_type.join(";"));
let bin_name_exec = if bin_name.contains(' ') {
format!("\"{bin_name}\"")
} else {
bin_name.to_string()
};
handlebars.render_to_write(
"main.desktop",
&DesktopTemplateParams {
@@ -162,7 +171,7 @@ pub fn generate_desktop_file(
} else {
None
},
exec: bin_name,
exec: &bin_name_exec,
icon: bin_name,
name: settings.product_name(),
mime_type,

View File

@@ -7,3 +7,8 @@ pub mod appimage;
pub mod debian;
pub mod freedesktop;
pub mod rpm;
mod util;
#[cfg(target_os = "linux")]
pub use util::patch_binary;

View File

@@ -12,6 +12,7 @@ use std::{
fs::{self, File},
path::{Path, PathBuf},
};
use tauri_utils::config::RpmCompression;
use super::freedesktop;
@@ -28,10 +29,10 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
Arch::AArch64 => "aarch64",
Arch::Armhf => "armhfp",
Arch::Armel => "armel",
Arch::Riscv64 => "riscv64",
target => {
return Err(crate::Error::ArchError(format!(
"Unsupported architecture: {:?}",
target
"Unsupported architecture: {target:?}"
)));
}
};
@@ -54,11 +55,25 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
let license = settings.license().unwrap_or_default();
let name = heck::AsKebabCase(settings.product_name()).to_string();
let compression = settings
.rpm()
.compression
.map(|c| match c {
RpmCompression::Gzip { level } => rpm::CompressionWithLevel::Gzip(level),
RpmCompression::Zstd { level } => rpm::CompressionWithLevel::Zstd(level),
RpmCompression::Xz { level } => rpm::CompressionWithLevel::Xz(level),
RpmCompression::Bzip2 { level } => rpm::CompressionWithLevel::Bzip2(level),
_ => rpm::CompressionWithLevel::None,
})
// This matches .deb compression. On a 240MB source binary the bundle will be 100KB larger than rpm's default while reducing build times by ~25%.
// TODO: Default to Zstd in v3 to match rpm-rs new default in 0.16
.unwrap_or(rpm::CompressionWithLevel::Gzip(6));
let mut builder = rpm::PackageBuilder::new(&name, version, &license, arch, summary)
.epoch(epoch)
.release(release)
// This matches .deb compression. On a 240MB source binary the bundle will be 100KB larger than rpm's default while reducing build times by ~25%.
.compression(rpm::CompressionWithLevel::Gzip(6));
.compression(compression);
if let Some(description) = settings.long_description() {
builder = builder.description(description);
@@ -84,6 +99,17 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
builder = builder.provides(Dependency::any(dep));
}
// Add recommends
for dep in settings
.rpm()
.recommends
.as_ref()
.cloned()
.unwrap_or_default()
{
builder = builder.recommends(Dependency::any(dep));
}
// Add conflicts
for dep in settings
.rpm()
@@ -160,10 +186,10 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
FileOptions::new(resource_dir.to_string_lossy()).mode(FileMode::Dir { permissions: 0o755 }),
)?;
// Then add the resources files in that directory
for src in settings.resource_files() {
let src = src?;
let dest = resource_dir.join(tauri_utils::resources::resource_relpath(&src));
builder = builder.with_file(&src, FileOptions::new(dest.to_string_lossy()))?;
for resource in settings.resource_files().iter() {
let resource = resource?;
let dest = resource_dir.join(resource.target());
builder = builder.with_file(resource.path(), FileOptions::new(dest.to_string_lossy()))?;
}
}

View File

@@ -0,0 +1,59 @@
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
/// Change value of __TAURI_BUNDLE_TYPE static variable to mark which package type it was bundled in
#[cfg(target_os = "linux")]
pub fn patch_binary(
binary_path: &std::path::PathBuf,
package_type: &crate::PackageType,
) -> crate::Result<()> {
let mut file_data = std::fs::read(binary_path).expect("Could not read binary file.");
let elf = match goblin::Object::parse(&file_data)? {
goblin::Object::Elf(elf) => elf,
_ => return Err(crate::Error::GenericError("Not an ELF file".to_owned())),
};
let offset = find_bundle_type_symbol(elf).ok_or(crate::Error::MissingBundleTypeVar)?;
let offset = offset as usize;
if offset + 3 <= file_data.len() {
let chars = &mut file_data[offset..offset + 3];
match package_type {
crate::PackageType::Deb => chars.copy_from_slice(b"DEB"),
crate::PackageType::Rpm => chars.copy_from_slice(b"RPM"),
crate::PackageType::AppImage => chars.copy_from_slice(b"APP"),
_ => {
return Err(crate::Error::InvalidPackageType(
package_type.short_name().to_owned(),
"linux".to_owned(),
))
}
}
std::fs::write(binary_path, &file_data)
.map_err(|error| crate::Error::BinaryWriteError(error.to_string()))?;
} else {
return Err(crate::Error::BinaryOffsetOutOfRange);
}
Ok(())
}
/// Find address of a symbol in relocations table
#[cfg(target_os = "linux")]
fn find_bundle_type_symbol(elf: goblin::elf::Elf<'_>) -> Option<i64> {
for sym in elf.syms.iter() {
if let Some(name) = elf.strtab.get_at(sym.st_name) {
if name == "__TAURI_BUNDLE_TYPE" {
for reloc in elf.dynrelas.iter() {
if reloc.r_offset == sym.st_value {
return Some(reloc.r_addend.unwrap());
}
}
}
}
}
None
}

View File

@@ -23,11 +23,13 @@
// files into the `Contents` directory of the bundle.
use super::{
super::common::{self, CommandExt},
icon::create_icns_file,
sign::{notarize, notarize_auth, sign, NotarizeAuthError, SignTarget},
};
use crate::Settings;
use crate::{
utils::{fs_utils, CommandExt},
Settings,
};
use anyhow::Context;
@@ -63,15 +65,11 @@ 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))?;
.with_context(|| format!("Failed to remove old {app_product_name}"))?;
}
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)
.with_context(|| format!("Failed to create bundle directory at {bundle_directory:?}"))?;
let resources_dir = bundle_directory.join("Resources");
let bin_dir = bundle_directory.join("MacOS");
@@ -157,8 +155,8 @@ fn copy_binaries_to_bundle(
for bin in settings.binaries() {
let bin_path = settings.binary_path(bin);
let dest_path = dest_dir.join(bin.name());
common::copy_file(&bin_path, &dest_path)
.with_context(|| format!("Failed to copy binary from {:?}", bin_path))?;
fs_utils::copy_file(&bin_path, &dest_path)
.with_context(|| format!("Failed to copy binary from {bin_path:?}"))?;
paths.push(dest_path);
}
Ok(paths)
@@ -173,11 +171,11 @@ fn copy_custom_files_to_bundle(bundle_directory: &Path, settings: &Settings) ->
contents_path
};
if path.is_file() {
common::copy_file(path, bundle_directory.join(contents_path))
.with_context(|| format!("Failed to copy file {:?} to {:?}", path, contents_path))?;
fs_utils::copy_file(path, &bundle_directory.join(contents_path))
.with_context(|| format!("Failed to copy file {path:?} to {contents_path:?}"))?;
} else {
common::copy_dir(path, &bundle_directory.join(contents_path))
.with_context(|| format!("Failed to copy directory {:?} to {:?}", path, contents_path))?;
fs_utils::copy_dir(path, &bundle_directory.join(contents_path))
.with_context(|| format!("Failed to copy directory {path:?} to {contents_path:?}"))?;
}
}
Ok(())
@@ -189,12 +187,6 @@ fn create_info_plist(
bundle_icon_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());
@@ -218,13 +210,29 @@ fn create_info_plist(
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(
@@ -267,6 +275,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(),
@@ -346,10 +355,10 @@ 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() {
common::copy_dir(&src_path, &dest_dir.join(&src_name))?;
fs_utils::copy_dir(&src_path, &dest_dir.join(&src_name))?;
Ok(true)
} else {
Ok(false)
@@ -374,7 +383,7 @@ fn copy_frameworks_to_bundle(
}
let dest_dir = bundle_directory.join("Frameworks");
fs::create_dir_all(bundle_directory)
.with_context(|| format!("Failed to create Frameworks directory at {:?}", dest_dir))?;
.with_context(|| format!("Failed to create Frameworks directory at {dest_dir:?}"))?;
for framework in frameworks.iter() {
if framework.ends_with(".framework") {
let src_path = PathBuf::from(framework);
@@ -382,20 +391,19 @@ fn copy_frameworks_to_bundle(
.file_name()
.expect("Couldn't get framework filename");
let dest_path = dest_dir.join(src_name);
common::copy_dir(&src_path, &dest_path)?;
fs_utils::copy_dir(&src_path, &dest_path)?;
add_framework_sign_path(&src_path, &dest_path, &mut paths);
continue;
} 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
"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);
common::copy_file(&src_path, &dest_path)?;
fs_utils::copy_file(&src_path, &dest_path)?;
paths.push(SignTarget {
path: dest_path,
is_an_executable: false,
@@ -403,8 +411,7 @@ fn copy_frameworks_to_bundle(
continue;
} else if framework.contains('/') {
return Err(crate::Error::GenericError(format!(
"Framework path should have .framework extension: {}",
framework
"Framework path should have .framework extension: {framework}"
)));
}
if let Some(home_dir) = dirs::home_dir() {
@@ -422,8 +429,7 @@ fn copy_frameworks_to_bundle(
continue;
}
return Err(crate::Error::GenericError(format!(
"Could not locate framework: {}",
framework
"Could not locate framework: {framework}"
)));
}
Ok(paths)

View File

@@ -4,70 +4,22 @@
# SPDX-License-Identifier: MIT
# Create a read-only disk image of the contents of a folder
# forked from https://github.com/andreyvit/create-dmg
# forked from https://github.com/create-dmg/create-dmg
# Bail out on any unhandled errors
set -ex;
set -e;
# Any command that exits with non-zero code will cause the pipeline to fail
set -o pipefail;
function pure_version() {
echo '1.0.0.6'
}
CDMG_VERSION='1.2.1'
function version() {
echo "create-dmg $(pure_version)"
}
function usage() {
version
echo "Creates a fancy DMG file."
echo "Usage: $(basename "$0") [options] <output_name.dmg> <source_folder>"
echo "All contents of <source_folder> will be copied into the disk image."
echo "Options:"
echo " --volname name"
echo " set volume name (displayed in the Finder sidebar and window title)"
echo " --volicon icon.icns"
echo " set volume icon"
echo " --background pic.png"
echo " set folder background image (provide png, gif, jpg)"
echo " --window-pos x y"
echo " set position the folder window"
echo " --window-size width height"
echo " set size of the folder window"
echo " --text-size text_size"
echo " set window text size (10-16)"
echo " --icon-size icon_size"
echo " set window icons size (up to 128)"
echo " --icon file_name x y"
echo " set position of the file's icon"
echo " --hide-extension file_name"
echo " hide the extension of file"
echo " --app-drop-link x y"
echo " make a drop link to Applications, at location x,y"
echo " --ql-drop-link x y"
echo " make a drop link to user QuickLook install dir, at location x,y"
echo " --eula eula_file"
echo " attach a license file to the dmg"
echo " --no-internet-enable"
echo " disable automatic mount&copy"
echo " --format"
echo " specify the final image format (default is UDZO)"
echo " --add-file target_name file|folder x y"
echo " add additional file or folder (can be used multiple times)"
echo " --disk-image-size x"
echo " set the disk image size manually to x MB"
echo " --hdiutil-verbose"
echo " execute hdiutil in verbose mode"
echo " --hdiutil-quiet"
echo " execute hdiutil in quiet mode"
echo " --bless"
echo " bless the mount folder (deprecated, needs macOS 12.2.1 or older)"
echo " --sandbox-safe"
echo " execute hdiutil with sandbox compatibility, do not bless and do not execute the cosmetic AppleScript"
echo " --version show tool version number"
echo " -h, --help display this help"
exit 0
}
# The full path to the "support/" directory this script is using
# (This will be set up by code later in the script.)
CDMG_SUPPORT_DIR=""
OS_FULL_VERSION="$(sw_vers | sed -n 2p | cut -d : -f 2 | tr -d '[:space:]' | cut -c1-)"
OS_MAJOR_VERSION="$(echo $OS_FULL_VERSION | cut -d . -f 1)"
OS_MINOR_VERSION="$(echo $OS_FULL_VERSION | cut -d . -f 2)"
WINX=10
WINY=60
WINW=500
@@ -75,6 +27,7 @@ WINH=350
ICON_SIZE=128
TEXT_SIZE=16
FORMAT="UDZO"
FILESYSTEM="HFS+"
ADD_FILE_SOURCES=()
ADD_FILE_TARGETS=()
IMAGEKEY=""
@@ -83,116 +36,259 @@ SANDBOX_SAFE=0
BLESS=0
SKIP_JENKINS=0
MAXIMUM_UNMOUNTING_ATTEMPTS=3
POSITION_CLAUSE=""
HIDING_CLAUSE=""
SIGNATURE=""
NOTARIZE=""
function pure_version() {
echo "$CDMG_VERSION"
}
function hdiutil_detach_retry() {
# Unmount
unmounting_attempts=0
until
echo "Unmounting disk image..."
(( unmounting_attempts++ ))
hdiutil detach "$1"
exit_code=$?
(( exit_code == 0 )) && break # nothing goes wrong
(( exit_code != 16 )) && exit $exit_code # exit with the original exit code
# The above statement returns 1 if test failed (exit_code == 16).
# It can make the code in the {do... done} block to be executed
do
(( unmounting_attempts == MAXIMUM_UNMOUNTING_ATTEMPTS )) && exit 16 # patience exhausted, exit with code EBUSY
echo "Wait a moment..."
sleep $(( 1 * (2 ** unmounting_attempts) ))
done
unset unmounting_attempts
}
function version() {
echo "create-dmg $(pure_version)"
}
function usage() {
version
cat <<EOHELP
Creates a fancy DMG file.
Usage: $(basename $0) [options] <output_name.dmg> <source_folder>
All contents of <source_folder> will be copied into the disk image.
Options:
--volname <name>
set volume name (displayed in the Finder sidebar and window title)
--volicon <icon.icns>
set volume icon
--background <pic.png>
set folder background image (provide png, gif, or jpg)
--window-pos <x> <y>
set position the folder window
--window-size <width> <height>
set size of the folder window
--text-size <text_size>
set window text size (10-16)
--icon-size <icon_size>
set window icons size (up to 128)
--icon file_name <x> <y>
set position of the file's icon
--hide-extension <file_name>
hide the extension of file
--app-drop-link <x> <y>
make a drop link to Applications, at location x,y
--ql-drop-link <x> <y>
make a drop link to user QuickLook install dir, at location x,y
--eula <eula_file>
attach a license file to the dmg (plain text or RTF)
--no-internet-enable
disable automatic mount & copy
--format <format>
specify the final disk image format (UDZO|UDBZ|ULFO|ULMO) (default is UDZO)
--filesystem <filesystem>
specify the disk image filesystem (HFS+|APFS) (default is HFS+, APFS supports macOS 10.13 or newer)
--encrypt
enable encryption for the resulting disk image (AES-256 - you will be prompted for password)
--encrypt-aes128
enable encryption for the resulting disk image (AES-128 - you will be prompted for password)
--add-file <target_name> <file>|<folder> <x> <y>
add additional file or folder (can be used multiple times)
--disk-image-size <x>
set the disk image size manually to x MB
--hdiutil-verbose
execute hdiutil in verbose mode
--hdiutil-quiet
execute hdiutil in quiet mode
--bless
bless the mount folder (deprecated, needs macOS 12.2.1 or older)
--codesign <signature>
codesign the disk image with the specified signature
--notarize <credentials>
notarize the disk image (waits and staples) with the keychain stored credentials
--sandbox-safe
execute hdiutil with sandbox compatibility and do not bless (not supported for APFS disk images)
--skip-jenkins
skip Finder-prettifying AppleScript, useful in Sandbox and non-GUI environments
--version
show create-dmg version number
-h, --help
display this help screen
EOHELP
exit 0
}
# factors can cause interstitial disk images to contain more than a single
# partition - expand the hunt for the temporary disk image by checking for
# the path of the volume, versus assuming its the first result (as in pr/152).
function find_mount_dir() {
local dev_name="${1}"
>&2 echo "Searching for mounted interstitial disk image using ${dev_name}... "
# enumerate up to 9 partitions
for i in {1..9}; do
# attempt to find the partition
local found_dir
found_dir=$(hdiutil info | grep -E --color=never "${dev_name}" | head -${i} | awk '{print $3}' | xargs)
if [[ -n "${found_dir}" ]]; then
echo "${found_dir}"
return 0
fi
done
}
# Argument parsing
while [[ "${1:0:1}" = "-" ]]; do
case $1 in
--volname)
VOLUME_NAME="$2"
shift; shift;;
--volicon)
VOLUME_ICON_FILE="$2"
shift; shift;;
--background)
BACKGROUND_FILE="$2"
BACKGROUND_FILE_NAME="$(basename "$BACKGROUND_FILE")"
BACKGROUND_CLAUSE="set background picture of opts to file \".background:$BACKGROUND_FILE_NAME\""
REPOSITION_HIDDEN_FILES_CLAUSE="set position of every item to {theBottomRightX + 100, 100}"
shift; shift;;
--icon-size)
ICON_SIZE="$2"
shift; shift;;
--text-size)
TEXT_SIZE="$2"
shift; shift;;
--window-pos)
WINX=$2; WINY=$3
shift; shift; shift;;
--window-size)
WINW=$2; WINH=$3
shift; shift; shift;;
--icon)
POSITION_CLAUSE="${POSITION_CLAUSE}set position of item \"$2\" to {$3, $4}
"
shift; shift; shift; shift;;
--hide-extension)
HIDING_CLAUSE="${HIDING_CLAUSE}set the extension hidden of item \"$2\" to true
"
shift; shift;;
-h | --help)
usage;;
--version)
version; exit 0;;
--pure-version)
pure_version; exit 0;;
--ql-drop-link)
QL_LINK=$2
QL_CLAUSE="set position of item \"QuickLook\" to {$2, $3}
"
shift; shift; shift;;
--app-drop-link)
APPLICATION_LINK=$2
APPLICATION_CLAUSE="set position of item \"Applications\" to {$2, $3}
"
shift; shift; shift;;
--eula)
EULA_RSRC=$2
shift; shift;;
--no-internet-enable)
NOINTERNET=1
shift;;
--format)
FORMAT="$2"
shift; shift;;
--add-file | --add-folder)
ADD_FILE_TARGETS+=("$2")
ADD_FILE_SOURCES+=("$3")
POSITION_CLAUSE="${POSITION_CLAUSE}
set position of item \"$2\" to {$4, $5}
"
shift; shift; shift; shift; shift;;
--disk-image-size)
DISK_IMAGE_SIZE="$2"
shift; shift;;
--hdiutil-verbose)
HDIUTIL_VERBOSITY='-verbose'
shift;;
--hdiutil-quiet)
HDIUTIL_VERBOSITY='-quiet'
shift;;
--sandbox-safe)
SANDBOX_SAFE=1
shift;;
--bless)
BLESS=1
shift;;
--skip-jenkins)
SKIP_JENKINS=1
shift;;
-*)
echo "Unknown option: $1. Run with --help for help."
exit 1;;
--volname)
VOLUME_NAME="$2"
shift; shift;;
--volicon)
VOLUME_ICON_FILE="$2"
shift; shift;;
--background)
BACKGROUND_FILE="$2"
BACKGROUND_FILE_NAME="$(basename "$BACKGROUND_FILE")"
BACKGROUND_CLAUSE="set background picture of opts to file \".background:$BACKGROUND_FILE_NAME\""
REPOSITION_HIDDEN_FILES_CLAUSE="set position of every item to {theBottomRightX + 100, 100}"
shift; shift;;
--icon-size)
ICON_SIZE="$2"
shift; shift;;
--text-size)
TEXT_SIZE="$2"
shift; shift;;
--window-pos)
WINX=$2; WINY=$3
shift; shift; shift;;
--window-size)
WINW=$2; WINH=$3
shift; shift; shift;;
--icon)
POSITION_CLAUSE="${POSITION_CLAUSE}set position of item \"$2\" to {$3, $4}
"
shift; shift; shift; shift;;
--hide-extension)
HIDING_CLAUSE="${HIDING_CLAUSE}set the extension hidden of item \"$2\" to true
"
shift; shift;;
-h | --help)
usage;;
--version)
version; exit 0;;
--pure-version)
pure_version; exit 0;;
--ql-drop-link)
QL_LINK=$2
QL_CLAUSE="set position of item \"QuickLook\" to {$2, $3}
"
shift; shift; shift;;
--app-drop-link)
APPLICATION_LINK=$2
APPLICATION_CLAUSE="set position of item \"Applications\" to {$2, $3}
"
shift; shift; shift;;
--eula)
EULA_RSRC=$2
shift; shift;;
--no-internet-enable)
NOINTERNET=1
shift;;
--format)
FORMAT="$2"
shift; shift;;
--filesystem)
FILESYSTEM="$2"
shift; shift;;
--encrypt)
ENABLE_ENCRYPTION=1
AESBITS=256
shift;;
--encrypt-aes128)
ENABLE_ENCRYPTION=1
AESBITS=128
shift;;
--add-file | --add-folder)
ADD_FILE_TARGETS+=("$2")
ADD_FILE_SOURCES+=("$3")
POSITION_CLAUSE="${POSITION_CLAUSE}
set position of item \"$2\" to {$4, $5}
"
shift; shift; shift; shift; shift;;
--disk-image-size)
DISK_IMAGE_SIZE="$2"
shift; shift;;
--hdiutil-verbose)
HDIUTIL_VERBOSITY='-verbose'
shift;;
--hdiutil-quiet)
HDIUTIL_VERBOSITY='-quiet'
shift;;
--codesign)
SIGNATURE="$2"
shift; shift;;
--notarize)
NOTARIZE="$2"
shift; shift;;
--sandbox-safe)
SANDBOX_SAFE=1
shift;;
--bless)
BLESS=1
shift;;
--rez)
echo "REZ is no more directly used. You can remove the --rez argument."
shift; shift;;
--skip-jenkins)
SKIP_JENKINS=1
shift;;
-*)
echo "Unknown option: $1. Run 'create-dmg --help' for help."
exit 1;;
esac
case $FORMAT in
UDZO)
IMAGEKEY="-imagekey zlib-level=9";;
UDBZ)
IMAGEKEY="-imagekey bzip2-level=9";;
UDZO)
IMAGEKEY="-imagekey zlib-level=9";;
UDBZ)
IMAGEKEY="-imagekey bzip2-level=9";;
ULFO)
;;
ULMO)
;;
*)
echo >&2 "Unknown disk image format: $FORMAT"
exit 1;;
esac
done
if [[ -z "$2" ]]; then
echo "Not enough arguments. Invoke with --help for help."
echo "Not enough arguments. Run 'create-dmg --help' for help."
exit 1
fi
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
DMG_PATH="$1"
DMG_DIRNAME="$(dirname "$DMG_PATH")"
DMG_DIR="$(cd "$DMG_DIRNAME" > /dev/null; pwd)"
DMG_NAME="$(basename "$DMG_PATH")"
DMG_TEMP_NAME="$DMG_DIR/rw.${DMG_NAME}"
SRC_FOLDER="$(cd "$2" > /dev/null; pwd)"
# Argument validation checks
@@ -202,24 +298,48 @@ if [[ "${DMG_PATH: -4}" != ".dmg" ]]; then
exit 1
fi
if [[ "${FILESYSTEM}" != "HFS+" ]] && [[ "${FILESYSTEM}" != "APFS" ]]; then
echo "Unknown disk image filesystem: ${FILESYSTEM}. Run 'create-dmg --help' for help."
exit 1
fi
if [[ "${FILESYSTEM}" == "APFS" ]] && [[ ${SANDBOX_SAFE} -eq 1 ]]; then
echo "Creating an APFS disk image that is sandbox safe is not supported."
exit 1
fi
# Main script logic
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
DMG_DIRNAME="$(dirname "$DMG_PATH")"
DMG_DIR="$(cd "$DMG_DIRNAME" > /dev/null; pwd)"
DMG_NAME="$(basename "$DMG_PATH")"
DMG_TEMP_NAME="$DMG_DIR/rw.$$.${DMG_NAME}"
# Detect where we're running from
sentinel_file="$SCRIPT_DIR/.this-is-the-create-dmg-repo"
if [[ -f "$sentinel_file" ]]; then
# We're running from inside a repo
CDMG_SUPPORT_DIR="$SCRIPT_DIR/support"
else
# We're running inside an installed location
bin_dir="$SCRIPT_DIR"
prefix_dir=$(dirname "$bin_dir")
CDMG_SUPPORT_DIR="$prefix_dir/share/create-dmg/support"
fi
if [[ -z "$VOLUME_NAME" ]]; then
VOLUME_NAME="$(basename "$DMG_PATH" .dmg)"
fi
# brew formula will set this as 1 and embed the support scripts
BREW_INSTALL=0
AUX_PATH="$SCRIPT_DIR/support"
if [ $BREW_INSTALL -eq 0 ]; then
test -d "$AUX_PATH" || {
echo "Cannot find support directory: $AUX_PATH"
exit 1
}
if [[ ! -d "$CDMG_SUPPORT_DIR" ]]; then
echo >&2 "Cannot find support/ directory: expected at: $CDMG_SUPPORT_DIR"
exit 1
fi
if [[ -f "$SRC_FOLDER/.DS_Store" ]]; then
echo "Deleting any .DS_Store in source folder"
echo "Deleting .DS_Store found in source folder"
rm "$SRC_FOLDER/.DS_Store"
fi
@@ -229,7 +349,7 @@ if [[ -f "${DMG_TEMP_NAME}" ]]; then
rm -f "${DMG_TEMP_NAME}"
fi
# Using Megabytes since hdiutil fails with very large Byte numbers
# Use Megabytes since hdiutil fails with very large byte numbers
function blocks_to_megabytes() {
# Add 1 extra MB, since there's no decimal retention here
MB_SIZE=$((($1 * 512 / 1000 / 1000) + 1))
@@ -238,8 +358,13 @@ function blocks_to_megabytes() {
function get_size() {
# Get block size in disk
bytes_size=$(du -s "$1" | sed -e 's/ .*//g')
echo $(blocks_to_megabytes "$bytes_size")
if [[ $OS_MAJOR_VERSION -ge 12 ]]; then
bytes_size=$(du -B 512 -s "$1")
else
bytes_size=$(du -s "$1")
fi
bytes_size=$(echo $bytes_size | sed -e 's/ .*//g')
echo $(blocks_to_megabytes $bytes_size)
}
# Create the DMG with the specified size or the hdiutil estimation
@@ -248,8 +373,14 @@ if [[ -n "$DISK_IMAGE_SIZE" ]]; then
CUSTOM_SIZE="-size ${DISK_IMAGE_SIZE}m"
fi
if [ $SANDBOX_SAFE -eq 0 ]; then
hdiutil create ${HDIUTIL_VERBOSITY} -srcfolder "$SRC_FOLDER" -volname "${VOLUME_NAME}" -fs HFS+ -fsargs "-c c=64,a=16,e=16" -format UDRW ${CUSTOM_SIZE} "${DMG_TEMP_NAME}"
if [[ $SANDBOX_SAFE -eq 0 ]]; then
if [[ "$FILESYSTEM" == "APFS" ]]; then
FILESYSTEM_ARGUMENTS=""
else
FILESYSTEM_ARGUMENTS="-c c=64,a=16,e=16"
fi
hdiutil create ${HDIUTIL_VERBOSITY} -srcfolder "$SRC_FOLDER" -volname "${VOLUME_NAME}" \
-fs "${FILESYSTEM}" -fsargs "${FILESYSTEM_ARGUMENTS}" -format UDRW ${CUSTOM_SIZE} "${DMG_TEMP_NAME}"
else
hdiutil makehybrid ${HDIUTIL_VERBOSITY} -default-volume-name "${VOLUME_NAME}" -hfs -o "${DMG_TEMP_NAME}" "$SRC_FOLDER"
hdiutil convert -format UDRW -ov -o "${DMG_TEMP_NAME}" "${DMG_TEMP_NAME}"
@@ -260,7 +391,7 @@ fi
DISK_IMAGE_SIZE=$(get_size "${DMG_TEMP_NAME}")
# Use the custom size if bigger
if [[ $SANDBOX_SAFE -eq 1 ]] && [[ -n "$DISK_IMAGE_SIZE_CUSTOM" ]] && [[ $DISK_IMAGE_SIZE_CUSTOM -gt $DISK_IMAGE_SIZE ]]; then
if [[ $SANDBOX_SAFE -eq 1 ]] && [[ ! -z "$DISK_IMAGE_SIZE_CUSTOM" ]] && [[ $DISK_IMAGE_SIZE_CUSTOM -gt $DISK_IMAGE_SIZE ]]; then
DISK_IMAGE_SIZE=$DISK_IMAGE_SIZE_CUSTOM
fi
@@ -278,28 +409,39 @@ DISK_IMAGE_SIZE=$(expr $DISK_IMAGE_SIZE + 20)
# Make sure target image size is within limits
MIN_DISK_IMAGE_SIZE=$(hdiutil resize -limits "${DMG_TEMP_NAME}" | awk 'NR=1{print int($1/2048+1)}')
if [ $MIN_DISK_IMAGE_SIZE -gt $DISK_IMAGE_SIZE ]; then
DISK_IMAGE_SIZE=$MIN_DISK_IMAGE_SIZE
DISK_IMAGE_SIZE=$MIN_DISK_IMAGE_SIZE
fi
# Resize the image for the extra stuff
hdiutil resize ${HDIUTIL_VERBOSITY} -size ${DISK_IMAGE_SIZE}m "${DMG_TEMP_NAME}"
# mount the new DMG
echo "Mounting disk image..."
MOUNT_DIR="/Volumes/${VOLUME_NAME}"
# Mount the new DMG
# Unmount leftover dmg if it was mounted previously (e.g. developer mounted dmg, installed app and forgot to unmount it)
if [[ -d "${MOUNT_DIR}" ]]; then
echo "Unmounting previously mounted disk image..."
DEV_NAME=$(hdiutil info | grep -E --color=never '^/dev/' | sed 1q | awk '{print $1}')
hdiutil detach "${DEV_NAME}"
echo "Mounting disk image..."
MOUNT_RANDOM_PATH="/Volumes"
if [[ $SANDBOX_SAFE -eq 1 ]]; then
MOUNT_RANDOM_PATH="/tmp"
fi
if [[ "$FILESYSTEM" == "APFS" ]]; then
HDIUTIL_FILTER="tail -n 1"
else
HDIUTIL_FILTER="sed 1q"
fi
DEV_NAME=$(hdiutil attach -mountrandom ${MOUNT_RANDOM_PATH} -readwrite -noverify -noautoopen -nobrowse "${DMG_TEMP_NAME}" | grep -E --color=never '^/dev/' | ${HDIUTIL_FILTER} | awk '{print $1}')
echo "Device name: $DEV_NAME"
if [[ "$FILESYSTEM" == "APFS" ]]; then
MOUNT_DIR=$(find_mount_dir "${DEV_NAME}")
else
MOUNT_DIR=$(find_mount_dir "${DEV_NAME}s")
fi
if [[ -z "${MOUNT_DIR}" ]]; then
>&2 echo "ERROR: unable to proceed with final disk image creation because the interstitial disk image was not found."
>&2 echo "The interstitial disk image will likely be mounted and will need to be cleaned up manually."
exit 1
fi
echo "Mounting disk image..."
echo "Mount directory: $MOUNT_DIR"
DEV_NAME=$(hdiutil attach -readwrite -noverify -noautoopen "${DMG_TEMP_NAME}" | grep -E --color=never '^/dev/' | sed 1q | awk '{print $1}')
echo "Device name: $DEV_NAME"
echo "Mount dir: $MOUNT_DIR"
if [[ -n "$BACKGROUND_FILE" ]]; then
echo "Copying background file '$BACKGROUND_FILE'..."
@@ -308,12 +450,14 @@ if [[ -n "$BACKGROUND_FILE" ]]; then
fi
if [[ -n "$APPLICATION_LINK" ]]; then
echo "making link to Applications dir"
test -d "$MOUNT_DIR/Applications" || ln -s /Applications "$MOUNT_DIR/Applications"
echo "Making link to Applications dir..."
echo $MOUNT_DIR
ln -s /Applications "$MOUNT_DIR/Applications"
fi
if [[ -n "$QL_LINK" ]]; then
echo "making link to QuickLook install dir"
echo "Making link to QuickLook install dir..."
echo $MOUNT_DIR
ln -s "/Library/QuickLook" "$MOUNT_DIR/QuickLook"
fi
@@ -331,24 +475,15 @@ if [[ -n "$ADD_FILE_SOURCES" ]]; then
done
fi
# run AppleScript to do all the Finder cosmetic stuff
VOLUME_NAME=$(basename $MOUNT_DIR)
# Run AppleScript to do all the Finder cosmetic stuff
APPLESCRIPT_FILE=$(mktemp -t createdmg.tmp.XXXXXXXXXX)
function applescript_source() {
if [ $BREW_INSTALL -eq 0 ]; then
cat "$AUX_PATH/template.applescript"
else
cat << 'EOS'
# BREW_INLINE_APPLESCRIPT_PLACEHOLDER
EOS
fi
}
if [[ $SANDBOX_SAFE -eq 1 ]]; then
echo "Skipping Finder-prettifying AppleScript because we are in Sandbox..."
else
if [[ $SKIP_JENKINS -eq 0 ]]; then
applescript_source \
cat "$CDMG_SUPPORT_DIR/template.applescript" \
| sed -e "s/WINX/$WINX/g" -e "s/WINY/$WINY/g" -e "s/WINW/$WINW/g" \
-e "s/WINH/$WINH/g" -e "s/BACKGROUND_CLAUSE/$BACKGROUND_CLAUSE/g" \
-e "s/REPOSITION_HIDDEN_FILES_CLAUSE/$REPOSITION_HIDDEN_FILES_CLAUSE/g" \
@@ -358,71 +493,76 @@ else
| perl -pe "s/APPLICATION_CLAUSE/$APPLICATION_CLAUSE/g" \
| perl -pe "s/HIDING_CLAUSE/$HIDING_CLAUSE/" \
> "$APPLESCRIPT_FILE"
sleep 2 # pause to workaround occasional "Can't get disk" (-1728) issues
# pause to workaround occasional "Cant get disk" (-1728) issues
ERROR_1728_WORKAROUND_SLEEP_INTERVAL=2
echo "Will sleep for $ERROR_1728_WORKAROUND_SLEEP_INTERVAL seconds to workaround occasions \"Can't get disk (-1728)\" issues..."
sleep $ERROR_1728_WORKAROUND_SLEEP_INTERVAL
echo "Running AppleScript to make Finder stuff pretty: /usr/bin/osascript \"${APPLESCRIPT_FILE}\" \"${VOLUME_NAME}\""
if /usr/bin/osascript "${APPLESCRIPT_FILE}" "${VOLUME_NAME}"; then
# Okay, we're cool
true
else
echo >&2 "Failed running AppleScript"
hdiutil detach "${DEV_NAME}"
hdiutil_detach_retry "${DEV_NAME}"
exit 64
fi
echo "Done running the AppleScript..."
sleep 4
rm "$APPLESCRIPT_FILE"
else
echo ''
echo "Will skip running AppleScript to configure DMG aesthetics because of --skip-jenkins option."
echo "This will result in a DMG without any custom background or icons positioning."
echo "More info at https://github.com/create-dmg/create-dmg/issues/72"
echo ''
fi
fi
# make sure it's not world writeable
# Make sure it's not world writeable
echo "Fixing permissions..."
chmod -Rf go-w "${MOUNT_DIR}" &> /dev/null || true
echo "Done fixing permissions."
echo "Done fixing permissions"
# make the top window open itself on mount:
# Make the top window open itself on mount:
if [[ $BLESS -eq 1 && $SANDBOX_SAFE -eq 0 ]]; then
echo "Blessing started"
bless --folder "${MOUNT_DIR}" --openfolder "${MOUNT_DIR}"
if [ $(uname -m) == "arm64" ]; then
bless --folder "${MOUNT_DIR}"
else
bless --folder "${MOUNT_DIR}" --openfolder "${MOUNT_DIR}"
fi
echo "Blessing finished"
else
echo "Skipping blessing on sandbox"
fi
if [[ -n "$VOLUME_ICON_FILE" ]]; then
# tell the volume that it has a special file attribute
# Tell the volume that it has a special file attribute
SetFile -a C "$MOUNT_DIR"
fi
# Delete unnecessary file system events log
# Delete unnecessary file system events log if possible
echo "Deleting .fseventsd"
rm -rf "${MOUNT_DIR}/.fseventsd"
rm -rf "${MOUNT_DIR}/.fseventsd" || true
# unmount
unmounting_attempts=0
until
echo "Unmounting disk image..."
(( unmounting_attempts++ ))
hdiutil detach "${DEV_NAME}"
exit_code=$?
(( exit_code == 0 )) && break # nothing goes wrong
(( exit_code != 16 )) && exit $exit_code # exit with the original exit code
# The above statement returns 1 if test failed (exit_code == 16).
# It can make the code in the {do... done} block to be executed
do
(( unmounting_attempts == MAXIMUM_UNMOUNTING_ATTEMPTS )) && exit 16 # patience exhausted, exit with code EBUSY
echo "Wait a moment..."
sleep $(( 1 * (2 ** unmounting_attempts) ))
done
unset unmounting_attempts
hdiutil_detach_retry "${DEV_NAME}"
# compress image
echo "Compressing disk image..."
hdiutil convert ${HDIUTIL_VERBOSITY} "${DMG_TEMP_NAME}" -format "${FORMAT}" ${IMAGEKEY} -o "${DMG_DIR}/${DMG_NAME}"
# Compress image and optionally encrypt
if [[ $ENABLE_ENCRYPTION -eq 0 ]]; then
echo "Compressing disk image..."
hdiutil convert ${HDIUTIL_VERBOSITY} "${DMG_TEMP_NAME}" -format ${FORMAT} ${IMAGEKEY} -o "${DMG_DIR}/${DMG_NAME}"
else
echo "Compressing and encrypting disk image..."
echo "NOTE: hdiutil will only prompt a single time for a password - ensure entry is correct."
hdiutil convert ${HDIUTIL_VERBOSITY} "${DMG_TEMP_NAME}" -format ${FORMAT} ${IMAGEKEY} -encryption AES-${AESBITS} -stdinpass -o "${DMG_DIR}/${DMG_NAME}"
fi
rm -f "${DMG_TEMP_NAME}"
# adding EULA resources
# Adding EULA resources
if [[ -n "${EULA_RSRC}" && "${EULA_RSRC}" != "-null-" ]]; then
echo "adding EULA resources"
echo "Adding EULA resources..."
#
# Use udifrez instead flatten/rez/unflatten
# https://github.com/create-dmg/create-dmg/issues/109
@@ -431,20 +571,19 @@ if [[ -n "${EULA_RSRC}" && "${EULA_RSRC}" != "-null-" ]]; then
# https://developer.apple.com/forums/thread/668084
#
EULA_RESOURCES_FILE=$(mktemp -t createdmg.tmp.XXXXXXXXXX)
EULA_FORMAT=$(file -b "${EULA_RSRC}")
EULA_FORMAT=$(file -b ${EULA_RSRC})
if [[ ${EULA_FORMAT} == 'Rich Text Format data'* ]] ; then
EULA_FORMAT='RTF '
else
EULA_FORMAT='TEXT'
fi
# Encode the EULA to base64
# Replace 'openssl base64' with 'base64' if Mac OS X 10.6 support is no more needed
# EULA_DATA="$(base64 -b 52 "${EULA_RSRC}" | sed s$'/^\(.*\)$/\t\t\t\\1/')"
EULA_DATA="$(openssl base64 -in "${EULA_RSRC}" | tr -d '\n' | awk '{gsub(/.{52}/,"&\n")}1' | sed s$'/^\(.*\)$/\t\t\t\\1/')"
# Fill the template with the custom EULA contents
eval "cat > \"${EULA_RESOURCES_FILE}\" <<EOF
$(<${AUX_PATH}/eula-resources-template.xml)
$(<${CDMG_SUPPORT_DIR}/eula-resources-template.xml)
EOF
"
# Apply the resources
@@ -455,19 +594,45 @@ if [[ -n "${EULA_RSRC}" && "${EULA_RSRC}" != "-null-" ]]; then
echo "Successfully added the EULA license"
fi
if [[ -n "${NOINTERNET}" && "${NOINTERNET}" == 1 ]]; then
echo "not setting 'internet-enable' on the dmg"
# Enable "internet", whatever that is
if [[ ! -z "${NOINTERNET}" && "${NOINTERNET}" == 1 ]]; then
echo "Not setting 'internet-enable' on the dmg, per caller request"
else
# check if hdiutil supports internet-enable
# support was removed in macOS 10.15
# https://github.com/andreyvit/create-dmg/issues/76
if hdiutil internet-enable -help >/dev/null 2>/dev/null
then
# Check if hdiutil supports internet-enable
# Support was removed in macOS 10.15. See https://github.com/andreyvit/create-dmg/issues/76
if hdiutil internet-enable -help >/dev/null 2>/dev/null; then
hdiutil internet-enable -yes "${DMG_DIR}/${DMG_NAME}"
else
echo "hdiutil does not support internet-enable. Note it was removed in macOS 10.15."
fi
fi
if [[ -n "${SIGNATURE}" && "${SIGNATURE}" != "-null-" ]]; then
echo "Codesign started"
codesign -s "${SIGNATURE}" "${DMG_DIR}/${DMG_NAME}"
dmgsignaturecheck="$(codesign --verify --deep --verbose=2 --strict "${DMG_DIR}/${DMG_NAME}" 2>&1 >/dev/null)"
if [ $? -eq 0 ]; then
echo "The disk image is now codesigned"
else
echo "The signature seems invalid${NC}"
exit 1
fi
fi
if [[ -n "${NOTARIZE}" && "${NOTARIZE}" != "-null-" ]]; then
echo "Notarization started"
xcrun notarytool submit "${DMG_DIR}/${DMG_NAME}" --keychain-profile "${NOTARIZE}" --wait
echo "Stapling the notarization ticket"
staple="$(xcrun stapler staple "${DMG_DIR}/${DMG_NAME}")"
if [ $? -eq 0 ]; then
echo "The disk image is now notarized"
else
echo "$staple"
echo "The notarization failed with error $?"
exit 1
fi
fi
# All done!
echo "Disk image done"
exit 0

View File

@@ -5,7 +5,8 @@
use super::{app, icon::create_icns_file};
use crate::{
bundle::{common::CommandExt, settings::Arch, Bundle},
bundle::{settings::Arch, Bundle},
utils::CommandExt,
PackageType, Settings,
};
@@ -48,8 +49,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:?}"
)));
}
}
@@ -58,20 +58,21 @@ 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.join("support");
if output_path.exists() {
fs::remove_dir_all(&output_path)
.with_context(|| format!("Failed to remove old {}", dmg_name))?;
let support_directory_path = output_path
.parent()
.unwrap()
.join("share/create-dmg/support");
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::create_dir_all(path)
.with_context(|| format!("Failed to create output directory at {path:?}"))?;
}
fs::create_dir_all(&support_directory_path).with_context(|| {
format!(
"Failed to create output directory at {:?}",
support_directory_path
)
})?;
// create paths for script
let bundle_script_path = output_path.join("bundle_dmg.sh");
@@ -172,9 +173,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 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" {
if let Some(value) = env::var_os("CI") {
if value == "true" {
bundle_dmg_cmd.arg("--skip-jenkins");
}
}
}
@@ -190,16 +193,19 @@ pub fn bundle_project(settings: &Settings, bundles: &[Bundle]) -> crate::Result<
fs::rename(bundle_dir.join(dmg_name), dmg_path.clone())?;
// Sign DMG if needed
if let Some(keychain) = super::sign::keychain(settings.macos().signing_identity.as_deref())? {
super::sign::sign(
&keychain,
vec![super::sign::SignTarget {
path: dmg_path.clone(),
is_an_executable: false,
}],
settings,
)?;
// 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,
)?;
}
}
Ok(Bundled {

View File

@@ -3,7 +3,8 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
use crate::bundle::{common, Settings};
use crate::bundle::Settings;
use crate::utils::{self, fs_utils};
use std::{
cmp::min,
ffi::OsStr,
@@ -28,7 +29,7 @@ pub fn create_icns_file(out_dir: &Path, settings: &Settings) -> crate::Result<Op
if icon_path.extension() == Some(OsStr::new("icns")) {
let mut dest_path = out_dir.to_path_buf();
dest_path.push(icon_path.file_name().expect("Could not get icon filename"));
common::copy_file(&icon_path, &dest_path)?;
fs_utils::copy_file(&icon_path, &dest_path)?;
return Ok(Some(dest_path));
}
}
@@ -63,7 +64,7 @@ pub fn create_icns_file(out_dir: &Path, settings: &Settings) -> crate::Result<Op
for icon_path in settings.icon_files() {
let icon_path = icon_path?;
let icon = image::open(&icon_path)?;
let density = if common::is_retina(&icon_path) { 2 } else { 1 };
let density = if utils::is_retina(&icon_path) { 2 } else { 1 };
let (w, h) = icon.dimensions();
let orig_size = min(w, h);
let next_size_down = 2f32.powf((orig_size as f32).log2().floor()) as u32;

View File

@@ -13,7 +13,10 @@
// See https://developer.apple.com/go/?id=bundle-structure for a full
// explanation.
use crate::{bundle::common, Settings};
use crate::{
utils::{self, fs_utils},
Settings,
};
use anyhow::Context;
use image::{codecs::png::PngDecoder, GenericImageView, ImageDecoder};
@@ -42,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))?;
.with_context(|| format!("Failed to remove old {app_product_name}"))?;
}
fs::create_dir_all(&app_bundle_path)
.with_context(|| format!("Failed to create bundle directory at {:?}", app_bundle_path))?;
.with_context(|| format!("Failed to create bundle directory at {app_bundle_path:?}"))?;
for src in settings.resource_files() {
let src = src?;
let dest = app_bundle_path.join(tauri_utils::resources::resource_relpath(&src));
common::copy_file(&src, &dest)
.with_context(|| format!("Failed to copy resource file {:?}", src))?;
fs_utils::copy_file(&src, &dest)
.with_context(|| format!("Failed to copy resource file {src:?}"))?;
}
let icon_filenames = generate_icon_files(&app_bundle_path, settings)
@@ -61,8 +64,8 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
for bin in settings.binaries() {
let bin_path = settings.binary_path(bin);
common::copy_file(&bin_path, app_bundle_path.join(bin.name()))
.with_context(|| format!("Failed to copy binary from {:?}", bin_path))?;
fs_utils::copy_file(&bin_path, &app_bundle_path.join(bin.name()))
.with_context(|| format!("Failed to copy binary from {bin_path:?}"))?;
}
Ok(vec![app_bundle_path])
@@ -93,11 +96,11 @@ fn generate_icon_files(bundle_dir: &Path, settings: &Settings) -> crate::Result<
let decoder = PngDecoder::new(BufReader::new(File::open(&icon_path)?))?;
let width = decoder.dimensions().0;
let height = decoder.dimensions().1;
let is_retina = common::is_retina(&icon_path);
let is_retina = utils::is_retina(&icon_path);
if !sizes.contains(&(width, height, is_retina)) {
sizes.insert((width, height, is_retina));
let dest_path = get_dest_path(width, height, is_retina);
common::copy_file(&icon_path, &dest_path)?;
fs_utils::copy_file(&icon_path, &dest_path)?;
}
}
// Fall back to non-PNG files for any missing sizes.
@@ -121,12 +124,12 @@ fn generate_icon_files(bundle_dir: &Path, settings: &Settings) -> crate::Result<
} else {
let icon = image::open(&icon_path)?;
let (width, height) = icon.dimensions();
let is_retina = common::is_retina(&icon_path);
let is_retina = utils::is_retina(&icon_path);
if !sizes.contains(&(width, height, is_retina)) {
sizes.insert((width, height, is_retina));
let dest_path = get_dest_path(width, height, is_retina);
icon.write_to(
&mut common::create_file(&dest_path)?,
&mut fs_utils::create_file(&dest_path)?,
image::ImageFormat::Png,
)?;
}
@@ -142,7 +145,7 @@ fn generate_info_plist(
settings: &Settings,
icon_filenames: &[String],
) -> crate::Result<()> {
let file = &mut common::create_file(&bundle_dir.join("Info.plist"))?;
let file = &mut fs_utils::create_file(&bundle_dir.join("Info.plist"))?;
writeln!(
file,
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\
@@ -175,7 +178,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,
@@ -190,7 +197,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

@@ -48,9 +48,14 @@ 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
};
keychain.sign(
&target.path,
settings.macos().entitlements.as_ref().map(Path::new),
entitlements_path,
target.is_an_executable && settings.macos().hardened_runtime,
)?;
}

View File

@@ -1,287 +0,0 @@
// 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
use std::{
fs::{create_dir, create_dir_all, read_dir, remove_dir_all},
path::{Path, PathBuf},
};
/// Directory options.
#[derive(Default, Clone)]
pub struct DirOpts {
pub depth: u64,
}
/// File options.
pub struct FileOpts {
pub overwrite: bool,
pub skip: bool,
#[allow(dead_code)]
pub buffer_size: usize,
}
/// Copy options.
#[derive(Clone)]
pub struct Options {
pub overwrite: bool,
pub skip: bool,
pub buffer_size: usize,
pub copy_files: bool,
pub content_only: bool,
pub depth: u64,
}
/// Directory information descriptor
pub struct DirInfo {
pub size: u64,
pub files: Vec<String>,
pub directories: Vec<String>,
}
impl Default for Options {
fn default() -> Options {
Options {
overwrite: false,
skip: false,
buffer_size: 64000,
copy_files: false,
content_only: false,
depth: 0,
}
}
}
impl Default for FileOpts {
fn default() -> FileOpts {
FileOpts {
overwrite: false,
skip: false,
buffer_size: 64000,
}
}
}
/// Creates the given directory path,
/// erasing it first if specified.
pub fn create<P>(path: P, erase: bool) -> crate::Result<()>
where
P: AsRef<Path>,
{
if erase && path.as_ref().exists() {
remove(&path)?;
}
Ok(create_dir(&path)?)
}
/// Creates all of the directories of the specified path,
/// erasing it first if specified.
pub fn create_all<P>(path: P, erase: bool) -> crate::Result<()>
where
P: AsRef<Path>,
{
if erase && path.as_ref().exists() {
remove(&path)?;
}
Ok(create_dir_all(&path)?)
}
/// Removes the directory if it exists.
pub fn remove<P: AsRef<Path>>(path: P) -> crate::Result<()> {
if path.as_ref().exists() {
Ok(remove_dir_all(path)?)
} else {
Ok(())
}
}
/// Copy file with the given options.
pub fn copy_file<P, Q>(from: P, to: Q, options: &FileOpts) -> crate::Result<u64>
where
P: AsRef<Path>,
Q: AsRef<Path>,
{
let from = from.as_ref();
if !from.exists() {
if let Some(msg) = from.to_str() {
let msg = format!("Path \"{msg}\" does not exist or you don't have access");
return Err(crate::Error::PathUtilError(msg));
}
return Err(crate::Error::PathUtilError(
"Path does not exist or you don't have access!".to_owned(),
));
}
if !from.is_file() {
if let Some(msg) = from.to_str() {
let msg = format!("Path \"{msg}\" is not a file!");
return Err(crate::Error::PathUtilError(msg));
}
return Err(crate::Error::PathUtilError(
"Path is not a file!".to_owned(),
));
}
if !options.overwrite && to.as_ref().exists() {
if options.skip {
return Ok(0);
}
if let Some(msg) = to.as_ref().to_str() {
let msg = format!("Path \"{msg}\" is exist");
return Err(crate::Error::PathUtilError(msg));
}
}
Ok(std::fs::copy(from, to)?)
}
/// Copies the directory with the given options.
#[allow(dead_code)]
pub fn copy<P, Q>(from: P, to: Q, options: &Options) -> crate::Result<u64>
where
P: AsRef<Path>,
Q: AsRef<Path>,
{
let from = from.as_ref();
if !from.exists() {
if let Some(msg) = from.to_str() {
let msg = format!("Path \"{msg}\" does not exist or you don't have access!");
return Err(crate::Error::PathUtilError(msg));
}
return Err(crate::Error::PathUtilError(
"Path does not exist or you don't have access".to_owned(),
));
}
if !from.is_dir() {
if let Some(msg) = from.to_str() {
let msg = format!("Path \"{msg}\" is not a directory!");
return Err(crate::Error::PathUtilError(msg));
}
return Err(crate::Error::PathUtilError(
"Path is not a directory".to_owned(),
));
}
let dir_name = if let Some(val) = from.components().last() {
val.as_os_str()
} else {
return Err(crate::Error::PathUtilError(
"Invalid Folder form".to_owned(),
));
};
let mut to: PathBuf = to.as_ref().to_path_buf();
if !options.content_only && (!options.copy_files || to.exists()) {
to.push(dir_name);
}
let mut read_options = DirOpts::default();
if options.depth > 0 {
read_options.depth = options.depth;
}
let dir_content = get_dir_info(from, &read_options)?;
for directory in dir_content.directories {
let tmp_to = Path::new(&directory).strip_prefix(from)?;
let dir = to.join(tmp_to);
if !dir.exists() {
if options.copy_files {
create_all(dir, false)?;
} else {
create(dir, false)?;
}
}
}
let mut result: u64 = 0;
for file in dir_content.files {
let to = to.to_path_buf();
let tp = Path::new(&file).strip_prefix(from)?;
let path = to.join(tp);
let file_options = FileOpts {
overwrite: options.overwrite,
skip: options.skip,
buffer_size: options.buffer_size,
};
let mut result_copy: crate::Result<u64>;
let mut work = true;
while work {
#[allow(clippy::needless_borrow)]
{
result_copy = copy_file(&file, &path, &file_options);
}
match result_copy {
Ok(val) => {
result += val;
work = false;
}
Err(err) => {
let err_msg = err.to_string();
return Err(crate::Error::PathUtilError(err_msg));
}
}
}
}
Ok(result)
}
/// Gets the DirInfo from the directory path with the given options.
pub fn get_dir_info<P>(path: P, options: &DirOpts) -> crate::Result<DirInfo>
where
P: AsRef<Path>,
{
let depth = if options.depth == 0 {
0
} else {
options.depth + 1
};
_get_dir_info(path, depth)
}
/// Gets the DirInfo from the directory with the given depth.
fn _get_dir_info<P>(path: P, mut depth: u64) -> crate::Result<DirInfo>
where
P: AsRef<Path>,
{
let mut directories = Vec::new();
let mut files = Vec::new();
let mut size = 0;
let item = path.as_ref().to_str();
if item.is_none() {
return Err(crate::Error::PathUtilError("Invalid Path".to_owned()));
}
let item = item.expect("Item had no data").to_string();
if path.as_ref().is_dir() {
directories.push(item);
if depth == 0 || depth > 1 {
if depth > 1 {
depth -= 1;
}
for entry in read_dir(&path)? {
let _path = entry?.path();
match _get_dir_info(_path, depth) {
Ok(items) => {
let mut _files = items.files;
let mut _directories = items.directories;
size += items.size;
files.append(&mut _files);
directories.append(&mut _directories);
}
Err(err) => return Err(err),
}
}
}
} else {
size = path.as_ref().metadata()?.len();
files.push(item);
}
Ok(DirInfo {
size,
files,
directories,
})
}

View File

@@ -3,7 +3,7 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
use super::common::CommandExt;
use crate::utils::CommandExt;
use std::process::Command;
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
@@ -57,6 +57,8 @@ pub fn target_triple() -> Result<String, crate::Error> {
"armv7".into()
} else if cfg!(target_arch = "aarch64") {
"aarch64".into()
} else if cfg!(target_arch = "riscv64") {
"riscv64".into()
} else {
return Err(crate::Error::ArchError(String::from(
"Unable to determine target-architecture",

View File

@@ -4,11 +4,15 @@
// SPDX-License-Identifier: MIT
use super::category::AppCategory;
use crate::bundle::{common, platform::target_triple};
use crate::{bundle::platform::target_triple, utils::fs_utils};
use anyhow::Context;
pub use tauri_utils::config::WebviewInstallMode;
use tauri_utils::{
config::{BundleType, DeepLinkProtocol, FileAssociation, NSISInstallerMode, NsisCompression},
config::{
BundleType, DeepLinkProtocol, FileAssociation, NSISInstallerMode, NsisCompression,
RpmCompression,
},
platform::Target as TargetPlatform,
resources::{external_binaries, ResourcePaths},
};
@@ -170,6 +174,8 @@ pub struct DebianSettings {
// OS-specific settings:
/// the list of debian dependencies.
pub depends: Option<Vec<String>>,
/// the list of debian dependencies recommendations.
pub recommends: Option<Vec<String>>,
/// the list of dependencies the package provides.
pub provides: Option<Vec<String>>,
/// the list of package conflicts.
@@ -215,6 +221,10 @@ pub struct DebianSettings {
pub struct AppImageSettings {
/// The files to include in the Appimage Binary.
pub files: HashMap<PathBuf, PathBuf>,
/// Whether to include gstreamer plugins for audio/media support.
pub bundle_media_framework: bool,
/// Whether to include the `xdg-open` binary.
pub bundle_xdg_open: bool,
}
/// The RPM bundle settings.
@@ -222,13 +232,15 @@ 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.
pub recommends: Option<Vec<String>>,
/// The list of RPM dependencies your application provides.
pub provides: Option<Vec<String>>,
/// The list of RPM dependencies your application conflicts with. They must not be present
/// in order for the package to be installed.
pub conflicts: Option<Vec<String>>,
/// The list of RPM dependencies your application supersedes - if this package is installed,
/// packages listed as obsoletes will be automatically removed (if they are present).
/// packages listed as "obsoletes" will be automatically removed (if they are present).
pub obsoletes: Option<Vec<String>>,
/// The RPM release tag.
pub release: String,
@@ -258,6 +270,8 @@ pub struct RpmSettings {
/// Path to script that will be executed after the package is removed. See
/// <http://ftp.rpm.org/max-rpm/s1-rpm-inside-scripts.html>
pub post_remove_script: Option<PathBuf>,
/// Compression algorithm and level. Defaults to `Gzip` with level 6.
pub compression: Option<RpmCompression>,
}
/// Position coordinates struct.
@@ -293,6 +307,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 {
@@ -310,6 +331,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>,
@@ -351,6 +378,15 @@ impl Default for WixLanguage {
/// Settings specific to the WiX implementation.
#[derive(Clone, Debug, Default)]
pub struct WixSettings {
/// MSI installer version in the format `major.minor.patch.build` (build is optional).
///
/// Because a valid version is required for MSI installer, it will be derived from [`PackageSettings::version`] if this field is not set.
///
/// The first field is the major version and has a maximum value of 255. The second field is the minor version and has a maximum value of 255.
/// The third and fourth fields have a maximum value of 65,535.
///
/// See <https://learn.microsoft.com/en-us/windows/win32/msi/productversion> for more info.
pub version: Option<String>,
/// A GUID upgrade code for MSI installer. This code **_must stay the same across all of your updates_**,
/// otherwise, Windows will treat your update as a different app and your users will have duplicate versions of your app.
///
@@ -386,7 +422,7 @@ pub struct WixSettings {
pub banner_path: Option<PathBuf>,
/// Path to a bitmap file to use on the installation user interface dialogs.
/// It is used on the welcome and completion dialogs.
///
/// The required dimensions are 493px × 312px.
pub dialog_image_path: Option<PathBuf>,
/// Enables FIPS compliant algorithms.
@@ -501,6 +537,7 @@ pub struct WindowsSettings {
/// Nsis configuration.
pub nsis: Option<NsisSettings>,
/// The path to the application icon. Defaults to `./icons/icon.ico`.
#[deprecated = "This is used for the MSI installer and will be removed in 3.0.0, use `BundleSettings::icon` field and make sure a `.ico` icon exists instead."]
pub icon_path: PathBuf,
/// The installation mode for the Webview2 runtime.
pub webview_install_mode: WebviewInstallMode,
@@ -526,19 +563,24 @@ pub struct WindowsSettings {
pub sign_command: Option<CustomSignCommandSettings>,
}
impl Default for WindowsSettings {
fn default() -> Self {
Self {
digest_algorithm: None,
certificate_thumbprint: None,
timestamp_url: None,
tsp: false,
wix: None,
nsis: None,
icon_path: PathBuf::from("icons/icon.ico"),
webview_install_mode: Default::default(),
allow_downgrades: true,
sign_command: None,
#[allow(deprecated)]
mod _default {
use super::*;
impl Default for WindowsSettings {
fn default() -> Self {
Self {
digest_algorithm: None,
certificate_thumbprint: None,
timestamp_url: None,
tsp: false,
wix: None,
nsis: None,
icon_path: PathBuf::from("icons/icon.ico"),
webview_install_mode: Default::default(),
allow_downgrades: true,
sign_command: None,
}
}
}
}
@@ -615,6 +657,8 @@ 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.
@@ -695,6 +739,8 @@ pub enum Arch {
Armhf,
/// For the AArch32 / ARM32 instruction sets with soft-float (32 bits).
Armel,
/// For the RISC-V instruction sets (64 bits).
Riscv64,
/// For universal macOS applications.
Universal,
}
@@ -719,6 +765,8 @@ pub struct Settings {
bundle_settings: BundleSettings,
/// the binaries to bundle.
binaries: Vec<BundleBinary>,
/// The target platform.
target_platform: TargetPlatform,
/// The target triple.
target: String,
}
@@ -814,6 +862,7 @@ impl SettingsBuilder {
} else {
target_triple()?
};
let target_platform = TargetPlatform::from_triple(&target);
Ok(Settings {
log_level: self.log_level.unwrap_or(log::Level::Error),
@@ -831,9 +880,10 @@ 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
},
target_platform,
target,
})
}
@@ -860,6 +910,11 @@ impl Settings {
&self.target
}
/// Returns the [`TargetPlatform`].
pub fn target_platform(&self) -> &TargetPlatform {
&self.target_platform
}
/// 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") {
@@ -872,6 +927,8 @@ impl Settings {
Arch::Armel
} else if self.target.starts_with("aarch64") {
Arch::AArch64
} else if self.target.starts_with("riscv64") {
Arch::Riscv64
} else if self.target.starts_with("universal") {
Arch::Universal
} else {
@@ -889,6 +946,16 @@ impl Settings {
.map_err(Into::into)
}
/// Returns the file name of the binary being bundled.
pub fn main_binary_mut(&mut self) -> crate::Result<&mut BundleBinary> {
self
.binaries
.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.
pub fn main_binary_name(&self) -> crate::Result<&str> {
self
@@ -902,19 +969,23 @@ impl Settings {
/// 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.
@@ -932,18 +1003,13 @@ 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."
@@ -1030,7 +1096,7 @@ impl Settings {
.to_string_lossy()
.replace(&format!("-{}", self.target), ""),
);
common::copy_file(&src, &dest)?;
fs_utils::copy_file(&src, &dest)?;
paths.push(dest);
}
Ok(paths)
@@ -1041,7 +1107,7 @@ impl Settings {
for resource in self.resource_files().iter() {
let resource = resource?;
let dest = path.join(resource.target());
common::copy_file(resource.path(), dest)?;
fs_utils::copy_file(resource.path(), &dest)?;
}
Ok(())
}
@@ -1148,6 +1214,11 @@ 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

View File

@@ -3,8 +3,6 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
use super::common;
use crate::{
bundle::{
windows::{
@@ -13,9 +11,10 @@ use crate::{
},
Bundle,
},
utils::fs_utils,
Settings,
};
use tauri_utils::display_path;
use tauri_utils::{display_path, platform::Target as TargetPlatform};
use std::{
fs::{self, File},
@@ -28,14 +27,9 @@ 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);
}
@@ -194,7 +188,7 @@ fn bundle_update_windows(settings: &Settings, bundles: &[Bundle]) -> crate::Resu
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));
@@ -210,7 +204,7 @@ fn bundle_update_windows(settings: &Settings, bundles: &[Bundle]) -> crate::Resu
pub fn create_zip(src_file: &Path, dst_file: &Path) -> crate::Result<PathBuf> {
let parent_dir = dst_file.parent().expect("No data in parent");
fs::create_dir_all(parent_dir)?;
let writer = common::create_file(dst_file)?;
let writer = fs_utils::create_file(dst_file)?;
let file_name = src_file
.file_name()
@@ -235,7 +229,7 @@ pub fn create_zip(src_file: &Path, dst_file: &Path) -> crate::Result<PathBuf> {
fn create_tar(src_dir: &Path, dest_path: &Path) -> crate::Result<PathBuf> {
use flate2::{write::GzEncoder, Compression};
let dest_file = common::create_file(dest_path)?;
let dest_file = fs_utils::create_file(dest_path)?;
let gzip_encoder = GzEncoder::new(dest_file, Compression::default());
let gzip_encoder = create_tar_from_src(src_dir, gzip_encoder)?;

View File

@@ -5,6 +5,7 @@
#[cfg(target_os = "windows")]
pub mod msi;
pub mod nsis;
pub mod sign;
@@ -13,3 +14,5 @@ pub use util::{
NSIS_OUTPUT_FOLDER_NAME, NSIS_UPDATER_OUTPUT_FOLDER_NAME, WIX_OUTPUT_FOLDER_NAME,
WIX_UPDATER_OUTPUT_FOLDER_NAME,
};
pub use util::patch_binary;

View File

@@ -70,9 +70,12 @@
<Property Id="ARPURLUPDATEINFO" Value="{{homepage}}"/>
{{/if}}
<!-- initialize with previous InstallDir -->
<Property Id="INSTALLDIR">
<RegistrySearch Id="PrevInstallDirReg" Root="HKCU" Key="Software\\{{manufacturer}}\\{{product_name}}" Name="InstallDir" Type="raw"/>
<!-- 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) -->
<RegistrySearch Id="PrevInstallDirNoName" Root="HKCU" Key="Software\\{{manufacturer}}\\{{product_name}}" Type="raw" />
</Property>
<!-- launch app checkbox -->

View File

@@ -3,17 +3,22 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
use crate::bundle::{
common::CommandExt,
path_utils::{copy_file, FileOpts},
settings::{Arch, Settings},
windows::{
sign::try_sign,
util::{
download_and_verify, download_webview2_bootstrapper, download_webview2_offline_installer,
extract_zip, HashAlgorithm, WIX_OUTPUT_FOLDER_NAME, WIX_UPDATER_OUTPUT_FOLDER_NAME,
use crate::{
bundle::{
settings::{Arch, Settings},
windows::{
sign::try_sign,
util::{
download_webview2_bootstrapper, download_webview2_offline_installer,
WIX_OUTPUT_FOLDER_NAME, WIX_UPDATER_OUTPUT_FOLDER_NAME,
},
},
},
utils::{
fs_utils::copy_file,
http_utils::{download_and_verify, extract_zip, HashAlgorithm},
CommandExt,
},
};
use anyhow::{bail, Context};
use handlebars::{html_escape, to_json, Handlebars};
@@ -21,6 +26,7 @@ use regex::Regex;
use serde::{Deserialize, Serialize};
use std::{
collections::{BTreeMap, HashMap, HashSet},
ffi::OsStr,
fs::{self, File},
io::Write,
path::{Path, PathBuf},
@@ -171,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>"#,
@@ -197,14 +203,7 @@ fn copy_icon(settings: &Settings, filename: &str, path: &Path) -> crate::Result<
let icon_path = std::env::current_dir()?.join(path);
copy_file(
icon_path,
&icon_target_path,
&FileOpts {
overwrite: true,
..Default::default()
},
)?;
copy_file(&icon_path, &icon_target_path)?;
Ok(icon_target_path)
}
@@ -222,8 +221,7 @@ fn app_installer_output_path(
Arch::AArch64 => "arm64",
target => {
return Err(crate::Error::ArchError(format!(
"Unsupported architecture: {:?}",
target
"Unsupported architecture: {target:?}"
)))
}
};
@@ -281,19 +279,37 @@ fn clear_env_for_wix(cmd: &mut Command) {
}
}
// WiX requires versions to be numeric only in a `major.minor.patch.build` format
pub fn convert_version(version_str: &str) -> anyhow::Result<String> {
let version = semver::Version::parse(version_str).context("invalid app version")?;
if version.major > 255 {
fn validate_wix_version(version_str: &str) -> anyhow::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[0] > 255 {
bail!("app version major number cannot be greater than 255");
}
if version.minor > 255 {
if components[1] > 255 {
bail!("app version minor number cannot be greater than 255");
}
if version.patch > 65535 {
if components[2] > 65535 {
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");
}
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")?;
if !version.build.is_empty() {
let build = version.build.parse::<u64>();
if build.map(|b| b <= 65535).unwrap_or_default() {
@@ -335,8 +351,7 @@ fn run_candle(
Arch::AArch64 => "arm64",
target => {
return Err(crate::Error::ArchError(format!(
"unsupported architecture: {:?}",
target
"unsupported architecture: {target:?}"
)))
}
};
@@ -426,13 +441,23 @@ pub fn build_wix_app_installer(
Arch::AArch64 => "arm64",
target => {
return Err(crate::Error::ArchError(format!(
"unsupported architecture: {:?}",
target
"unsupported architecture: {target:?}"
)))
}
};
let app_version = convert_version(settings.version_string())?;
let app_version = if let Some(version) = settings
.windows()
.wix
.as_ref()
.and_then(|wix| wix.version.clone())
{
version
} else {
convert_version(settings.version_string())?
};
validate_wix_version(&app_version)?;
// target only supports x64.
log::info!("Target: {}", arch);
@@ -444,6 +469,16 @@ 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.can_sign() {
let wix_path = output_path.join("wix");
crate::utils::fs_utils::copy_dir(wix_toolset_path, &wix_path)
.context("failed to copy wix directory")?;
wix_path
} else {
wix_toolset_path.to_path_buf()
};
let mut data = BTreeMap::new();
let silent_webview_install = if let WebviewInstallMode::DownloadBootstrapper { silent }
@@ -604,7 +639,17 @@ pub fn build_wix_app_installer(
data.insert("main_binary_path", to_json(main_binary_path));
// copy icon from `settings.windows().icon_path` folder to resource folder near msi
let icon_path = copy_icon(settings, "icon.ico", &settings.windows().icon_path)?;
#[allow(deprecated)]
let icon_path = if !settings.windows().icon_path.as_os_str().is_empty() {
settings.windows().icon_path.clone()
} else {
settings
.icon_files()
.flatten()
.find(|i| i.extension() == Some(OsStr::new("ico")))
.context("Couldn't find a .ico icon")?
};
let icon_path = copy_icon(settings, "icon.ico", &icon_path)?;
data.insert("icon_path", to_json(icon_path));
@@ -686,38 +731,26 @@ pub fn build_wix_app_installer(
);
// Create the update task XML
let mut skip_uac_task = Handlebars::new();
let skip_uac_task = Handlebars::new();
let xml = include_str!("./update-task.xml");
skip_uac_task
.register_template_string("update.xml", xml)
.map_err(|e| e.to_string())
.expect("Failed to setup Update Task handlebars");
let update_content = skip_uac_task.render_template(xml, &data)?;
let temp_xml_path = output_path.join("update.xml");
let update_content = skip_uac_task.render("update.xml", &data)?;
fs::write(temp_xml_path, update_content)?;
// Create the Powershell script to install the task
let mut skip_uac_task_installer = Handlebars::new();
skip_uac_task_installer.register_escape_fn(handlebars::no_escape);
let xml = include_str!("./install-task.ps1");
skip_uac_task_installer
.register_template_string("install-task.ps1", xml)
.map_err(|e| e.to_string())
.expect("Failed to setup Update Task Installer handlebars");
let install_script_content = skip_uac_task_installer.render_template(xml, &data)?;
let temp_ps1_path = output_path.join("install-task.ps1");
let install_script_content = skip_uac_task_installer.render("install-task.ps1", &data)?;
fs::write(temp_ps1_path, install_script_content)?;
// Create the Powershell script to uninstall the task
let mut skip_uac_task_uninstaller = Handlebars::new();
skip_uac_task_uninstaller.register_escape_fn(handlebars::no_escape);
let xml = include_str!("./uninstall-task.ps1");
skip_uac_task_uninstaller
.register_template_string("uninstall-task.ps1", xml)
.map_err(|e| e.to_string())
.expect("Failed to setup Update Task Uninstaller handlebars");
let install_script_content = skip_uac_task_uninstaller.render_template(xml, &data)?;
let temp_ps1_path = output_path.join("uninstall-task.ps1");
let install_script_content = skip_uac_task_uninstaller.render("uninstall-task.ps1", &data)?;
fs::write(temp_ps1_path, install_script_content)?;
data.insert("enable_elevated_update_task", to_json(true));
@@ -732,10 +765,16 @@ pub fn build_wix_app_installer(
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 = fs::read_to_string(&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 mut extensions = Vec::new();
for cap in extension_regex.captures_iter(&fragment) {
extensions.push(wix_toolset_path.join(format!("Wix{}.dll", &cap[1])));
let path = wix_toolset_path.join(format!("Wix{}.dll", &cap[1]));
if settings.can_sign() {
try_sign(&path, settings)?;
}
extensions.push(path);
}
candle_inputs.push((fragment_path, extensions));
}
@@ -745,11 +784,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.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();
@@ -796,7 +842,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");
{
@@ -825,7 +871,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()),
@@ -901,12 +947,11 @@ fn get_merge_modules(settings: &Settings) -> crate::Result<Vec<MergeModule>> {
let mut merge_modules = Vec::new();
let regex = Regex::new(r"[^\w\d\.]")?;
for msm in glob::glob(
settings
.project_out_directory()
.join("*.msm")
.to_string_lossy()
.to_string()
.as_str(),
&PathBuf::from(glob::Pattern::escape(
&settings.project_out_directory().to_string_lossy(),
))
.join("*.msm")
.to_string_lossy(),
)? {
let path = msm?;
let filename = path
@@ -941,9 +986,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.can_sign() {
try_sign(&resource_path, settings)?;
}
let resource_entry = ResourceFile {
id: format!("I{}", Uuid::new_v4().as_simple()),
guid: Uuid::new_v4().to_string(),
@@ -1013,8 +1061,13 @@ fn generate_resource_data(settings: &Settings) -> crate::Result<ResourceMap> {
let mut dlls = Vec::new();
// 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(out_dir.join("*.dll").to_string_lossy().to_string().as_str())? {
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
@@ -1023,6 +1076,10 @@ fn generate_resource_data(settings: &Settings) -> crate::Result<ResourceMap> {
.to_string_lossy()
.into_owned();
if !added_resources.iter().any(|r| r.ends_with(&relative_path)) {
if settings.can_sign() {
try_sign(resource_path, settings)?;
}
dlls.push(ResourceFile {
id: format!("I{}", Uuid::new_v4().as_simple()),
guid: Uuid::new_v4().to_string(),
@@ -1032,16 +1089,48 @@ fn generate_resource_data(settings: &Settings) -> crate::Result<ResourceMap> {
}
if !dlls.is_empty() {
resources.insert(
"".to_string(),
ResourceDirectory {
resources
.entry("".to_string())
.and_modify(|r| r.files.append(&mut dlls))
.or_insert(ResourceDirectory {
path: "".to_string(),
name: "".to_string(),
directories: vec![],
files: dlls,
},
);
});
}
Ok(resources)
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn validates_wix_version() {
assert!(validate_wix_version("1.1.1").is_ok());
assert!(validate_wix_version("1.1.1.1").is_ok());
assert!(validate_wix_version("255.1.1.1").is_ok());
assert!(validate_wix_version("1.255.1.1").is_ok());
assert!(validate_wix_version("1.1.65535.1").is_ok());
assert!(validate_wix_version("1.1.1.65535").is_ok());
assert!(validate_wix_version("256.1.1.1").is_err());
assert!(validate_wix_version("1.256.1.1").is_err());
assert!(validate_wix_version("1.1.65536.1").is_err());
assert!(validate_wix_version("1.1.1.65536").is_err());
}
#[test]
fn converts_version_to_wix() {
assert_eq!(convert_version("1.1.2").unwrap(), "1.1.2");
assert_eq!(convert_version("1.1.2-4").unwrap(), "1.1.2.4");
assert_eq!(convert_version("1.1.2-65535").unwrap(), "1.1.2.65535");
assert_eq!(convert_version("1.1.2+2").unwrap(), "1.1.2.2");
assert!(convert_version("1.1.2-alpha").is_err());
assert!(convert_version("1.1.2-alpha.4").is_err());
assert!(convert_version("1.1.2+asd.3").is_err());
}
}

View File

@@ -37,7 +37,7 @@
<Actions Context="Author">
<Exec>
<Command>cmd.exe</Command>
<Arguments>/c "%SYSTEMROOT%\System32\msiexec.exe /i %TEMP%\\{{product_name}}.msi {{msiexec_args}} /promptrestart"</Arguments>
<Arguments>/c ^"%SYSTEMROOT%\System32\msiexec.exe /i "%TEMP%\\{{product_name}}.msi" {{msiexec_args}} /promptrestart^"</Arguments>
</Exec>
</Actions>
</Task>

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}}"
@@ -56,7 +56,8 @@ ${StrLoc}
!define WEBVIEW2INSTALLERPATH "{{webview2_installer_path}}"
!define MINIMUMWEBVIEW2VERSION "{{minimum_webview2_version}}"
!define UNINSTKEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCTNAME}"
!define MANUPRODUCTKEY "Software\${MANUFACTURER}\${PRODUCTNAME}"
!define MANUKEY "Software\${MANUFACTURER}"
!define MANUPRODUCTKEY "${MANUKEY}\${PRODUCTNAME}"
!define UNINSTALLERSIGNCOMMAND "{{uninstaller_sign_cmd}}"
!define ESTIMATEDSIZE "{{estimated_size}}"
!define STARTMENUFOLDER "{{start_menu_folder}}"
@@ -84,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}" != ""
@@ -96,7 +95,7 @@ VIAddVersionKey "ProductVersion" "${VERSION}"
; Handle install mode, `perUser`, `perMachine` or `both`
!if "${INSTALLMODE}" == "perMachine"
RequestExecutionLevel highest
RequestExecutionLevel admin
!endif
!if "${INSTALLMODE}" == "currentUser"
@@ -619,7 +618,7 @@ Section Install
!insertmacro NSIS_HOOK_PREINSTALL
!endif
!insertmacro CheckIfAppIsRunning
!insertmacro CheckIfAppIsRunning "${MAINBINARYNAME}.exe" "${PRODUCTNAME}"
; Copy main executable
File "${MAINBINARYSRCPATH}"
@@ -629,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
@@ -756,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
@@ -834,12 +833,27 @@ Section Uninstall
DeleteRegKey HKCU "${UNINSTKEY}"
!endif
DeleteRegValue HKCU "${MANUPRODUCTKEY}" "Installer Language"
; Removes the Autostart entry for ${PRODUCTNAME} from the HKCU Run key if it exists.
; This ensures the program does not launch automatically after uninstallation if it exists.
; If it doesn't exist, it does nothing.
; We do this when not updating (to preserve the registry value on updates)
${If} $UpdateMode <> 1
DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "${PRODUCTNAME}"
${EndIf}
; Delete app data if the checkbox is selected
; and if not updating
${If} $DeleteAppDataCheckboxState = 1
${AndIf} $UpdateMode <> 1
; Clear the install location $INSTDIR from registry
DeleteRegKey SHCTX "${MANUPRODUCTKEY}"
DeleteRegKey /ifempty SHCTX "${MANUKEY}"
; Clear the install language from registry
DeleteRegValue HKCU "${MANUPRODUCTKEY}" "Installer Language"
DeleteRegKey /ifempty HKCU "${MANUPRODUCTKEY}"
DeleteRegKey /ifempty HKCU "${MANUKEY}"
SetShellVarContext current
RmDir /r "$APPDATA\${BUNDLEID}"
RmDir /r "$LOCALAPPDATA\${BUNDLEID}"

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

@@ -0,0 +1,27 @@
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} "{{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 {{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"
LangString olderOrUnknownVersionInstalled ${LANG_ITALIAN} "Una versione $R4 di ${PRODUCTNAME} è installata nel tuo sistema. È consigliato che disinstalli la versione corrente prima di procedere all'installazione. Seleziona l'operazione che vuoi eseguire e clicca Avanti per continuare."
LangString silentDowngrades ${LANG_ITALIAN} "I downgrade sono disabilitati per questo installer, impossibile procedere con l'installer silenzioso, usa invece l'installer con interfaccia grafica.$\n"
LangString unableToUninstall ${LANG_ITALIAN} "Impossibile disinstallare!"
LangString uninstallApp ${LANG_ITALIAN} "Disinstalla ${PRODUCTNAME}"
LangString uninstallBeforeInstalling ${LANG_ITALIAN} "Disinstalla prima di installare"
LangString unknown ${LANG_ITALIAN} "sconosciuta"
LangString webview2AbortError ${LANG_ITALIAN} "Errore nell'installazione di WebView2! L'app non può funzionare senza. Prova a riavviare l'installer."
LangString webview2DownloadError ${LANG_ITALIAN} "Errore: Il download di WebView2 è fallito - $0"
LangString webview2DownloadSuccess ${LANG_ITALIAN} "Bootstrapper WebView2 scaricato con successo"
LangString webview2Downloading ${LANG_ITALIAN} "Scaricando il bootstrapper WebView2..."
LangString webview2InstallError ${LANG_ITALIAN} "Errore: L'installazione di WebView2 è fallita con il codice $1"
LangString webview2InstallSuccess ${LANG_ITALIAN} "WebView2 installato correttamente"
LangString deleteAppData ${LANG_ITALIAN} "Cancella i dati dell'applicazione"

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

@@ -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

@@ -0,0 +1,27 @@
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} "{{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 {{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"
LangString olderOrUnknownVersionInstalled ${LANG_PORTUGUESE} "Uma versão $R4 do ${PRODUCTNAME} está instalada no sistema. Recomenda-se desinstalar a versão atual antes de instalar. Selecione a operação que deseja realizar e clique em Seguinte para continuar."
LangString silentDowngrades ${LANG_PORTUGUESE} "Rebaixamentos estão desativados neste instalador, não é possível prosseguir com a instalação silenciosa. Por favor, utilize o instalador com interface gráfica.$\n"
LangString unableToUninstall ${LANG_PORTUGUESE} "Não foi possível desinstalar!"
LangString uninstallApp ${LANG_PORTUGUESE} "Desinstalar ${PRODUCTNAME}"
LangString uninstallBeforeInstalling ${LANG_PORTUGUESE} "Desinstalar antes de instalar"
LangString unknown ${LANG_PORTUGUESE} "desconhecida"
LangString webview2AbortError ${LANG_PORTUGUESE} "Falha ao instalar o WebView2! A aplicação não pode ser executada sem ele. Tente reiniciar o instalador."
LangString webview2DownloadError ${LANG_PORTUGUESE} "Erro: Falha ao transferir o WebView2 - $0"
LangString webview2DownloadSuccess ${LANG_PORTUGUESE} "Bootstrapper do WebView2 transferido com sucesso"
LangString webview2Downloading ${LANG_PORTUGUESE} "A transferir o Bootstrapper do WebView2..."
LangString webview2InstallError ${LANG_PORTUGUESE} "Erro: Instalação do WebView2 falhou com o código $1"
LangString webview2InstallSuccess ${LANG_PORTUGUESE} "WebView2 instalado com sucesso"
LangString deleteAppData ${LANG_PORTUGUESE} "Eliminar os dados da aplicação"

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

@@ -0,0 +1,27 @@
LangString addOrReinstall ${LANG_UKRAINIAN} "Додати/Перевстановити компоненти"
LangString alreadyInstalled ${LANG_UKRAINIAN} "Вже встановлено"
LangString alreadyInstalledLong ${LANG_UKRAINIAN} "${PRODUCTNAME} ${VERSION} вже встановлено. Виберіть дію, яку ви хочете виконати, і натисніть Далі, щоб продовжити."
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} "Не вдалося примусово закрити {{product_name}}. Будь ласка, спочатку закрийте його, а потім спробуйте ще раз"
LangString installingWebview2 ${LANG_UKRAINIAN} "Встановлення WebView2..."
LangString newerVersionInstalled ${LANG_UKRAINIAN} "Новіша версія ${PRODUCTNAME} вже встановлена! Встановлювати старішу версію не рекомендується. Якщо ви дійсно хочете встановити цю версію, краще спочатку видаліть поточну. Виберіть дію, яку ви хочете виконати, і натисніть Далі, щоб продовжити."
LangString older ${LANG_UKRAINIAN} "старішу"
LangString olderOrUnknownVersionInstalled ${LANG_UKRAINIAN} "У вашій системі вже встановлено $R4 версію ${PRODUCTNAME}. Рекомендується видалити поточну версію перед встановленням. Виберіть дію, яку ви хочете виконати, і натисніть Далі, щоб продовжити."
LangString silentDowngrades ${LANG_UKRAINIAN} "Для цього встановлювача вимкнено зниження версій. Неможливо продовжити роботу з фоновим встановлювачем. Будь ласка, скористайтеся встановлювачем з графічним інтерфейсом.$\n"
LangString unableToUninstall ${LANG_UKRAINIAN} "Не вдалося видалити!"
LangString uninstallApp ${LANG_UKRAINIAN} "Видалити ${PRODUCTNAME}"
LangString uninstallBeforeInstalling ${LANG_UKRAINIAN} "Видалити перед встановленням"
LangString unknown ${LANG_UKRAINIAN} "невідому"
LangString webview2AbortError ${LANG_UKRAINIAN} "Не вдалося встановити WebView2! Без нього програма не може працювати. Спробуйте перезапустити встановлювач."
LangString webview2DownloadError ${LANG_UKRAINIAN} "Помилка: не вдалося завантажити WebView2 - $0"
LangString webview2DownloadSuccess ${LANG_UKRAINIAN} "WebView2 успішно завантажено"
LangString webview2Downloading ${LANG_UKRAINIAN} "Завантаження WebView2..."
LangString webview2InstallError ${LANG_UKRAINIAN} "Помилка: не вдалося встановити WebView2, код виходу - $1"
LangString webview2InstallSuccess ${LANG_UKRAINIAN} "WebView2 успішно встановлено "
LangString deleteAppData ${LANG_UKRAINIAN} "Видалити дані програми"

View File

@@ -2,17 +2,21 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
use crate::bundle::settings::Arch;
use crate::bundle::windows::sign::{sign_command, try_sign};
use crate::{
bundle::{
common::CommandExt,
windows::util::{
download_and_verify, download_webview2_bootstrapper, download_webview2_offline_installer,
verify_file_hash, HashAlgorithm, NSIS_OUTPUT_FOLDER_NAME, NSIS_UPDATER_OUTPUT_FOLDER_NAME,
settings::Arch,
windows::{
sign::{sign_command, try_sign},
util::{
download_webview2_bootstrapper, download_webview2_offline_installer,
NSIS_OUTPUT_FOLDER_NAME, NSIS_UPDATER_OUTPUT_FOLDER_NAME,
},
},
},
utils::{
http_utils::{download_and_verify, verify_file_hash, HashAlgorithm},
CommandExt,
},
Settings,
};
use tauri_utils::display_path;
@@ -35,8 +39,8 @@ const NSIS_URL: &str =
#[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.1/nsis_tauri_utils.dll";
const NSIS_TAURI_UTILS_SHA1: &str = "F99A50209A345185A84D34D0E5F66D04C75FF52F";
"https://github.com/tauri-apps/nsis-tauri-utils/releases/download/nsis_tauri_utils-v0.5.1/nsis_tauri_utils.dll";
const NSIS_TAURI_UTILS_SHA1: &str = "B053B2E5FDB97257954C8F935D80964F056520AE";
#[cfg(target_os = "windows")]
const NSIS_REQUIRED_FILES: &[&str] = &[
@@ -44,18 +48,25 @@ 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",
];
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,
@@ -90,9 +101,12 @@ pub fn bundle_project(settings: &Settings, updater: bool) -> crate::Result<Vec<P
if !mismatched.is_empty() {
log::warn!("NSIS directory contains mis-hashed files. Redownloading them.");
for (path, url, hash, hash_algorithim) in mismatched {
let data = download_and_verify(url, hash, *hash_algorithim)?;
fs::write(nsis_toolset_path.join(path), data)?;
for (path, url, hash, hash_algorithm) in mismatched {
let data = download_and_verify(url, hash, *hash_algorithm)?;
let out_path = nsis_toolset_path.join(path);
std::fs::create_dir_all(out_path.parent().context("output path has no parent")?)
.context("failed to create file output directory")?;
fs::write(out_path, data).with_context(|| format!("failed to save {path}"))?;
}
}
}
@@ -108,10 +122,11 @@ 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::bundle::windows::util::extract_zip(&data, _tauri_tools_path)?;
crate::utils::http_utils::extract_zip(&data, _tauri_tools_path)?;
fs::rename(_tauri_tools_path.join("nsis-3.08"), nsis_toolset_path)?;
}
// download additional plugins
let nsis_plugins = nsis_toolset_path.join("Plugins");
let data = download_and_verify(
@@ -120,14 +135,14 @@ 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 add_build_number_if_needed(version_str: &str) -> anyhow::Result<String> {
fn try_add_numeric_build_number(version_str: &str) -> anyhow::Result<String> {
let version = semver::Version::parse(version_str).context("invalid app version")?;
if !version.build.is_empty() {
let build = version.build.parse::<u64>();
@@ -137,7 +152,10 @@ fn add_build_number_if_needed(version_str: &str) -> anyhow::Result<String> {
version.major, version.minor, version.patch, version.build
));
} else {
anyhow::bail!("optional build metadata in app version must be numeric-only");
log::warn!(
"Unable to parse version build metadata. Numeric value expected, received: `{}`. This will be replaced with `0` in `VIProductVersion` because Windows requires this field to be numeric.",
version.build
);
}
}
@@ -146,9 +164,10 @@ fn add_build_number_if_needed(version_str: &str) -> anyhow::Result<String> {
version.major, version.minor, version.patch,
))
}
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>> {
@@ -158,8 +177,7 @@ fn build_nsis_app_installer(
Arch::AArch64 => "arm64",
target => {
return Err(crate::Error::ArchError(format!(
"unsupported architecture: {:?}",
target
"unsupported architecture: {target:?}"
)))
}
};
@@ -172,6 +190,65 @@ 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.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)
.ok_or_else(|| anyhow::anyhow!("failed to resolve NSIS path"))
.or_else(|_| {
let mut makensis_path =
which::which("makensis").context("failed to resolve `makensis`; did you install nsis? See https://tauri.app/distribute/windows-installer/#install-nsis for more information")?;
// 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).context("failed to resolve makensis symlink")?)
.canonicalize()
.context("failed to resolve makensis path")?;
}
// 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();
@@ -179,12 +256,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));
@@ -210,7 +292,7 @@ fn build_nsis_app_installer(
data.insert("version", to_json(version));
data.insert(
"version_with_build",
to_json(add_build_number_if_needed(version)?),
to_json(try_add_numeric_build_number(version)?),
);
data.insert(
@@ -459,6 +541,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() {
@@ -517,13 +600,29 @@ 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.can_sign() {
log::info!("Signing NSIS plugins");
for dll in NSIS_PLUGIN_FILES {
let path = additional_plugins_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() {
@@ -587,14 +686,49 @@ 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> {
let mut resources = ResourcesMap::new();
let cwd = std::env::current_dir()?;
let mut added_resources = 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();
if loader_path.exists() {
if settings.can_sign() {
try_sign(&loader_path, settings)?;
}
added_resources.push(loader_path.clone());
resources.insert(
loader_path,
(PathBuf::new(), PathBuf::from("WebView2Loader.dll")),
);
}
}
for resource in settings.resource_files().iter() {
let resource = resource?;
@@ -609,6 +743,10 @@ fn generate_resource_data(settings: &Settings) -> crate::Result<ResourcesMap> {
}
added_resources.push(resource_path.clone());
if settings.can_sign() {
try_sign(&resource_path, settings)?;
}
let target_path = resource.target();
resources.insert(
resource_path,
@@ -684,6 +822,7 @@ fn get_lang_data(lang: &str) -> Option<(String, &[u8])> {
"dutch" => include_bytes!("./languages/Dutch.nsh"),
"english" => include_bytes!("./languages/English.nsh"),
"german" => include_bytes!("./languages/German.nsh"),
"italian" => include_bytes!("./languages/Italian.nsh"),
"japanese" => include_bytes!("./languages/Japanese.nsh"),
"korean" => include_bytes!("./languages/Korean.nsh"),
"portuguesebr" => include_bytes!("./languages/PortugueseBR.nsh"),
@@ -696,6 +835,8 @@ fn get_lang_data(lang: &str) -> Option<(String, &[u8])> {
"persian" => include_bytes!("./languages/Persian.nsh"),
"turkish" => include_bytes!("./languages/Turkish.nsh"),
"swedish" => include_bytes!("./languages/Swedish.nsh"),
"portuguese" => include_bytes!("./languages/Portuguese.nsh"),
"ukrainian" => include_bytes!("./languages/Ukrainian.nsh"),
_ => return None,
};
Some((path, content))

View File

@@ -19,43 +19,54 @@
!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
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

View File

@@ -6,7 +6,7 @@
use crate::bundle::settings::CustomSignCommandSettings;
#[cfg(windows)]
use crate::bundle::windows::util;
use crate::{bundle::common::CommandExt, Settings};
use crate::{utils::CommandExt, Settings};
#[cfg(windows)]
use std::path::PathBuf;
#[cfg(windows)]
@@ -142,12 +142,21 @@ pub fn sign_command_custom<P: AsRef<Path>>(
) -> crate::Result<Command> {
let path = path.as_ref();
let cwd = std::env::current_dir()?;
let mut cmd = Command::new(&command.cmd);
for arg in &command.args {
if arg == "%1" {
cmd.arg(path);
} else {
cmd.arg(arg);
let path = Path::new(arg);
// turn relative paths into absolute paths - so the uninstall command can use them
// since the !uninstfinalize NSIS hook runs in a different directory
if path.exists() && path.is_relative() {
cmd.arg(cwd.join(path));
} else {
cmd.arg(arg);
}
}
}
Ok(cmd)
@@ -241,9 +250,9 @@ pub fn sign<P: AsRef<Path>>(path: P, params: &SignParams) -> crate::Result<()> {
}
}
pub fn try_sign(file_path: &std::path::PathBuf, settings: &Settings) -> crate::Result<()> {
pub fn try_sign<P: AsRef<Path>>(file_path: P, settings: &Settings) -> crate::Result<()> {
if settings.can_sign() {
log::info!(action = "Signing"; "{}", tauri_utils::display_path(file_path));
log::info!(action = "Signing"; "{}", tauri_utils::display_path(file_path.as_ref()));
sign(file_path, &settings.sign_params())?;
}
Ok(())

View File

@@ -3,15 +3,12 @@
// SPDX-License-Identifier: MIT
use std::{
fs::{create_dir_all, File},
io::{Cursor, Read, Write},
fs::create_dir_all,
path::{Path, PathBuf},
};
use ureq::ResponseExt;
use regex::Regex;
use sha2::Digest;
use url::Url;
use zip::ZipArchive;
use crate::utils::http_utils::download;
pub const WEBVIEW2_BOOTSTRAPPER_URL: &str = "https://go.microsoft.com/fwlink/p/?LinkId=2124703";
pub const WEBVIEW2_OFFLINE_INSTALLER_X86_URL: &str =
@@ -26,9 +23,12 @@ pub const WIX_OUTPUT_FOLDER_NAME: &str = "msi";
pub const WIX_UPDATER_OUTPUT_FOLDER_NAME: &str = "msi-updater";
pub fn webview2_guid_path(url: &str) -> crate::Result<(String, String)> {
let agent = ureq::AgentBuilder::new().try_proxy_from_env(true).build();
let agent: ureq::Agent = ureq::Agent::config_builder()
.proxy(ureq::Proxy::try_from_env())
.build()
.into();
let response = agent.head(url).call().map_err(Box::new)?;
let final_url = response.get_url();
let final_url = response.get_uri().to_string();
let remaining_url = final_url.strip_prefix(WEBVIEW2_URL_PREFIX).ok_or_else(|| {
anyhow::anyhow!(
"WebView2 URL prefix mismatch. Expected `{}`, found `{}`.",
@@ -69,148 +69,6 @@ pub fn download_webview2_offline_installer(base_path: &Path, arch: &str) -> crat
Ok(file_path)
}
fn generate_github_mirror_url_from_template(github_url: &str) -> Option<String> {
std::env::var("TAURI_BUNDLER_TOOLS_GITHUB_MIRROR_TEMPLATE")
.ok()
.and_then(|template| {
let re =
Regex::new(r"https://github.com/([^/]+)/([^/]+)/releases/download/([^/]+)/(.*)").unwrap();
re.captures(github_url).map(|caps| {
template
.replace("<owner>", &caps[1])
.replace("<repo>", &caps[2])
.replace("<version>", &caps[3])
.replace("<asset>", &caps[4])
})
})
}
fn generate_github_mirror_url_from_base(github_url: &str) -> Option<String> {
std::env::var("TAURI_BUNDLER_TOOLS_GITHUB_MIRROR")
.ok()
.and_then(|cdn| Url::parse(&cdn).ok())
.map(|mut cdn| {
cdn.set_path(github_url);
cdn.to_string()
})
}
fn generate_github_alternative_url(url: &str) -> Option<(ureq::Agent, String)> {
if !url.starts_with("https://github.com/") {
return None;
}
generate_github_mirror_url_from_template(url)
.or_else(|| generate_github_mirror_url_from_base(url))
.map(|alt_url| (ureq::AgentBuilder::new().build(), alt_url))
}
fn create_agent_and_url(url: &str) -> (ureq::Agent, String) {
generate_github_alternative_url(url).unwrap_or((
ureq::AgentBuilder::new().try_proxy_from_env(true).build(),
url.to_owned(),
))
}
pub fn download(url: &str) -> crate::Result<Vec<u8>> {
let (agent, final_url) = create_agent_and_url(url);
log::info!(action = "Downloading"; "{}", final_url);
let response = agent.get(&final_url).call().map_err(Box::new)?;
let mut bytes = Vec::new();
response.into_reader().read_to_end(&mut bytes)?;
Ok(bytes)
}
#[derive(Clone, Copy)]
pub enum HashAlgorithm {
#[cfg(target_os = "windows")]
Sha256,
Sha1,
}
/// Function used to download a file and checks SHA256 to verify the download.
pub fn download_and_verify(
url: &str,
hash: &str,
hash_algorithm: HashAlgorithm,
) -> crate::Result<Vec<u8>> {
let data = download(url)?;
log::info!("validating hash");
verify_hash(&data, hash, hash_algorithm)?;
Ok(data)
}
pub fn verify_hash(data: &[u8], hash: &str, hash_algorithm: HashAlgorithm) -> crate::Result<()> {
match hash_algorithm {
#[cfg(target_os = "windows")]
HashAlgorithm::Sha256 => {
let hasher = sha2::Sha256::new();
verify_data_with_hasher(data, hash, hasher)
}
HashAlgorithm::Sha1 => {
let hasher = sha1::Sha1::new();
verify_data_with_hasher(data, hash, hasher)
}
}
}
fn verify_data_with_hasher(data: &[u8], hash: &str, mut hasher: impl Digest) -> crate::Result<()> {
hasher.update(data);
let url_hash = hasher.finalize().to_vec();
let expected_hash = hex::decode(hash)?;
if expected_hash == url_hash {
Ok(())
} else {
Err(crate::Error::HashError)
}
}
pub fn verify_file_hash<P: AsRef<Path>>(
path: P,
hash: &str,
hash_algorithm: HashAlgorithm,
) -> crate::Result<()> {
let data = std::fs::read(path)?;
verify_hash(&data, hash, hash_algorithm)
}
/// Extracts the zips from memory into a usable path.
#[allow(dead_code)]
pub fn extract_zip(data: &[u8], path: &Path) -> crate::Result<()> {
let cursor = Cursor::new(data);
let mut zipa = ZipArchive::new(cursor)?;
for i in 0..zipa.len() {
let mut file = zipa.by_index(i)?;
if let Some(name) = file.enclosed_name() {
let dest_path = path.join(name);
if file.is_dir() {
create_dir_all(&dest_path)?;
continue;
}
let parent = dest_path.parent().expect("Failed to get parent");
if !parent.exists() {
create_dir_all(parent)?;
}
let mut buff: Vec<u8> = Vec::new();
file.read_to_end(&mut buff)?;
let mut fileout = File::create(dest_path).expect("Failed to open file");
fileout.write_all(&buff)?;
}
}
Ok(())
}
#[cfg(target_os = "windows")]
pub fn os_bitness<'a>() -> Option<&'a str> {
use windows_sys::Win32::System::SystemInformation::{
@@ -226,56 +84,76 @@ pub fn os_bitness<'a>() -> Option<&'a str> {
}
}
#[cfg(test)]
mod tests {
use super::generate_github_mirror_url_from_template;
use std::env;
pub fn patch_binary(binary_path: &PathBuf, package_type: &crate::PackageType) -> crate::Result<()> {
let file_data = std::fs::read(binary_path)?;
let mut file_data = file_data; // make mutable
const GITHUB_ASSET_URL: &str =
"https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip";
const NON_GITHUB_ASSET_URL: &str = "https://someotherwebsite.com/somefile.zip";
let pe = match goblin::Object::parse(&file_data)? {
goblin::Object::PE(pe) => pe,
_ => {
return Err(crate::Error::BinaryParseError(
std::io::Error::new(std::io::ErrorKind::InvalidInput, "binary is not a PE file").into(),
));
}
};
#[test]
fn test_generate_mirror_url_no_env_var() {
env::remove_var("TAURI_BUNDLER_TOOLS_GITHUB_MIRROR_TEMPLATE");
let tauri_bundle_section = pe
.sections
.iter()
.find(|s| s.name().unwrap_or_default() == ".taubndl")
.ok_or(crate::Error::MissingBundleTypeVar)?;
assert!(generate_github_mirror_url_from_template(GITHUB_ASSET_URL).is_none());
let data_offset = tauri_bundle_section.pointer_to_raw_data as usize;
if data_offset + 8 > file_data.len() {
return Err(crate::Error::BinaryOffsetOutOfRange);
}
#[test]
fn test_generate_mirror_url_non_github_url() {
env::set_var(
"TAURI_BUNDLER_TOOLS_GITHUB_MIRROR_TEMPLATE",
"https://mirror.example.com/<owner>/<repo>/releases/download/<version>/<asset>",
);
let ptr_bytes = &file_data[data_offset..data_offset + 8];
let ptr_value = u64::from_le_bytes(ptr_bytes.try_into().map_err(|_| {
crate::Error::BinaryParseError(
std::io::Error::new(std::io::ErrorKind::InvalidData, "invalid pointer bytes").into(),
)
})?);
assert!(generate_github_mirror_url_from_template(NON_GITHUB_ASSET_URL).is_none());
let rdata_section = pe
.sections
.iter()
.find(|s| s.name().unwrap_or_default() == ".rdata")
.ok_or_else(|| {
crate::Error::BinaryParseError(
std::io::Error::new(std::io::ErrorKind::InvalidInput, ".rdata section not found").into(),
)
})?;
let rva = ptr_value.checked_sub(pe.image_base as u64).ok_or_else(|| {
crate::Error::BinaryParseError(
std::io::Error::new(std::io::ErrorKind::InvalidData, "invalid RVA offset").into(),
)
})?;
let file_offset = rdata_section.pointer_to_raw_data as usize
+ (rva as usize).saturating_sub(rdata_section.virtual_address as usize);
if file_offset + 3 > file_data.len() {
return Err(crate::Error::BinaryOffsetOutOfRange);
}
struct TestCase {
template: &'static str,
expected_url: &'static str,
}
#[test]
fn test_generate_mirror_url_correctly() {
let test_cases = vec![
TestCase {
template: "https://mirror.example.com/<owner>/<repo>/releases/download/<version>/<asset>",
expected_url: "https://mirror.example.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip",
},
TestCase {
template: "https://mirror.example.com/<asset>",
expected_url: "https://mirror.example.com/wix311-binaries.zip",
},
];
for case in test_cases {
env::set_var("TAURI_BUNDLER_TOOLS_GITHUB_MIRROR_TEMPLATE", case.template);
assert_eq!(
generate_github_mirror_url_from_template(GITHUB_ASSET_URL),
Some(case.expected_url.to_string())
);
// Overwrite the string at that offset
let string_bytes = &mut file_data[file_offset..file_offset + 3];
match package_type {
crate::PackageType::Nsis => string_bytes.copy_from_slice(b"NSS"),
crate::PackageType::WindowsMsi => string_bytes.copy_from_slice(b"MSI"),
_ => {
return Err(crate::Error::InvalidPackageType(
package_type.short_name().to_owned(),
"windows".to_owned(),
));
}
}
std::fs::write(binary_path, &file_data)
.map_err(|e| crate::Error::BinaryWriteError(e.to_string()))?;
Ok(())
}

View File

@@ -64,6 +64,21 @@ pub enum Error {
/// Failed to validate downloaded file hash.
#[error("hash mismatch of downloaded file")]
HashError,
/// Failed to parse binary
#[error("Binary parse error: `{0}`")]
BinaryParseError(#[from] goblin::error::Error),
/// Package type is not supported by target platform
#[error("Wrong package type {0} for platform {1}")]
InvalidPackageType(String, String),
/// Bundle type symbol missing in binary
#[error("__TAURI_BUNDLE_TYPE variable not found in binary. Make sure tauri crate and tauri-cli are up to date")]
MissingBundleTypeVar,
/// Failed to write binary file changed
#[error("Failed to write binary file changes: `{0}`")]
BinaryWriteError(String),
/// Invalid offset while patching binary file
#[error("Invalid offset while patching binary file")]
BinaryOffsetOutOfRange,
/// Unsupported architecture.
#[error("Architecture Error: `{0}`")]
ArchError(String),

View File

@@ -3,8 +3,6 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
//! [![](https://github.com/tauri-apps/tauri/raw/dev/.github/splash.png)](https://tauri.app)
//!
//! The Tauri bundler is a tool that generates installers or app bundles for executables.
//! It supports auto updating through [tauri](https://docs.rs/tauri).
//!
@@ -25,5 +23,6 @@
/// The bundle API.
pub mod bundle;
mod error;
mod utils;
pub use bundle::*;
pub use error::{Error, Result};

View File

@@ -4,28 +4,11 @@
// SPDX-License-Identifier: MIT
use std::{
ffi::OsStr,
fs::{self, File},
io::{self, BufRead, BufReader, BufWriter},
io::{self, BufWriter},
path::Path,
process::{Command, ExitStatus, Output, Stdio},
sync::{Arc, Mutex},
};
/// Returns true if the path has a filename indicating that it is a high-density
/// "retina" icon. Specifically, returns true the file stem ends with
/// "@2x" (a convention specified by the [Apple developer docs](
/// <https://developer.apple.com/library/mac/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Optimizing/Optimizing.html>)).
#[allow(dead_code)]
pub fn is_retina<P: AsRef<Path>>(path: P) -> bool {
path
.as_ref()
.file_stem()
.and_then(OsStr::to_str)
.map(|stem| stem.ends_with("@2x"))
.unwrap_or(false)
}
/// Creates a new file at the given path, creating any parent directories as
/// needed.
pub fn create_file(path: &Path) -> crate::Result<BufWriter<File>> {
@@ -36,6 +19,36 @@ pub fn create_file(path: &Path) -> crate::Result<BufWriter<File>> {
Ok(BufWriter::new(file))
}
/// Creates the given directory path,
/// erasing it first if specified.
#[allow(dead_code)]
pub fn create_dir(path: &Path, erase: bool) -> crate::Result<()> {
if erase && path.exists() {
remove_dir_all(path)?;
}
Ok(fs::create_dir(path)?)
}
/// Creates all of the directories of the specified path,
/// erasing it first if specified.
#[allow(dead_code)]
pub fn create_dir_all(path: &Path, erase: bool) -> crate::Result<()> {
if erase && path.exists() {
remove_dir_all(path)?;
}
Ok(fs::create_dir_all(path)?)
}
/// Removes the directory and its contents if it exists.
#[allow(dead_code)]
pub fn remove_dir_all(path: &Path) -> crate::Result<()> {
if path.exists() {
Ok(fs::remove_dir_all(path)?)
} else {
Ok(())
}
}
/// Makes a symbolic link to a directory.
#[cfg(unix)]
#[allow(dead_code)]
@@ -63,11 +76,9 @@ fn symlink_file(src: &Path, dst: &Path) -> io::Result<()> {
}
/// Copies a regular file from one path to another, creating any parent
/// directories of the destination path as necessary. Fails if the source path
/// directories of the destination path as necessary. Fails if the source path
/// is a directory or doesn't exist.
pub fn copy_file(from: impl AsRef<Path>, to: impl AsRef<Path>) -> crate::Result<()> {
let from = from.as_ref();
let to = to.as_ref();
pub fn copy_file(from: &Path, to: &Path) -> crate::Result<()> {
if !from.exists() {
return Err(crate::Error::GenericError(format!(
"{from:?} does not exist"
@@ -100,9 +111,6 @@ pub fn copy_dir(from: &Path, to: &Path) -> crate::Result<()> {
"{from:?} is not a Directory"
)));
}
if to.exists() {
return Err(crate::Error::GenericError(format!("{to:?} already exists")));
}
let parent = to.parent().expect("No data in parent");
fs::create_dir_all(parent)?;
for entry in walkdir::WalkDir::new(from) {
@@ -118,7 +126,7 @@ pub fn copy_dir(from: &Path, to: &Path) -> crate::Result<()> {
symlink_file(&target, &dest_path)?;
}
} else if entry.file_type().is_dir() {
fs::create_dir(dest_path)?;
fs::create_dir_all(dest_path)?;
} else {
fs::copy(entry.path(), dest_path)?;
}
@@ -151,7 +159,7 @@ pub fn copy_custom_files(
pkg_path
};
if path.is_file() {
copy_file(path, data_dir.join(pkg_path))?;
copy_file(path, &data_dir.join(pkg_path))?;
} else {
copy_dir(path, &data_dir.join(pkg_path))?;
}
@@ -159,93 +167,10 @@ pub fn copy_custom_files(
Ok(())
}
pub trait CommandExt {
// The `pipe` function sets the stdout and stderr to properly
// show the command output in the Node.js wrapper.
fn piped(&mut self) -> std::io::Result<ExitStatus>;
fn output_ok(&mut self) -> crate::Result<Output>;
}
impl CommandExt for Command {
fn piped(&mut self) -> std::io::Result<ExitStatus> {
self.stdin(os_pipe::dup_stdin()?);
self.stdout(os_pipe::dup_stdout()?);
self.stderr(os_pipe::dup_stderr()?);
let program = self.get_program().to_string_lossy().into_owned();
log::debug!(action = "Running"; "Command `{} {}`", program, self.get_args().map(|arg| arg.to_string_lossy()).fold(String::new(), |acc, arg| format!("{acc} {arg}")));
self.status().map_err(Into::into)
}
fn output_ok(&mut self) -> crate::Result<Output> {
let program = self.get_program().to_string_lossy().into_owned();
log::debug!(action = "Running"; "Command `{} {}`", program, self.get_args().map(|arg| arg.to_string_lossy()).fold(String::new(), |acc, arg| format!("{acc} {arg}")));
self.stdout(Stdio::piped());
self.stderr(Stdio::piped());
let mut child = self.spawn()?;
let mut stdout = child.stdout.take().map(BufReader::new).unwrap();
let stdout_lines = Arc::new(Mutex::new(Vec::new()));
let stdout_lines_ = stdout_lines.clone();
std::thread::spawn(move || {
let mut line = String::new();
let mut lines = stdout_lines_.lock().unwrap();
loop {
line.clear();
match stdout.read_line(&mut line) {
Ok(0) => break,
Ok(_) => {
log::debug!(action = "stdout"; "{}", line.trim_end());
lines.extend(line.as_bytes().to_vec());
}
Err(_) => (),
}
}
});
let mut stderr = child.stderr.take().map(BufReader::new).unwrap();
let stderr_lines = Arc::new(Mutex::new(Vec::new()));
let stderr_lines_ = stderr_lines.clone();
std::thread::spawn(move || {
let mut line = String::new();
let mut lines = stderr_lines_.lock().unwrap();
loop {
line.clear();
match stderr.read_line(&mut line) {
Ok(0) => break,
Ok(_) => {
log::debug!(action = "stderr"; "{}", line.trim_end());
lines.extend(line.as_bytes().to_vec());
}
Err(_) => (),
}
}
});
let status = child.wait()?;
let output = Output {
status,
stdout: std::mem::take(&mut *stdout_lines.lock().unwrap()),
stderr: std::mem::take(&mut *stderr_lines.lock().unwrap()),
};
if output.status.success() {
Ok(output)
} else {
Err(crate::Error::GenericError(format!(
"failed to run {program}"
)))
}
}
}
#[cfg(test)]
mod tests {
use super::{create_file, is_retina};
use std::{io::Write, path::PathBuf};
use tauri_utils::resources::resource_relpath;
use super::create_file;
use std::io::Write;
#[test]
fn create_file_with_parent_dirs() {
@@ -263,6 +188,8 @@ mod tests {
#[cfg(not(windows))]
#[test]
fn copy_dir_with_symlinks() {
use std::path::PathBuf;
// Create a directory structure that looks like this:
// ${TMP}/orig/
// sub/
@@ -310,26 +237,4 @@ mod tests {
b"Hello, world!\n"
);
}
#[test]
fn retina_icon_paths() {
assert!(!is_retina("data/icons/512x512.png"));
assert!(is_retina("data/icons/512x512@2x.png"));
}
#[test]
fn resource_relative_paths() {
assert_eq!(
resource_relpath(&PathBuf::from("./data/images/button.png")),
PathBuf::from("data/images/button.png")
);
assert_eq!(
resource_relpath(&PathBuf::from("../../images/wheel.png")),
PathBuf::from("_up_/_up_/images/wheel.png")
);
assert_eq!(
resource_relpath(&PathBuf::from("/home/ferris/crab.png")),
PathBuf::from("_root_/home/ferris/crab.png")
);
}
}

View File

@@ -0,0 +1,219 @@
// 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
use std::{
fs::{create_dir_all, File},
io::{Cursor, Read, Write},
path::Path,
};
use regex::Regex;
use sha2::Digest;
use url::Url;
use zip::ZipArchive;
fn generate_github_mirror_url_from_template(github_url: &str) -> Option<String> {
std::env::var("TAURI_BUNDLER_TOOLS_GITHUB_MIRROR_TEMPLATE")
.ok()
.and_then(|template| {
let re =
Regex::new(r"https://github.com/([^/]+)/([^/]+)/releases/download/([^/]+)/(.*)").unwrap();
re.captures(github_url).map(|caps| {
template
.replace("<owner>", &caps[1])
.replace("<repo>", &caps[2])
.replace("<version>", &caps[3])
.replace("<asset>", &caps[4])
})
})
}
fn generate_github_mirror_url_from_base(github_url: &str) -> Option<String> {
std::env::var("TAURI_BUNDLER_TOOLS_GITHUB_MIRROR")
.ok()
.and_then(|cdn| Url::parse(&cdn).ok())
.map(|mut cdn| {
cdn.set_path(github_url);
cdn.to_string()
})
}
fn generate_github_alternative_url(url: &str) -> Option<(ureq::Agent, String)> {
if !url.starts_with("https://github.com/") {
return None;
}
generate_github_mirror_url_from_template(url)
.or_else(|| generate_github_mirror_url_from_base(url))
.map(|alt_url| (ureq::agent(), alt_url))
}
fn create_agent_and_url(url: &str) -> (ureq::Agent, String) {
generate_github_alternative_url(url).unwrap_or((
ureq::Agent::config_builder()
.proxy(ureq::Proxy::try_from_env())
.build()
.into(),
url.to_owned(),
))
}
#[allow(dead_code)]
pub fn download(url: &str) -> crate::Result<Vec<u8>> {
let (agent, final_url) = create_agent_and_url(url);
log::info!(action = "Downloading"; "{}", final_url);
let response = agent.get(&final_url).call().map_err(Box::new)?;
let mut bytes = Vec::new();
response.into_body().into_reader().read_to_end(&mut bytes)?;
Ok(bytes)
}
#[allow(dead_code)]
#[derive(Clone, Copy)]
pub enum HashAlgorithm {
#[cfg(target_os = "windows")]
Sha256,
Sha1,
}
/// Function used to download a file and checks SHA256 to verify the download.
#[allow(dead_code)]
pub fn download_and_verify(
url: &str,
hash: &str,
hash_algorithm: HashAlgorithm,
) -> crate::Result<Vec<u8>> {
let data = download(url)?;
log::info!("validating hash");
verify_hash(&data, hash, hash_algorithm)?;
Ok(data)
}
#[allow(dead_code)]
pub fn verify_hash(data: &[u8], hash: &str, hash_algorithm: HashAlgorithm) -> crate::Result<()> {
match hash_algorithm {
#[cfg(target_os = "windows")]
HashAlgorithm::Sha256 => {
let hasher = sha2::Sha256::new();
verify_data_with_hasher(data, hash, hasher)
}
HashAlgorithm::Sha1 => {
let hasher = sha1::Sha1::new();
verify_data_with_hasher(data, hash, hasher)
}
}
}
fn verify_data_with_hasher(data: &[u8], hash: &str, mut hasher: impl Digest) -> crate::Result<()> {
hasher.update(data);
let url_hash = hasher.finalize().to_vec();
let expected_hash = hex::decode(hash)?;
if expected_hash == url_hash {
Ok(())
} else {
Err(crate::Error::HashError)
}
}
#[allow(dead_code)]
pub fn verify_file_hash<P: AsRef<Path>>(
path: P,
hash: &str,
hash_algorithm: HashAlgorithm,
) -> crate::Result<()> {
let data = std::fs::read(path)?;
verify_hash(&data, hash, hash_algorithm)
}
/// Extracts the zips from memory into a usable path.
#[allow(dead_code)]
pub fn extract_zip(data: &[u8], path: &Path) -> crate::Result<()> {
let cursor = Cursor::new(data);
let mut zipa = ZipArchive::new(cursor)?;
for i in 0..zipa.len() {
let mut file = zipa.by_index(i)?;
if let Some(name) = file.enclosed_name() {
let dest_path = path.join(name);
if file.is_dir() {
create_dir_all(&dest_path)?;
continue;
}
let parent = dest_path.parent().expect("Failed to get parent");
if !parent.exists() {
create_dir_all(parent)?;
}
let mut buff: Vec<u8> = Vec::new();
file.read_to_end(&mut buff)?;
let mut fileout = File::create(dest_path).expect("Failed to open file");
fileout.write_all(&buff)?;
}
}
Ok(())
}
#[cfg(test)]
mod tests {
use super::generate_github_mirror_url_from_template;
use std::env;
const GITHUB_ASSET_URL: &str =
"https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip";
const NON_GITHUB_ASSET_URL: &str = "https://someotherwebsite.com/somefile.zip";
#[test]
fn test_generate_mirror_url_no_env_var() {
env::remove_var("TAURI_BUNDLER_TOOLS_GITHUB_MIRROR_TEMPLATE");
assert!(generate_github_mirror_url_from_template(GITHUB_ASSET_URL).is_none());
}
#[test]
fn test_generate_mirror_url_non_github_url() {
env::set_var(
"TAURI_BUNDLER_TOOLS_GITHUB_MIRROR_TEMPLATE",
"https://mirror.example.com/<owner>/<repo>/releases/download/<version>/<asset>",
);
assert!(generate_github_mirror_url_from_template(NON_GITHUB_ASSET_URL).is_none());
}
struct TestCase {
template: &'static str,
expected_url: &'static str,
}
#[test]
fn test_generate_mirror_url_correctly() {
let test_cases = vec![
TestCase {
template: "https://mirror.example.com/<owner>/<repo>/releases/download/<version>/<asset>",
expected_url: "https://mirror.example.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip",
},
TestCase {
template: "https://mirror.example.com/<asset>",
expected_url: "https://mirror.example.com/wix311-binaries.zip",
},
];
for case in test_cases {
env::set_var("TAURI_BUNDLER_TOOLS_GITHUB_MIRROR_TEMPLATE", case.template);
assert_eq!(
generate_github_mirror_url_from_template(GITHUB_ASSET_URL),
Some(case.expected_url.to_string())
);
}
}
}

View File

@@ -0,0 +1,141 @@
// 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
use std::{
ffi::OsStr,
io::{BufRead, BufReader},
path::Path,
process::{Command, ExitStatus, Output, Stdio},
sync::{Arc, Mutex},
};
pub mod fs_utils;
pub mod http_utils;
/// Returns true if the path has a filename indicating that it is a high-density
/// "retina" icon. Specifically, returns true the file stem ends with
/// "@2x" (a convention specified by the [Apple developer docs](
/// <https://developer.apple.com/library/mac/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Optimizing/Optimizing.html>)).
#[allow(dead_code)]
pub fn is_retina(path: &Path) -> bool {
path
.file_stem()
.and_then(OsStr::to_str)
.map(|stem| stem.ends_with("@2x"))
.unwrap_or(false)
}
pub trait CommandExt {
// The `pipe` function sets the stdout and stderr to properly
// show the command output in the Node.js wrapper.
fn piped(&mut self) -> std::io::Result<ExitStatus>;
fn output_ok(&mut self) -> crate::Result<Output>;
}
impl CommandExt for Command {
fn piped(&mut self) -> std::io::Result<ExitStatus> {
self.stdin(os_pipe::dup_stdin()?);
self.stdout(os_pipe::dup_stdout()?);
self.stderr(os_pipe::dup_stderr()?);
let program = self.get_program().to_string_lossy().into_owned();
log::debug!(action = "Running"; "Command `{} {}`", program, self.get_args().map(|arg| arg.to_string_lossy()).fold(String::new(), |acc, arg| format!("{acc} {arg}")));
self.status()
}
fn output_ok(&mut self) -> crate::Result<Output> {
let program = self.get_program().to_string_lossy().into_owned();
log::debug!(action = "Running"; "Command `{} {}`", program, self.get_args().map(|arg| arg.to_string_lossy()).fold(String::new(), |acc, arg| format!("{acc} {arg}")));
self.stdout(Stdio::piped());
self.stderr(Stdio::piped());
let mut child = self.spawn()?;
let mut stdout = child.stdout.take().map(BufReader::new).unwrap();
let stdout_lines = Arc::new(Mutex::new(Vec::new()));
let stdout_lines_ = stdout_lines.clone();
std::thread::spawn(move || {
let mut line = String::new();
let mut lines = stdout_lines_.lock().unwrap();
loop {
line.clear();
match stdout.read_line(&mut line) {
Ok(0) => break,
Ok(_) => {
log::debug!(action = "stdout"; "{}", line.trim_end());
lines.extend(line.as_bytes().to_vec());
}
Err(_) => (),
}
}
});
let mut stderr = child.stderr.take().map(BufReader::new).unwrap();
let stderr_lines = Arc::new(Mutex::new(Vec::new()));
let stderr_lines_ = stderr_lines.clone();
std::thread::spawn(move || {
let mut line = String::new();
let mut lines = stderr_lines_.lock().unwrap();
loop {
line.clear();
match stderr.read_line(&mut line) {
Ok(0) => break,
Ok(_) => {
log::debug!(action = "stderr"; "{}", line.trim_end());
lines.extend(line.as_bytes().to_vec());
}
Err(_) => (),
}
}
});
let status = child.wait()?;
let output = Output {
status,
stdout: std::mem::take(&mut *stdout_lines.lock().unwrap()),
stderr: std::mem::take(&mut *stderr_lines.lock().unwrap()),
};
if output.status.success() {
Ok(output)
} else {
Err(crate::Error::GenericError(format!(
"failed to run {program}"
)))
}
}
}
#[cfg(test)]
mod tests {
use std::path::{Path, PathBuf};
use tauri_utils::resources::resource_relpath;
use super::is_retina;
#[test]
fn retina_icon_paths() {
assert!(!is_retina(Path::new("data/icons/512x512.png")));
assert!(is_retina(Path::new("data/icons/512x512@2x.png")));
}
#[test]
fn resource_relative_paths() {
assert_eq!(
resource_relpath(Path::new("./data/images/button.png")),
PathBuf::from("data/images/button.png")
);
assert_eq!(
resource_relpath(Path::new("../../images/wheel.png")),
PathBuf::from("_up_/_up_/images/wheel.png")
);
assert_eq!(
resource_relpath(Path::new("/home/ferris/crab.png")),
PathBuf::from("_root_/home/ferris/crab.png")
);
}
}

View File

@@ -1,5 +1,310 @@
# Changelog
## \[2.7.0]
### New Features
- [`33d079392`](https://www.github.com/tauri-apps/tauri/commit/33d079392ac4a5a153b7d8a6d82fefd6f54a2bdf) ([#13811](https://www.github.com/tauri-apps/tauri/pull/13811) by [@mhbagheri-99](https://www.github.com/tauri-apps/tauri/../../mhbagheri-99)) Allow runner configuration to be an object with cmd, cwd, and args properties. The runner can now be configured as `{ "cmd": "my_runner", "cwd": "/path", "args": ["--quiet"] }` while maintaining backwards compatibility with the existing string format.
### Enhancements
- [`232265c70`](https://www.github.com/tauri-apps/tauri/commit/232265c70e1c213bbb3f84b5541ddc07d330fce1) ([#13209](https://www.github.com/tauri-apps/tauri/pull/13209) by [@kandrelczyk](https://www.github.com/tauri-apps/tauri/../../kandrelczyk)) Binaries are patched before bundling to add the type of a bundle they will placed in. This information will be used during update process to select the correct target.
### Bug Fixes
- [`916aeaa48`](https://www.github.com/tauri-apps/tauri/commit/916aeaa48646a483a78e51cfe1633800ee62c37c) ([#13781](https://www.github.com/tauri-apps/tauri/pull/13781) by [@lucasfernog](https://www.github.com/tauri-apps/tauri/../../lucasfernog)) Fixes Android dev and build commands reading `tauri.ios.conf.json` instead of `tauri.android.conf.json` to merge platform-specific configuration.
- [`acd757428`](https://www.github.com/tauri-apps/tauri/commit/acd7574284056f9c00894cdce6c07f948fd80c87) ([#13743](https://www.github.com/tauri-apps/tauri/pull/13743) by [@owjs3901](https://www.github.com/tauri-apps/tauri/../../owjs3901)) Fix type of CFBundleVersion generated by `tauri ios init` when `bundleVersion` is a single number (for example `1` instead of `1.0.0`).
- [`0f248b111`](https://www.github.com/tauri-apps/tauri/commit/0f248b111ffb8af934eaf64bd8f4591e628da786) ([#13799](https://www.github.com/tauri-apps/tauri/pull/13799) by [@lucasfernog](https://www.github.com/tauri-apps/tauri/../../lucasfernog)) Install iOS dependencies when needed.
- [`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.
- [`bda830410`](https://www.github.com/tauri-apps/tauri/commit/bda8304107da7ca60caaba5674faa793491898c6) ([#13833](https://www.github.com/tauri-apps/tauri/pull/13833) by [@Legend-Master](https://www.github.com/tauri-apps/tauri/../../Legend-Master)) Fail with an error when trying to migrate from v2 alpha
- [`bda830410`](https://www.github.com/tauri-apps/tauri/commit/bda8304107da7ca60caaba5674faa793491898c6) ([#13833](https://www.github.com/tauri-apps/tauri/pull/13833) by [@Legend-Master](https://www.github.com/tauri-apps/tauri/../../Legend-Master)) Use v2 stable instead of v2-rc when migrating from v2-beta
### What's Changed
- [`cfc5bb819`](https://www.github.com/tauri-apps/tauri/commit/cfc5bb819637a97141cbda3285c5d772cfc0ebca) ([#13780](https://www.github.com/tauri-apps/tauri/pull/13780) by [@Legend-Master](https://www.github.com/tauri-apps/tauri/../../Legend-Master)) Enable edge to edge in `tauri android init` template
- [`12e359061`](https://www.github.com/tauri-apps/tauri/commit/12e3590613c7b4370aeddc16db7e29335e3a7684) ([#13759](https://www.github.com/tauri-apps/tauri/pull/13759) by [@owjs3901](https://www.github.com/tauri-apps/tauri/../../owjs3901)) Update compileSdk, targetSdk in android template to 36
### Dependencies
- Upgraded to `tauri-bundler@2.5.1`
- Upgraded to `tauri-utils@2.6.0`
## \[2.6.2]
### Bug Fixes
- [`cbd962972`](https://www.github.com/tauri-apps/tauri/commit/cbd9629729ed6eb208ba2234d014c11c4e9f1c8c) ([#13730](https://www.github.com/tauri-apps/tauri/pull/13730) by [@lucasfernog](https://www.github.com/tauri-apps/tauri/../../lucasfernog)) Load `--config` arguments when running the Xcode and Android Studio build scripts.
## \[2.6.1]
### Bug Fixes
- [`4b7370e9e`](https://www.github.com/tauri-apps/tauri/commit/4b7370e9e0ba299361c8ad96c08882337e44f091) ([#13710](https://www.github.com/tauri-apps/tauri/pull/13710) by [@FabianLars](https://www.github.com/tauri-apps/tauri/../../FabianLars)) Fixed an issue in the plugin template (`tauri plugin init`) that prevented the js build command to fail.
## \[2.6.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.
- [`3242e1c94`](https://www.github.com/tauri-apps/tauri/commit/3242e1c946c441b58665ba5d612f3a3f1eafe0b6) ([#13659](https://www.github.com/tauri-apps/tauri/pull/13659) by [@lucasfernog](https://www.github.com/tauri-apps/tauri/../../lucasfernog)) Allow passing Cargo arguments to mobile dev and build commands.
- [`d1ce9af62`](https://www.github.com/tauri-apps/tauri/commit/d1ce9af62881e3f7d86a495c9c40df5b7f9d1c04) ([#13660](https://www.github.com/tauri-apps/tauri/pull/13660) by [@lucasfernog](https://www.github.com/tauri-apps/tauri/../../lucasfernog)) Allow passing `--config` arguments to the `ios init` and `android init` commands to tweak the configuration used to initialize the mobile projects.
- [`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"`.
- [`4a880ca69`](https://www.github.com/tauri-apps/tauri/commit/4a880ca697bab6d63a2a51ea94e1988cc8c4ea4a) ([#13658](https://www.github.com/tauri-apps/tauri/pull/13658) by [@lucasfernog](https://www.github.com/tauri-apps/tauri/../../lucasfernog)) Synchronize Tauri config productName changes with the iOS Xcode project.
- [`8ee14a864`](https://www.github.com/tauri-apps/tauri/commit/8ee14a86480510c15823586cf28084e615cb7a9c) ([#13618](https://www.github.com/tauri-apps/tauri/pull/13618) by [@Sky-walkerX](https://www.github.com/tauri-apps/tauri/../../Sky-walkerX)) Warn the user that the app id shouldn't end in `.app` because it conflicts with the application bundle extension on macOS
### Bug Fixes
- [`574a4d4d3`](https://www.github.com/tauri-apps/tauri/commit/574a4d4d36762b5b09dc3fcfcbcae3a0df0b6d89) ([#13426](https://www.github.com/tauri-apps/tauri/pull/13426) by [@Legend-Master](https://www.github.com/tauri-apps/tauri/../../Legend-Master)) Fix `dev`, `build` and `bundle` commands always take 2 seconds to start
- [`35aa7e121`](https://www.github.com/tauri-apps/tauri/commit/35aa7e1218f34d0805e280e3ec32529d0cb0d733) ([#13294](https://www.github.com/tauri-apps/tauri/pull/13294) by [@kingsword09](https://www.github.com/tauri-apps/tauri/../../kingsword09)) fix: allow the target directory to be inside frontendDir as long as it is not the Rust target directory inside frontendDir.
- [`ec6065fa4`](https://www.github.com/tauri-apps/tauri/commit/ec6065fa4a6427266ecfb0c0f62f008574bb7880) ([#13625](https://www.github.com/tauri-apps/tauri/pull/13625) by [@lucasfernog](https://www.github.com/tauri-apps/tauri/../../lucasfernog)) Fixes Android and iOS dev/build commands not working when the app identifier is being modified by the `--config` option.
- [`5a5291d66`](https://www.github.com/tauri-apps/tauri/commit/5a5291d66cb8a955c9d4f8e975782646ac0cc6e7) ([#13483](https://www.github.com/tauri-apps/tauri/pull/13483) by [@lucasfernog](https://www.github.com/tauri-apps/tauri/../../lucasfernog)) Fix simulator build detection on Xcode.
### Dependencies
- Upgraded to `tauri-bundler@2.5.0`
- Upgraded to `tauri-utils@2.5.0`
- [`9c16eefa3`](https://www.github.com/tauri-apps/tauri/commit/9c16eefa319b4697bac1d1019bbb5f93eca63173) ([#13629](https://www.github.com/tauri-apps/tauri/pull/13629) by [@sftse](https://www.github.com/tauri-apps/tauri/../../sftse)) Update html5ever to 0.29 and kuchikiki to version 0.8.8-speedreader.
## \[2.5.0]
### New Features
- [`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
- [`ad3fd3890`](https://www.github.com/tauri-apps/tauri/commit/ad3fd3890f1fa26a9f9be04ff1bc156d6dd2a8bc) ([#13152](https://www.github.com/tauri-apps/tauri/pull/13152)) Detect package manager from environment variable `npm_config_user_agent` first
- [`82406c61e`](https://www.github.com/tauri-apps/tauri/commit/82406c61e0fbb775ef00791ccab45349325bdd45) ([#13231](https://www.github.com/tauri-apps/tauri/pull/13231)) Improve iOS simulator usage, checking if Xcode iOS SDK is installed and allowing usage of Simulator for older iOS releases (previously only supported when running on Xcode via `ios dev --open`).
### Bug Fixes
- [`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.
- [`080252903`](https://www.github.com/tauri-apps/tauri/commit/0802529031c4fd309edff374a8694e93ddec161d) ([#13210](https://www.github.com/tauri-apps/tauri/pull/13210)) Fixes iOS dev not working on Xcode 16.3 simulators. To apply the fix, either regenerate the Xcode project with `rm -r src-tauri/gen/apple && tauri ios init` or remove the `arm64-sim` architecture from the Xcode project.
### Dependencies
- Upgraded to `tauri-utils@2.4.0`
- Upgraded to `tauri-bundler@2.4.0`
## \[2.4.1]
### Enhancements
- [`f805061d1`](https://www.github.com/tauri-apps/tauri/commit/f805061d1152bc4790dbdb9475a506afcdd1de75) ([#13079](https://www.github.com/tauri-apps/tauri/pull/13079) by [@Pietagorh](https://www.github.com/tauri-apps/tauri/../../Pietagorh)) Add support for passing TOML and JSON5 config files to `--config` arg
### Bug Fixes
- [`30beb6fee`](https://www.github.com/tauri-apps/tauri/commit/30beb6fee7b052e588ee72c238e315a557b5d6f2) ([#13096](https://www.github.com/tauri-apps/tauri/pull/13096) by [@Legend-Master](https://www.github.com/tauri-apps/tauri/../../Legend-Master)) Fix `tauri info` can't find the latest version for rust crates
- [`30beb6fee`](https://www.github.com/tauri-apps/tauri/commit/30beb6fee7b052e588ee72c238e315a557b5d6f2) ([#13096](https://www.github.com/tauri-apps/tauri/pull/13096) by [@Legend-Master](https://www.github.com/tauri-apps/tauri/../../Legend-Master)) Fix `tauri info` logging network operations in `info` level instead of `debug`
- [`794af778e`](https://www.github.com/tauri-apps/tauri/commit/794af778e4915ffb6a4fe9bae8fba04bc880503d) ([#13117](https://www.github.com/tauri-apps/tauri/pull/13117) by [@Legend-Master](https://www.github.com/tauri-apps/tauri/../../Legend-Master)) Fix setting merge config value to null with `--config` arg no longer works
### Dependencies
- Upgraded to `tauri-bundler@2.3.1`
- Upgraded to `tauri-utils@2.3.1`
## \[2.4.0]
### New Features
- [`d91bfa5cb`](https://www.github.com/tauri-apps/tauri/commit/d91bfa5cb921a078758edd45ef3eaff71358d1eb) ([#12970](https://www.github.com/tauri-apps/tauri/pull/12970) by [@lucasfernog](https://www.github.com/tauri-apps/tauri/../../lucasfernog)) Allow merging multiple configuration values on `tauri dev`, `tauri build`, `tauri bundle`, `tauri android dev`, `tauri android build`, `tauri ios dev` and `tauri ios build`.
- [`013f8f652`](https://www.github.com/tauri-apps/tauri/commit/013f8f652302f2d49c5ec0a075582033d8b074fb) ([#12890](https://www.github.com/tauri-apps/tauri/pull/12890) by [@Legend-Master](https://www.github.com/tauri-apps/tauri/../../Legend-Master)) Reads `build > removeUnusedCommands` from the config file and pass in the environment variables on the build command to trigger the build scripts and macros to remove unused commands based on the capabilities you defined. For this to work on inlined plugins you must add a `#![plugin(<insert_plugin_name>)]` inside the `tauri::generate_handler![]` usage and the app manifest must be set.
- [`30f5a1553`](https://www.github.com/tauri-apps/tauri/commit/30f5a1553d3c0ce460c9006764200a9210915a44) ([#12366](https://www.github.com/tauri-apps/tauri/pull/12366) by [@FabianLars](https://www.github.com/tauri-apps/tauri/../../FabianLars)) Added `trafficLightPosition` window configuration to set the traffic light buttons position on macOS.
### Enhancements
- [`f981a5ee8`](https://www.github.com/tauri-apps/tauri/commit/f981a5ee8b292b9ea09329f60cecc7f688dda734) ([#12602](https://www.github.com/tauri-apps/tauri/pull/12602) by [@kxxt](https://www.github.com/tauri-apps/tauri/../../kxxt)) Add basic support for linux riscv64 platform.
### Bug Fixes
- [`0c4700e99`](https://www.github.com/tauri-apps/tauri/commit/0c4700e9907f242eabe579eb6149a1d75174185c) ([#12985](https://www.github.com/tauri-apps/tauri/pull/12985) by [@FabianLars](https://www.github.com/tauri-apps/tauri/../../FabianLars)) The cli will now accept `--bundles updater` again. It's still no-op as it has been for all v2 versions. If you want to build updater artifacts, enable `createUpdaterArtifacts` in `tauri.conf.json`.
- [`eec08a18b`](https://www.github.com/tauri-apps/tauri/commit/eec08a18b66525f5544cd30144d0553260ee3a70) ([#12998](https://www.github.com/tauri-apps/tauri/pull/12998) by [@jason89521](https://www.github.com/tauri-apps/tauri/../../jason89521)) For bun's lockfile, check both `bun.lock` and `bun.lockb`.
- [`b83921226`](https://www.github.com/tauri-apps/tauri/commit/b83921226cb3084992bb5357e7e39a09ea97843e) ([#12977](https://www.github.com/tauri-apps/tauri/pull/12977) by [@lucasfernog](https://www.github.com/tauri-apps/tauri/../../lucasfernog)) Fix `tauri ios` commands using the wrong working directory with `bun@>1.2`.
- [`f268b3dbd`](https://www.github.com/tauri-apps/tauri/commit/f268b3dbdf313484c85b4a1f69cd7cec63049f35) ([#12871](https://www.github.com/tauri-apps/tauri/pull/12871) by [@lucasfernog](https://www.github.com/tauri-apps/tauri/../../lucasfernog)) Ignore parent .gitignore files on the Tauri project path detection.
### Dependencies
- Upgraded to `tauri-utils@2.3.0`
- Upgraded to `tauri-bundler@2.3.0`
## \[2.3.1]
### Bug Fixes
- [`22e9bf74a`](https://www.github.com/tauri-apps/tauri/commit/22e9bf74a4684c827279a85bb66548e83c1ea5cf) ([#12538](https://www.github.com/tauri-apps/tauri/pull/12538) by [@DeTeam](https://www.github.com/tauri-apps/tauri/../../DeTeam)) Set initialViewController for LaunchScreen (iOS).
## \[2.3.0]
### Enhancements
- [`a2d36b8c3`](https://www.github.com/tauri-apps/tauri/commit/a2d36b8c34a8dcfc6736797ca5cd4665faf75e7e) ([#12181](https://www.github.com/tauri-apps/tauri/pull/12181) by [@bastiankistner](https://www.github.com/tauri-apps/tauri/../../bastiankistner)) Add an option to change the default background throttling policy (currently for WebKit only).
- [`6e417c943`](https://www.github.com/tauri-apps/tauri/commit/6e417c9435d8fae0eca9e8d42d6215e887a28d98) ([#12786](https://www.github.com/tauri-apps/tauri/pull/12786) by [@kandrelczyk](https://www.github.com/tauri-apps/tauri/../../kandrelczyk)) Added RPM to the list of package types for which signature file will be generated.
### Dependencies
- Upgraded to `tauri-utils@2.2.0`
- Upgraded to `tauri-bundler@2.2.4`
- Upgraded to `tauri-macos-sign@2.1.0`
## \[2.2.7]
### Bug Fixes
- [`8e9134c4a`](https://www.github.com/tauri-apps/tauri/commit/8e9134c4a2047329be0dbb868b7ae061a9d3f190) ([#12511](https://www.github.com/tauri-apps/tauri/pull/12511) by [@FabianLars](https://www.github.com/tauri-apps/tauri/../../FabianLars)) Fixed an issue that caused `tauri dev` to fail because of an incorrect `--bins` flag.
## \[2.2.6]
### Enhancements
- [`1a86974aa`](https://www.github.com/tauri-apps/tauri/commit/1a86974aa3d09957c6b1142a17bbfed9998798fd) ([#12406](https://www.github.com/tauri-apps/tauri/pull/12406) by [@bradleat](https://www.github.com/tauri-apps/tauri/../../bradleat)) `ios build --open` will now let xcode start the rust build process.
- [`9a30bed98`](https://www.github.com/tauri-apps/tauri/commit/9a30bed98c2d8501328006fad5840eb9d533e1c2) ([#12423](https://www.github.com/tauri-apps/tauri/pull/12423) by [@tr3ysmith](https://www.github.com/tauri-apps/tauri/../../tr3ysmith)) Added conditional logic to MacOS codesigning where only executables get the entitlements file when being signed. This solves an issue where the app may not launch when using 3rd party frameworks if certain entitlements are added. Ex: multicast support (must be applied for through apple developer, and the framework would not have that capability).
- [`0b79af711`](https://www.github.com/tauri-apps/tauri/commit/0b79af711430934362602fb950c3e4cb5b59cf9c) ([#12438](https://www.github.com/tauri-apps/tauri/pull/12438) by [@3lpsy](https://www.github.com/tauri-apps/tauri/../../3lpsy)) Log the command used to start the rust app in development.
### Bug Fixes
- [`bc43c738b`](https://www.github.com/tauri-apps/tauri/commit/bc43c738baf686353690d3d9259b4976881718c8) ([#12442](https://www.github.com/tauri-apps/tauri/pull/12442) by [@FabianLars](https://www.github.com/tauri-apps/tauri/../../FabianLars)) Fixed an issue that prevented `tauri add` to work for the `clipboard-manager` plugin.
- [`27096cdc0`](https://www.github.com/tauri-apps/tauri/commit/27096cdc05d89b61b2372b4e4a3018c87f240ab8) ([#12445](https://www.github.com/tauri-apps/tauri/pull/12445) by [@FabianLars](https://www.github.com/tauri-apps/tauri/../../FabianLars)) Fixed an issue that caused Tauri's CLI to enable tauri's `native-tls` feature even though it wasn't needed. Moved `reqwest` to a mobile-only dependency in `tauri` and enabled its `rustls-tls` feature flag.
### Dependencies
- Upgraded to `tauri-bundler@2.2.3`
## \[2.2.5]
### Dependencies
- Upgraded to `tauri-bundler@2.2.2`
## \[2.2.4]
### Bug Fixes
- [`cad550445`](https://www.github.com/tauri-apps/tauri/commit/cad5504455ffa53e297cebff473c113b1afa5d29) ([#12354](https://www.github.com/tauri-apps/tauri/pull/12354) by [@FabianLars](https://www.github.com/tauri-apps/tauri/../../FabianLars)) Fixed and issue that caused `tauri add` to try to install incorrect npm packages.
## \[2.2.3]
### Enhancements
- [`a0f2c84d5`](https://www.github.com/tauri-apps/tauri/commit/a0f2c84d51f5086c5055867d6f61ea90c463a26c) ([#12204](https://www.github.com/tauri-apps/tauri/pull/12204) by [@pjf-dev](https://www.github.com/tauri-apps/tauri/../../pjf-dev)) Enhance `tauri icon` command by including 64x64 png size in default icon sizes.
### Bug Fixes
- [`98f62e65a`](https://www.github.com/tauri-apps/tauri/commit/98f62e65a27a375272c6b4d9f34c23e142b9d3a6) ([#12246](https://www.github.com/tauri-apps/tauri/pull/12246) by [@marcomq](https://www.github.com/tauri-apps/tauri/../../marcomq)) Properly add NPM packages for community plugins when using the `tauri add` command.
- [`b9a99a5c6`](https://www.github.com/tauri-apps/tauri/commit/b9a99a5c69d8a2a1a3ff30e500b46872258dca15) ([#12297](https://www.github.com/tauri-apps/tauri/pull/12297) by [@FabianLars](https://www.github.com/tauri-apps/tauri/../../FabianLars)) Fixed an issue that caused the built-in dev server to constantly refresh on Linux. This only affected users who do not have `devUrl` point to a URL.
- [`ef21ed9ac`](https://www.github.com/tauri-apps/tauri/commit/ef21ed9ac1c045c38b0c04e3d71a441694abc257) ([#12290](https://www.github.com/tauri-apps/tauri/pull/12290) by [@lucasfernog](https://www.github.com/tauri-apps/tauri/../../lucasfernog)) Fix iOS build failing when the development team contains spaces.
### Dependencies
- Upgraded to `tauri-bundler@2.2.1`
## \[2.2.2]
### Bug Fixes
- [`26fc9558f`](https://www.github.com/tauri-apps/tauri/commit/26fc9558fe7b2fe649f61926da88f36110dd5707) ([#12178](https://www.github.com/tauri-apps/tauri/pull/12178) by [@FabianLars](https://www.github.com/tauri-apps/tauri/../../FabianLars)) Fixed an issue that caused the `tauri dev` file watcher to exit after detecting file changes.
## \[2.2.1]
### Bug Fixes
- [`881729448`](https://www.github.com/tauri-apps/tauri/commit/881729448c9abd0d0c7941a8a31c94119ce827af) ([#12164](https://www.github.com/tauri-apps/tauri/pull/12164) by [@FabianLars](https://www.github.com/tauri-apps/tauri/../../FabianLars)) Fixed an issue that caused `tauri dev` to crash before showing the app on Linux.
## \[2.2.0]
### New Features
- [`cccb308c7`](https://www.github.com/tauri-apps/tauri/commit/cccb308c7b559b0838138d6cea280665f060c925) ([#11562](https://www.github.com/tauri-apps/tauri/pull/11562) by [@jLynx](https://www.github.com/tauri-apps/tauri/../../jLynx)) Generate signature for `.deb` packages when `createUpdaterArtifacts` option is enabled.
- [`74212d40d`](https://www.github.com/tauri-apps/tauri/commit/74212d40d80dba4501b3d4ae30104fa3d447bdf9) ([#11653](https://www.github.com/tauri-apps/tauri/pull/11653) by [@amrbashir](https://www.github.com/tauri-apps/tauri/../../amrbashir)) Include Linux destkop environment and session type in `tauri info` command.
### Enhancements
- [`93a3a043d`](https://www.github.com/tauri-apps/tauri/commit/93a3a043d39cc96515d51d98beeb14261d3a246b) ([#11727](https://www.github.com/tauri-apps/tauri/pull/11727) by [@Kiyozz](https://www.github.com/tauri-apps/tauri/../../Kiyozz)) Add support for `Portuguese` language for NSIS windows installer.
### Bug Fixes
- [`c8700656b`](https://www.github.com/tauri-apps/tauri/commit/c8700656be3001a0cc6e087f23aebd482430a85b) ([#11985](https://www.github.com/tauri-apps/tauri/pull/11985) by [@ShaunSHamilton](https://www.github.com/tauri-apps/tauri/../../ShaunSHamilton)) Fix `tauri remove` from removing object type (`{}`) permissions.
- [`0ae06c5ca`](https://www.github.com/tauri-apps/tauri/commit/0ae06c5ca89cecd24154affdc69668f5e1e67d85) ([#11914](https://www.github.com/tauri-apps/tauri/pull/11914) by [@wtto00](https://www.github.com/tauri-apps/tauri/../../wtto00)) Fix the exclude path in file `Cargo.toml` of plugin template generated by cli. Path changed in [#9346](https://github.com/tauri-apps/tauri/pull/9346)
### Dependencies
- Upgraded to `tauri-bundler@2.2.0`
- Upgraded to `tauri-utils@2.1.1`
## \[2.1.0]
### New Features
- [`1b6b2cfaa`](https://www.github.com/tauri-apps/tauri/commit/1b6b2cfaa14ab1d418c676cedbf942a812377a30) ([#11521](https://www.github.com/tauri-apps/tauri/pull/11521) by [@amrbashir](https://www.github.com/tauri-apps/tauri/../../amrbashir)) Process `bundle > windows > wix > fragmentPaths` with Handlebars to interpolate expressions within it.
- [`6bf917941`](https://www.github.com/tauri-apps/tauri/commit/6bf917941ff0fcc49e86b3ba427340b75f3ce49c) ([#11322](https://www.github.com/tauri-apps/tauri/pull/11322) by [@ShaunSHamilton](https://www.github.com/tauri-apps/tauri/../../ShaunSHamilton)) Add `tauri remove` to remove plugins from projects.
- [`058c0db72`](https://www.github.com/tauri-apps/tauri/commit/058c0db72f43fbe1574d0db654560e693755cd7e) ([#11584](https://www.github.com/tauri-apps/tauri/pull/11584) by [@amrbashir](https://www.github.com/tauri-apps/tauri/../../amrbashir)) Add `bundle > linux > rpm > compression` config option to control RPM bundle compression type and level.
### Enhancements
- [`1f311832a`](https://www.github.com/tauri-apps/tauri/commit/1f311832ab5b2d62a533dfcf9b1d78bddf249ae8) ([#11405](https://www.github.com/tauri-apps/tauri/pull/11405) by [@amrbashir](https://www.github.com/tauri-apps/tauri/../../amrbashir)) Add more context for errors when decoding secret and public keys for signing updater artifacts.
- [`e0d1307d3`](https://www.github.com/tauri-apps/tauri/commit/e0d1307d3f78987d0059921a5ab01ea4b26e0ef1) ([#11414](https://www.github.com/tauri-apps/tauri/pull/11414) by [@Czxck001](https://www.github.com/tauri-apps/tauri/../../Czxck001)) Migrate the `$schema` Tauri configuration to the v2 format.
- [`c43d5df15`](https://www.github.com/tauri-apps/tauri/commit/c43d5df15828ecffa606482ea2b60350c488c981) ([#11512](https://www.github.com/tauri-apps/tauri/pull/11512) by [@lucasfernog](https://www.github.com/tauri-apps/tauri/../../lucasfernog)) Associate a newly created capability file with the `main` window on the `tauri add` and `tauri permission add` commands.
### Bug Fixes
- [`7af01ff2c`](https://www.github.com/tauri-apps/tauri/commit/7af01ff2ce623d727cd13a4c8a549c1c80031882) ([#11523](https://www.github.com/tauri-apps/tauri/pull/11523) by [@amrbashir](https://www.github.com/tauri-apps/tauri/../../amrbashir)) Fix `tauri migrate` failing to install NPM depenencies when running from Deno.
- [`100a4455a`](https://www.github.com/tauri-apps/tauri/commit/100a4455aa48df508510bbc08273215bdf70c012) ([#11529](https://www.github.com/tauri-apps/tauri/pull/11529) by [@amrbashir](https://www.github.com/tauri-apps/tauri/../../amrbashir)) Fix detecting yarn berry (v2 and higher) in various tauri cli commands.
- [`60e86d5f6`](https://www.github.com/tauri-apps/tauri/commit/60e86d5f6e0f0c769d34ef368cd8801a918d796d) ([#11624](https://www.github.com/tauri-apps/tauri/pull/11624) by [@lucasfernog](https://www.github.com/tauri-apps/tauri/../../lucasfernog)) Use the public network IP address on `android dev` by default on Windows.
### Dependencies
- Upgraded to `tauri-utils@2.1.0`
- Upgraded to `tauri-bundler@2.1.0`
## \[2.0.4]
### Enhancements
- [`e4c9268b1`](https://www.github.com/tauri-apps/tauri/commit/e4c9268b19c614dc9ebb0895448fd16de7efee80) ([#11258](https://www.github.com/tauri-apps/tauri/pull/11258) by [@regexident](https://www.github.com/tauri-apps/tauri/../../regexident)) Support custom project directory structure where the Tauri app folder is not a subfolder of the frontend project.
The frontend and Tauri app project paths can be set with the `TAURI_FRONTEND_PATH` and the `TAURI_APP_PATH` environment variables respectively.
### Dependencies
- Upgraded to `tauri-bundler@2.0.4`
## \[2.0.3]
### New Features
- [`eda5713ea`](https://www.github.com/tauri-apps/tauri/commit/eda5713eab78d28182071ea25ceca5f1994f37ea) ([#11242](https://www.github.com/tauri-apps/tauri/pull/11242) by [@alex-sandri](https://www.github.com/tauri-apps/tauri/../../alex-sandri)) Add `Italian` to supported NSIS installer languages
- [`b3563e3d6`](https://www.github.com/tauri-apps/tauri/commit/b3563e3d6ae8dc90ee68f25f575cd5538ab1915b) ([#11304](https://www.github.com/tauri-apps/tauri/pull/11304) by [@amrbashir](https://www.github.com/tauri-apps/tauri/../../amrbashir)) Add Deno support in tauri-cli operations.
### Bug Fixes
- [`d609bef9f`](https://www.github.com/tauri-apps/tauri/commit/d609bef9fd7cd6eeb2bd701558100bd9cfb6e6f6) ([#11314](https://www.github.com/tauri-apps/tauri/pull/11314) by [@amrbashir](https://www.github.com/tauri-apps/tauri/../../amrbashir)) Fix android invalid proguard file when using an `identifier` that contains a component that is a reserved kotlin keyword, like `in`, `class`, etc
- [`069c05e44`](https://www.github.com/tauri-apps/tauri/commit/069c05e44fd6f30083fdc00dd6c0001278898592) ([#11315](https://www.github.com/tauri-apps/tauri/pull/11315) by [@amrbashir](https://www.github.com/tauri-apps/tauri/../../amrbashir)) Fix CLI crashing and failing to find a `.ico` file when `bundle > icon` option is using globs and doesn't have a string that ends with `.ico`.
### Dependencies
- Upgraded to `tauri-bundler@2.0.3`
## \[2.0.2]
### What's Changed
- [`4475fbb50`](https://www.github.com/tauri-apps/tauri/commit/4475fbb502c5ffb3cea4de6bef1c7869be39bed6) ([#11208](https://www.github.com/tauri-apps/tauri/pull/11208) by [@lucasfernog](https://www.github.com/tauri-apps/tauri/../../lucasfernog)) Update cargo-mobile2 to 0.17.3, fixing lib name validation.
- [`a49a19ffa`](https://www.github.com/tauri-apps/tauri/commit/a49a19ffa304f031fb1a04d31a567cc7f42a380a) ([#11218](https://www.github.com/tauri-apps/tauri/pull/11218)) Fix bundling `appimage`, `deb` and `rpm` bundles failing to open when using `mainBinaryName` with spaces.
### Dependencies
- Upgraded to `tauri-bundler@2.0.2`
## \[2.0.1]
### What's Changed
- [`0ab2b3306`](https://www.github.com/tauri-apps/tauri/commit/0ab2b330644b6419f6cee1d5377bfb5cdda2ccf9) ([#11205](https://www.github.com/tauri-apps/tauri/pull/11205) by [@lucasfernog](https://www.github.com/tauri-apps/tauri/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
### Dependencies
- Upgraded to `tauri-utils@2.0.1`
- Upgraded to `tauri-macos-sign@2.0.1`
- Upgraded to `tauri-bundler@2.0.1`
## \[2.0.0]
### What's Changed

View File

@@ -1,6 +1,6 @@
[package]
name = "tauri-cli"
version = "2.0.0"
version = "2.7.0"
authors = ["Tauri Programme within The Commons Conservancy"]
edition = "2021"
rust-version = "1.77.2"
@@ -36,75 +36,72 @@ name = "cargo-tauri"
path = "src/main.rs"
[target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\", target_os = \"windows\", target_os = \"macos\"))".dependencies]
cargo-mobile2 = { version = "0.17.2", default-features = false }
cargo-mobile2 = { version = "0.20.2", default-features = false }
[dependencies]
jsonrpsee = { version = "0.24.5", features = ["server"] }
jsonrpsee-core = "0.24.5"
jsonrpsee-client-transport = { version = "0.24.5", features = ["ws"] }
jsonrpsee-ws-client = { version = "0.24.5", default-features = false }
jsonrpsee = { version = "0.24", features = ["server"] }
jsonrpsee-core = "0.24"
jsonrpsee-client-transport = { version = "0.24", features = ["ws"] }
jsonrpsee-ws-client = { version = "0.24", default-features = false }
sublime_fuzzy = "0.7"
clap_complete = "4"
clap = { version = "4.5", features = ["derive", "env"] }
anyhow = "1.0"
tauri-bundler = { version = "2.0.0", default-features = false, path = "../tauri-bundler" }
colored = "2.1"
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0", features = ["preserve_order"] }
notify = "6.1"
notify-debouncer-mini = "0.4"
shared_child = "1.0"
duct = "0.13"
clap = { version = "4", features = ["derive", "env"] }
anyhow = "1"
tauri-bundler = { version = "2.5.1", default-features = false, path = "../tauri-bundler" }
colored = "2"
serde = { version = "1", features = ["derive"] }
serde_json = { version = "1", features = ["preserve_order"] }
json5 = "0.4"
notify = "8"
notify-debouncer-full = "0.5"
shared_child = "1"
duct = "1.0"
toml_edit = { version = "0.22", features = ["serde"] }
json-patch = "2.0"
tauri-utils = { version = "2.0.0", path = "../tauri-utils", features = [
"isolation",
"schema",
"config-json5",
"config-toml",
] }
tauri-utils-v1 = { version = "1", package = "tauri-utils", features = [
json-patch = "3"
tauri-utils = { version = "2.6.0", path = "../tauri-utils", features = [
"isolation",
"schema",
"config-json5",
"config-toml",
"html-manipulation",
] }
toml = "0.8"
jsonschema = "0.18"
handlebars = "6.0"
jsonschema = "0.30"
handlebars = "6"
include_dir = "0.7"
minisign = "=0.7.3"
base64 = "0.22.0"
ureq = { version = "2.9.6", default-features = false, features = ["gzip"] }
base64 = "0.22"
ureq = { version = "3", default-features = false, features = ["gzip"] }
os_info = "3"
semver = "1.0"
regex = "1.10.3"
semver = "1"
regex = "1"
heck = "0.5"
dialoguer = "0.11"
url = { version = "2.5", features = ["serde"] }
url = { version = "2", features = ["serde"] }
os_pipe = "1"
ignore = "0.4"
ctrlc = "3.4"
ctrlc = "3"
log = { version = "0.4.21", features = ["kv", "kv_std"] }
env_logger = "0.11.5"
env_logger = "0.11"
icns = { package = "tauri-icns", version = "0.1" }
image = { version = "0.25", default-features = false, features = ["ico"] }
axum = { version = "0.7.4", features = ["ws"] }
html5ever = "0.26"
kuchiki = { package = "kuchikiki", version = "0.8" }
axum = { version = "0.8", features = ["ws"] }
html5ever = "0.29"
kuchiki = { package = "kuchikiki", version = "=0.8.8-speedreader" }
tokio = { version = "1", features = ["macros", "sync"] }
common-path = "1"
serde-value = "0.7.0"
serde-value = "0.7"
itertools = "0.13"
local-ip-address = "0.6"
css-color = "0.2"
resvg = "0.43.0"
resvg = "0.45.0"
dunce = "1"
glob = "0.3"
oxc_parser = "0.24"
oxc_span = "0.24"
oxc_allocator = "0.24"
oxc_ast = "0.24"
# 0.39 raised msrv to above 1.78 but 0.37+ can't compile on 1.77.2 either.
oxc_parser = "0.36"
oxc_span = "0.36"
oxc_allocator = "0.36"
oxc_ast = "0.36"
magic_string = "0.3"
phf = { version = "0.11", features = ["macros"] }
walkdir = "2"
@@ -112,15 +109,16 @@ elf = "0.7"
memchr = "2"
tempfile = "3"
uuid = { version = "1", features = ["v5"] }
rand = "0.8"
rand = "0.9"
[dev-dependencies]
insta = "1"
pretty_assertions = "1"
[target."cfg(windows)".dependencies.windows-sys]
version = "0.59"
version = "0.60"
features = [
"Win32_Security",
"Win32_Storage_FileSystem",
"Win32_System_IO",
"Win32_System_Console",
@@ -131,7 +129,7 @@ libc = "0.2"
[target."cfg(target_os = \"macos\")".dependencies]
plist = "1"
tauri-macos-sign = { version = "2.0.0", path = "../tauri-macos-sign" }
tauri-macos-sign = { version = "2.1.0", path = "../tauri-macos-sign" }
object = { version = "0.36", default-features = false, features = [
"macho",
"read_core",
@@ -147,4 +145,4 @@ native-tls = [
"ureq/native-tls",
]
native-tls-vendored = ["native-tls", "tauri-bundler/native-tls-vendored"]
rustls = ["tauri-bundler/rustls", "cargo-mobile2/rustls", "ureq/tls"]
rustls = ["tauri-bundler/rustls", "cargo-mobile2/rustls", "ureq/rustls"]

View File

@@ -17,6 +17,7 @@ These environment variables are inputs to the CLI which may have an equivalent C
- `TAURI_BUNDLER_WIX_FIPS_COMPLIANT` — Specify the bundler's WiX `FipsCompliant` option.
- `TAURI_BUNDLER_TOOLS_GITHUB_MIRROR` - Specify a GitHub mirror to download files and tools used by tauri bundler.
- `TAURI_BUNDLER_TOOLS_GITHUB_MIRROR_TEMPLATE` - Specify a GitHub mirror template to download files and tools used by tauri bundler, for example: `https://mirror.example.com/<owner>/<repo>/releases/download/<version>/<asset>`.
- `TAURI_BUNDLER_DMG_IGNORE_CI` - Disable the check for `CI: true` in the `.dmg` bundler.
- `TAURI_SKIP_SIDECAR_SIGNATURE_CHECK` - Skip signing sidecars.
- `TAURI_SIGNING_PRIVATE_KEY` — Private key used to sign your app bundles, can be either a string or a path to the file.
- `TAURI_SIGNING_PRIVATE_KEY_PASSWORD` — The signing private key password, see `TAURI_SIGNING_PRIVATE_KEY`.

View File

@@ -40,28 +40,3 @@ MIT or MIT/Apache 2.0 where applicable.
Logo: CC-BY-NC-ND
- Original Tauri Logo Designs by [Daniel Thompson-Yvetot](https://github.com/nothingismagick) and [Guillaume Chau](https://github.com/akryum)
## Licensing Errata:
Because of publishing issues upstream, we soft-forked (and patched) both [`console`](https://github.com/mitsuhiko/console/blob/278de9dc2bf0fa28db69adee351072f668beec8f/Cargo.toml#L7) and [`dialoguer`](https://github.com/mitsuhiko/dialoguer/blob/2c3fe6b64641cfb57eb0e1d428274f63976ec150/Cargo.toml#L12) crates because of untenable issues surrounding expected use on Windows.
This soft fork was introduced to the Tauri Codebase [here](https://github.com/tauri-apps/tauri/pull/1610).
`console`
```
license = "MIT"
authors = [
"Armin Ronacher <armin.ronacher@active-4.com>"
]
```
`dialoguer`
```
license = "MIT"
authors = [
"Armin Ronacher <armin.ronacher@active-4.com>",
"Pavan Kumar Sunkara <pavan.sss1991@gmail.com>"
]
```

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