Skip to content

enhance(nsis): use restart manager to close app#14479

Draft
Legend-Master wants to merge 4 commits into
tauri-apps:devfrom
Legend-Master:nsis-restart-manager
Draft

enhance(nsis): use restart manager to close app#14479
Legend-Master wants to merge 4 commits into
tauri-apps:devfrom
Legend-Master:nsis-restart-manager

Conversation

@Legend-Master
Copy link
Copy Markdown
Contributor

@Legend-Master Legend-Master commented Nov 16, 2025

Closes #9950
Closes tauri-apps/nsis-tauri-utils#39
Reference tauri-apps/tao#1115

Use Restart Manager to close running app instead of our own nsis_tauri_utils::KillProcess, this makes it so that we send a WM_ENDSESSION signal to the app for it to gracefully shutdown (paired with tauri-apps/tao#1126)

This also fixed a problem where we would wrongly detect other programs that have the same name as us (e.g. both named api.exe) and shut them down

One more thing to go though, we should probably also switch nsis_tauri_utils::FindProcess to RmGetList and use a fully qualified path here, so we fully fix this problem

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Nov 16, 2025

Package Changes Through f903f5d

There are 5 changes which include @tauri-apps/api with patch, tauri with patch, tauri-cli with patch, tauri-bundler with minor, @tauri-apps/cli with patch

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
@tauri-apps/api 2.9.0 2.9.1
tauri-bundler 2.7.3 2.8.0
tauri 2.9.3 2.9.4
@tauri-apps/cli 2.9.4 2.9.5
tauri-cli 2.9.4 2.9.5

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@Legend-Master Legend-Master marked this pull request as ready for review November 17, 2025 07:38
@Legend-Master Legend-Master requested review from a team as code owners November 17, 2025 07:38
@Legend-Master Legend-Master added this to the 2.10 milestone Nov 17, 2025
@Legend-Master
Copy link
Copy Markdown
Contributor Author

@Legend-Master
Copy link
Copy Markdown
Contributor Author

Actually, this will cause the app to crash on https://github.com/tauri-apps/tao/blob/3c2b4447aa53151ae96d30a60928d1d71e9bb5fc/src/platform_impl/windows/event_loop/runner.rs#L368 because Restart Manager works a bit differently from system shutdown, it doesn't terminate us right away after returning 0 from WM_ENDSESSION

Not sure if we should just call std::process::exit when we get WM_ENDSESSION to keep the behavior consistent though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant