How to launch platform specific Executable of desktop:Extension from UWP

SmilingMoon 981 Reputation points
2021-09-17T06:38:16.337+00:00

UWP runs systray extension Windows Form app (runs various win32 tasks).

			<desktop:Extension Category="windows.fullTrustProcess" Executable="Assets\SysTray\SysTrayExtension.exe" />

However, I like to launch the exe based on the platform of running UWP app.
Is there a way specify placehold of platform like
Executable="Assets\SysTray[platform]\SysTrayExtension.exe"

Is it doable?
Thank you,

Universal Windows Platform (UWP)
0 comments No comments
{count} votes

Accepted answer
  1. Nico Zhu (Shanghai Wicresoft Co,.Ltd.) 12,851 Reputation points
    2021-09-20T02:28:07.73+00:00

    Hello, Welcome to Micorosoft Q&A,

    Is there a way specify placehold of platform like Executable="Assets\SysTray[platform]\SysTrayExtension.exe"

    I'm afraid you can't specify the placehold of platform like above, because Executable field was written in the package manifest, it can't be update in the runtime.

    For your scenario, the better way is make a middle launcher(win32), and launch each platform app with Process.Start() method. For detail steps, please refer stefan's blog UWP with Desktop Extension – Part 2.


    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.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. SmilingMoon 981 Reputation points
    2021-09-20T20:01:06.477+00:00

    I found that I got the wrong way. I need to create "Windows Application Packaging Project" instead of copying the files.

    1 person found this answer helpful.
    0 comments No comments