Hi,
Here is a problem.
I would like to run an application with normal user privileges from elevated process.
My installer (elevated process) is written in Delphi. It launches some programs at the end of installation.
Now, as Installer is elevated, lauched process is also elevated - we don't want this!
The goal is to launch non-elevated process from elevated installer process. So:
- Launch any application with normal user privileges
- Launch default web browser with given webpage
- Send email to given person (with protocol Sendto:)
As far as I know it can be done using Windows Explorer process. I couldn't find any Delphi code for that in Internet 😞 I only found C- based.
Here is one that suppose to work: https://www.appsloveworld.com/coding/delphi/48/createprocess-with-lower-privileges-than-the-caller
Could you please try to convert it into Delphi?
I tried, but without success (see below example).
There are some problems with pointers (I tried to do pointers typecasting - it compiled, but with access violation)...
For example: FindDesktopFolderView(IID_IShellView, spsv); --> FindDesktopFolderView(IID_IShellView, Pointer(spsv));
I am sure, this is not a way I should do.
Here is my code in simple project.
Source: https://www.dropbox.com/s/6ndno59brgbn6l0/ExecAsUser.zip?dl=1
Thanks in advance,
-Pawel