Open HamletHakobyan opened 4 years ago
Ok.
I probably found to cause of issue.
CloseApplication is searching for processes by name using CreateToolhelp32Snapshot
function from Tlhelp32.h
passing TH32CS_SNAPPROCESS
.
From Microsoft docs:
After that we sent close messages to all processes found by search.
Instead, IMO, we need to filter out processes by using ProcessIdToSessionId
function to close applications only from current session.
Add an option to allow per-user and per-machine packages to restrict to the current session.
There are two users that are logged in (two active sessions). When in the first session I open Outlook and have trying to install my app in per user scenario on second session, the msi installer ask me to close Outlook inspite of that I have no opened Outlook in the current session.