-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
enhance(nsis): use restart manager to close app #14479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
Package Changes Through f903f5dThere 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 VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
Use restart manager APIs manually
|
I know the code is a bit wacky, but honestly I can't quite think of anything better here Since there's a cost with |
|
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 Not sure if we should just call |
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 aWM_ENDSESSIONsignal 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 downOne more thing to go though, we should probably also switch
nsis_tauri_utils::FindProcesstoRmGetListand use a fully qualified path here, so we fully fix this problem