question

GiregdeKerdanet-4597 avatar image
0 Votes"
GiregdeKerdanet-4597 asked NicoZhu-MSFT commented

Is it possible to embed a win32 .exe into a UWP app so it (the win32 .exe) can be launched by a browser extension and communicate with the browser extension via stdin/stdout ?

Everything is in the title.
My goal is to let a browser extension read and write files in the private data folder of my UWP app. This .exe file would implement the native messaging protocol via stdin/stdout to communicate with the browser extension since the UWP app itself cannot do it.

I would then have to add an entry in the registry to point to the native messaging host manifest (which itself points to this .exe) but that's for another question.

windows-uwp
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Which app you want to launch from browser extension, embed win32 exe or UWP app?

0 Votes 0 ·

Hello @NicoZhu-MSFT , I want the win32 app to be launched.

0 Votes 0 ·

1 Answer

NicoZhu-MSFT avatar image
0 Votes"
NicoZhu-MSFT answered NicoZhu-MSFT commented

Hello, Welcome to Micorosoft Q&A,

if you have embed win32 exe into UWP app as desktop-bridge extension. you can't launch this exe from browser extension, even if you could launch it with path, but this exe is run in the independent process, and it has no permission to access UWP local folder. For your scenario, the better way is register url scheme for UWP app, and launch uwp app with this scheme then call `FullTrustProcessLauncher` to start embed exe to make native messaging protocol via stdin/stdout .



If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@NicoZhu-MSFT thank you very much for your answer.

I'm not sure I understand how that would work. If it is the UWP app that launches the embeded exe instead of the browser, how will the exe send results to the browser extension ?

0 Votes 0 ·

if the helper has launched, you could use your mentioned native-messaging protocol to send the message.

0 Votes 0 ·