问题
there is a little problem with closing running processes (without an ui).
We're writing an application which doesn't have an (main) ui except a tray icon for opening preferences.
I added a "Check for running processes" with "Allow soft close and termination" option to the installation process.
If I try to install a new version of my application I get the message, that there is a running process of my application, but if I click on "Close processes", nothing happens, only on "Terminate processes" it will be killed.
If I open the preferences window of my application the window will be closed but not the process itself.
On macOS it is working fine.
We're using latest install4J-6 version.
Do I have to set another option or do I have to launch a script which will terminate my application?
Thanks :)
回答1:
Soft close is not guaranteed to succeed. On Windows it works like this:
"Soft close" posts a
WM_CLOSE
message to all visible windows of a process. This may not work if the application does not cooperate, for example if a modal dialog is being displayed."Terminate" operates on the process and calls
TerminateProcess
which succeeds without the cooperation of the application.
来源:https://stackoverflow.com/questions/49859793/close-processes-in-check-for-running-processes-does-not-work-correctly-on-wind