I\'ve read the following post. My Code looks exactly the same, but does not work:
Inno Setup Checking for running process
I copied the example from http://www.vi
I don't have enough rep points to add a comment to RRUZ's excellent answer, so I'll just add this here. Make sure you catch exceptions, otherwise the installer will fail for users who can't access the service.
try
FSWbemLocator := CreateOleObject('WBEMScripting.SWBEMLocator');
FWMIService := FSWbemLocator.ConnectServer('', 'root\CIMV2', '', '');
FWbemObjectSet := FWMIService.ExecQuery(Format('SELECT Name FROM Win32_Process Where Name="%s"',[FileName]));
Result := (FWbemObjectSet.Count > 0);
except
end;