[desktop] Improve tauri update doc

This commit is contained in:
Vladimir Stoilov 2025-03-04 18:09:10 +02:00
parent 161b75e39e
commit d74083ced8
No known key found for this signature in database

View file

@ -1,6 +1,7 @@
# Update Tauri guide
Check latest versions of tauri packages and update them accordingly:
Check latest versions of tauri packages and update them accordingly (https://crates.io/)
Cargo.toml:
```toml
[build-dependencies]
tauri-build = { version = "2.0.0-beta.19", features = [] } # Update to latest
@ -21,21 +22,25 @@ tauri-plugin-window-state = "2.0.0-beta"
tauri-cli = "2.0.0-beta.21" # Update to latest
```
> The plugins will be auto updated based on tauri version.
Run:
```sh
cargo update
```
Update WIX installer template:
1. Get the latests [main.wxs](https://github.com/tauri-apps/tauri/blob/dev/tooling/bundler/src/bundle/windows/templates/main.wxs) template from the repository.
2. Replace the contents of `templates/main_original.wxs` with the repository version.
3. Replace the contents of `templates/main.wsx` and add the fallowing lines at the end of the file, inside the `Product` tag.
> Make sure to update the npm tauri plugin dependencies to have the same version as the rust plugins. (desktop/angular)
## Update WIX installer template
> If the migration functionality is not needed anymore remove the template, this will cause tauri to use its default template and not call the migration script.
1. Get the latest [main.wxs](https://github.com/tauri-apps/tauri/blob/dev/tooling/bundler/src/bundle/windows/templates/main.wxs) template from the repository.
2. Replace the contents of `templates/wix/main_original.wxs` with the repository version. (The file is kept only for reference)
3. Replace the contents of `templates/wix/main.wsx` and add the fallowing lines at the end of the file, inside the `Product` tag.
```xml
<!-- Service fragments -->
<CustomActionRef Id='InstallPortmasterService' />
<CustomActionRef Id='StopPortmasterService' />
<CustomActionRef Id='DeletePortmasterService' />
<CustomActionRef Id='MigrationPropertySet' />
<CustomActionRef Id='Migration' />
<!-- Uncommenting the next line will cause the installer to check if the old service is running and fail. Without it, it will automatically stop and remove the old service without notifying the user. -->
<!-- <CustomActionRef Id='CheckServiceStatus' /> -->
<!-- End Service fragments -->
```