You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using KillProcess or KillProcessCurrentUser to close the tauri application during uninstallation, the tauri application cannot perform pre exit processing
#39
KillProcess or KillProcessCurrentUser will call TerminateProcess, which will force the process to terminate and the process will not receive any signals.
My Tauri application needs to perform some cleaning and closing child processes before terminate, which can result in orphan processes and occupy files in the application directory, leading to uninstallation and reinstallation exceptions.
I tried to change TerminateProcess to GenerateConsoleCtrlEvent and replace nsis-tauri-utils.dll, but Tauri detects the hash value of the file and corrects it during build, so I cannot confirm if GenerateConsoleCtrlEvent will work.
The text was updated successfully, but these errors were encountered:
GenerateConsoleCtrlEvent does not work,But I found a solution.
Just call taskkill.exe /PID {pid} /F /T. taskkill.exe /PID {pid} /F is equivalent to TerminateProcess, and the Process::kill function in the sysinfo crate is also implemented with this. Add /T(tree kill) to close all child processes and solve the issue.
amrbashir
added a commit
to tauri-apps/tauri
that referenced
this issue
Sep 18, 2024
KillProcess or KillProcessCurrentUser will call TerminateProcess, which will force the process to terminate and the process will not receive any signals.
My Tauri application needs to perform some cleaning and closing child processes before terminate, which can result in orphan processes and occupy files in the application directory, leading to uninstallation and reinstallation exceptions.
I tried to change TerminateProcess to GenerateConsoleCtrlEvent and replace nsis-tauri-utils.dll, but Tauri detects the hash value of the file and corrects it during build, so I cannot confirm if GenerateConsoleCtrlEvent will work.
The text was updated successfully, but these errors were encountered: