Archive: UAC and FindProcess problematic interaction


UAC and FindProcess problematic interaction
Hi,
I want to do the following:

1- Use the UAC plugin so that the installer can be run as an admin and still be able to start the application as the logged on user

2- Detect if the application is already running so I can tell the user to close it. I am using the FindProcess for this purpose (http://nsis.sourceforge.net/FindProcess)

The problem:
The process calling FindProcess is running as Administrator. The script needs to get a handle on the first module of each process in order to call GetModuleBaseName. This is done through a call to OpenProcess().

However, a given user (even Administrator) cannot open the process of another user. The OpenProcess call always return Access Denied.

I see that I should grant SeDebugPrivileges to the installer process, but this just seems so overkill. Heck I just want to see if some .exe file is running or not.

Any clues to help me?


SeDebugPrivileges in the FindProcess plugin would be the way to go